?? spec.5t
字號:
.\" Copyright (c) 1987 Entropic Speech, Inc.; All rights reserved.\" @(#)spec.5t 1.2 7/15/87 ESI.TH SPEC 5\-ESPS 7/15/87.ds ]W "\fI\s+4\ze\h'0.05'e\s-4\v'-0.4m'\fP\(*p\v'0.4m'\ Entropic Speech, Inc..SH NAMEESPS SPEC Spectral Record File \- (.spec).SH SYNOPSIS.B #include <sps/header.h>.br.B #include <sps/spec.h>.SH DESCRIPTIONA Spectral Record file consists of a header followed by a series of tagged records or a series of untagged records.Each record consists ofa vector of spectral values (powers or power densities in the case ofpower spectra),together with certain optional fields \-an imaginary-part vector, frame length, voicing indicator,number of frequencies, and a vector of frequencies \-that are present or absent according to the values of certain header fields..PPThe header has the following layout as defined by.I <sps/header.h>The data items common to all ESPS data files are described in.IR ESPS (5\-ESPS).The type specific header structure for SPEC filesis shown below..PP.nf.br/* SPEC Spectral Record File specific header */.br.spstruct spec_header {.TSl1 l1 l1 l. long start; /\(** starting point analyzed \(**/ long nan; /\(** number of points analyzed \(**/ short frmlen; /\(** analysis window width \(**/ short order_vcd; /\(** model order voiced \(**/ short order_unvcd; /\(** model order unvoiced \(**/ short win_type; /\(** data window type \(**/ float sf; /\(** sampling frequency \(**/ short spec_an_meth; /\(** analysis method \(**/ float dcrem; /\(** DC term removed \(**/ short post_proc; /\(** post-processing method \(**/ short frame_meth; /\(** how speech was divided into frames \(**/ short voicing; /\(** voicing indicator appears in each record \(**/ short freq_format; /\(** how to determine the set of frequencies \(**/ short spec_type; /\(** are data power, log power, complex, etc.? \(**/ short contin; /\(** discrete distribution or continuous density? \(**/ long num_freqs; /\(** number of frequencies \(**/ short spares[SPEC_SPARES]; /\(** spares \(**/ float *freqs; /\(** frequencies (if listed in header) \(**/.TE.TSl1 l1 l1 l. struct zfunc *pre_emp; /\(** preemphasis filter \(**/.TE};.fi.sp.PPThe following items are all in the SPEC file specific header structure..IP startStarting point analyzed,with reference to the file named by.I refer..IP nanNumber of points analyzed,with reference to the file named by.I refer..IP frmlenAnalysis window width, the number of data points used for analysis,if the same for all records..IP order_vcdModel order (number of autoregressive coefficients) for voiced speech..IP order_unvcdModel order (number of autoregressive coefficients) for unvoiced speech..IP win_typeWindow type. Indicates the type of window function applied to the data, NONE if no window function was applied.Type codes are defined in.I <sps/header.h>..IP sfSampling frequency of the reference file, if any; for certain values of.I freq_format,used in determining band limits.If zero, there is no reference file..IP spec_an_methSpectrum analysis method. Values are defined in.I <sps/header.h>..IP dcremIf the DC term in the original source data was removed beforeanalysis its value is stored here..IP post_proc;Post-processing operation (such as smoothing). Values are defined in.I <sps/header.h>..IP frame_methMethod used for selecting analysis frames.If FM_NONE, frame length is not defined.If FM_FIXED, the frame length is given by.I frmlenin the header.For other framing methods, the.I frame_lenfield is present in each record and gives the frame length..IP voicingIf YES, the.I voicedfield is present in each record, and the model order is.I order_vcdor.I order_unvcdaccording to its value.If NO,.I order_vcdand.I order_unvcdmust be equal or undefined..IP freq_formatIf SYM_CTR, the spectrum is symmetric,and only the positive-frequency part is given.The frequencies are the centers of.I num_freqsequal bins that span the band from 0 to.I "sf/2."Thus the frequencies run from.I "sf/(4*num_freqs)"to.I "sf/2 \- sf/(4*num_freqs)"in steps of.I "sf/(2*num_freqs).".IPIf SYM_EDGE, the spectrum is symmetric,and only the positive-frequency part is given.The frequencies are the edges of.I "num_freqs \- 1"equal bins that span the band from 0 to.I "sf/2."Thus the frequencies run from.I 0to.I "sf/2"in steps of.I "sf/(2*(num_freqs\-1)).".IPIf ASYM_CEN, the spectrum is not (necessarily) symmetric,and both positive-frequency and negative-frequency parts are given.The frequencies are the centers of.I num_freqsequal bins that span the band from.I "\-sf/2"to.I "sf/2."Thus the frequencies run from.I "\- sf/2 + sf/(2*num_freqs)"to.I "sf/2 \- sf/(2*num_freqs)"in steps of.I "sf/num_freqs.".IPIf ASYM_EDGE, the spectrum is not (necessarily) symmetric,and both positive-frequency and negative-frequency parts are given.The frequencies are the edges of.I "num_freqs \- 1"equal bins that span the band from.I "\-sf/2"to.I "sf/2."Thus the frequencies run from.I "\-sf/2"to.I "sf/2"in steps of.I "sf/(num_freqs\-1).".IPIf ARB_VAR, both positive-frequency and negative-frequency parts must be given.The frequencies need not be equispaced and are listed explicitly in.I frqsin each record..IPIf ARB_FIXED, both positive-frequency and negative-frequency parts must be given.The frequencies need not be equispaced and are listed explicitly in.I freqsin the header.The ARB_FIXED frequency format is not yet implemented..IP spec_typeIf ST_PWR, actual values of spectral powers or power densities(necessarily positive) are stored in the records.If ST_DB, logarithmically scaled powers or power densities (in decibels)are stored in the records.If ST_REAL, the records contain real values other than the above \-.I e.g.values of a weighting function.If ST_CPLX, complex spectral values are stored in the records..IP continIf YES, the data represent samples of a continuous density function.For example, if.IR spec_type ==ST_PWR,the data give the amount of power per unit frequencyin the neighborhood of each given frequency.If NO, the data represent a discrete distribution.For example, if.IR spec_type ==ST_PWR,the data give the amount of power concentrated at each given frequency..IP num_freqsThe number of frequencies for which spectral values are given.If.IR freq_format ==ARB_VAR,this is a maximum number, the number for which space is allocated,and the actual number is in.I n_frqsin each record..IP sparesThere are SPEC_SPARES spare shorts..IP freqsFrequencies to which the spectral values in each record correspond.This field is NULL unless.IR freq_format ==ARB_FIXED..IP pre_emp A pointer to a preemphasis filter..PPThe data follows the header.The data structure in the file is shown below in C syntax.Of course, the variable.I num_freqscannot be used in the declaration, but is used to allocate the correctamount of memory..PPThis data structure is defined in.I <sps/spec.h>.A function is available to allocate memory forthis data structure, based on a particular header, and to fill in thetype fields in the common part of the header.See.IR allo_spec_rec " and " write_header (3\-ESPSu)..nf.sp.if n .ta 37.if t .ta 3istruct spec_data { long tag; /\(** position tag \(**/ float re_spec_val[num_freqs]; /\(** real part of spectral value \(**/ float im_spec_val[num_freqs]; /\(** imaginary part of spectral value \(**/ float frqs[num_freqs]; /\(** frequencies \(**/ long n_frqs; /\(** number of frequencies \(**/ short frame_len; /\(** number of samples in analysis window \(**/ short voiced; /\(** YES for voiced frame \(**/};.fi.PPSPEC files optionally have a position tag in each record.In addition there is space for.I num_freqsreal or complex values, where.I num_freqsis given in the header.If the header item.I spec_typehas any value but ST_CPLX, then.I im_spec_valis required to be all zeros in memory and is not stored in the file.(See.IR allo_spec_rec " and " put_spec_rec (3\-ESPSu)on this point, and on the treatment of.I frame_len, voiced, n_frqs,and.I frqswhen not defined.)If.I frame_methin the header is neither FM_NONE nor FM_FIXED,.I frame_lenis defined and is the length of the analysis frame.If.I voicingin the header is YES,.I voicedis defined and is a voicing indicator: YES for voiced, NO for unvoiced.If.I freq_formatin the header is ARB_VAR, then.I n_frqsand.I frqsare defined, and.I n_frqsfrequencies in.I frqsand the first.I n_frqsspectral values are valid (though space for.I num_freqsfrequencies and.I num_freqsspectral values is allocated)..SH FILES/usr/include/sps/header.h,/usr/include/sps/spec.h.SH SEE ALSOallo_spec_rec(3\-ESPSu), get_spec_rec(3\-ESPSu), put_spec_rec(3\-ESPSu),read_header(3\-ESPSu), write_header(3\-ESPSu)ESPS(5\-ESPS), PIT(5\-ESPS), ANA(5\-ESPS), SD(5\-ESPS),.SH FUTURE CHANGESImplement case ARB_FIXED for.I freq_format..SH AUTHORRodney Johnson, Entropic Speech, Inc.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -