intro.vrme

来自「speech signal process tools」· VRME 代码 · 共 1,038 行 · 第 1/3 页

VRME
1,038
字号
the file header the average rate of zero crossings, but applicationsarise when it is convenient to do so.  To address such needs, ESPSprovides generic header items..lp Generic header items provide programmers with theability to create arbitrary named fields in the header of any ESPSfile.  Utility functions in the ESPS library facilitate the creationand manipulation of generics.  For example, the function .i add_genhd_f (3\-\s-1ESPS\s+1) can be used to create a generic header comprisingone or more floats.  Here's one example of its use to createand fill an item called "zero_cross_rate":  .vS.nf    struct header *hd;    float time;    long nzeros;    . . .    *add_genhd_f("zero_cross_rate", NULL, 1L, hd) = nzeros / time;.fi.vE.lpSimilarly, \fIget_genhd\fP (3\-\s-1ESPS\s+1) returns a pointer toan existing generic and might be used as follows:.vS.nf    struct header *hd;    long estim_zeros;    float time;    . . .    /*compute estimated number of zeros*/    estim_zeros = time * (*(float *) get_genhd("zero_cross_rate", hd));.fi.vE.lpGeneric header items can store any type of C variable values, includingcharacters (and strings).  Also provided are generic header items to store enumerated types (also called coded types).  These headeritems store an integer value but allow those values to be expressedsymbolically via a set of pre-defined strings.	For example, this code creates and fills a generic header item called "filter_type":.vS.nf    /*defined constants for filter_type*/    #define MISC	0    #define LOW_PASS	1    #define HIGH_PASS	2    #define BAND_PASS	3    /*string array of filter_type values*/    char * f_types[] = {"MISC", "LOW_PASS", "HIGH_PASS", "BAND_PASS", NULL};    /*create generic header item and fill it*/    *add_genhd_e("filt_type", NULL, 1L, f_types, hd) = MISC;    . . .    /*change filt_type item in header*/    *(short *) get_genhd("filt_type", hd) = BAND_PASS;.fi.vE.lpThe \fIpsps\fP (1\-\s-1ESPS\s+1) listing for a file processed as abovewill show the item symbolically, i.e.:.nf    . . .    filt_type: BAND_PASS    . . ..fi.lpAlso, programs that read a file with such a generic item defined inthe header can refer to the contents symbolically, as in thefollowing:.vS.nf    struct header *hd;    short filter_class;    . . .    filter_class = *(short *) get_genhd("filt_type", hd);    . . .    switch (fitler_class) {		case LOW_PASS:	    . . .	    break;	case HIGH_PASS:	    . . .	    break;	case BAND_PASS:	    . . .	    break;	case MISC:	    . . .	    break;	default:	    ERROR_EXIT("invalid filter type encountered");    }.fi.vE.lpNote that one can also add generic header items to existing files by means of the user-level program \fIaddgen\fP (1\-\s-1ESPS\s+1).  .sh 2 "ESPS Record Structures".lpThe ESPS header is followed by a set of fixed-length data records.When any record is read into memory (through use of an ESPS libraryroutine), it is stored as a C structure that is documented in therelevant Section 5 manual page of the ESPS Manual.  As is the case forfile headers, programmers need not be concerned with the actualformat of ESPS data records.  For example, suppose that the variablescbkrec is pointer to a SCBK file record (each record contains ascalar quantization codebook plus related design information).  Thenthe final distortion value for that codebook and the population ofthe \fIi\fPth codeword are referred to as.vS.nf    scbkrec->final_distand    scbkrec->final_pop[i].fi.vErespectively (see SCBK (5\-\s-1ESPS\s+1)).  .lpThis symbolic form ofreference for ESPS data records also applies to FEA files.  For example, if anarec is a pointer to a FEA_ANA file record, the \fIi\fPth filter pole in that record is referred to as .vS.nf    anarec->filt_poles[i].fi.vE(see FEA_ANA (5\-\s-1ESPS\s+1). As mentioned earlier, users can define their own FEA file sub-types and extend existing subtypes.  New fields in FEA file records are defined through use of \fIadd_fea_fld\fP (3\-\s-1ESPS\s+1), which creates a new field with a given name size, numerical type, etc.  The new fields are accessed by means of of \fIget_fea_ptr\fP (3\-\s-1ESPS\s+1), which returns a pointer to a field with a given name from a given record.  .sh 2 "The ESPS Library".lpTo support the writing of new user-level ESPS programs, the ESPSlibrary contains various routines for processing ESPS headers, forprocessing ESPS data records, and for performing various signalprocessing functions.  At present, there are over 110 routines in thelibrary.  .lpA full ESPS lint library is included so that ESPS programs can be fullychecked with the standard \s-1UNIX\s+1 \fIlint\fP(1) utility for C programchecking.  As a further aid to programmers, \fIecheck\fP (3\-\s-1ESPS\s+1)looks up entries in the ESPS lint library and prints the proper callingsequence.  For emacs users, a mock-lisp file provides for \fIecheck\fP usefrom within emacs.  The scripts \fIemake\fP (1\-\s-1ESPS\s+1), \fIecc\fP(1\-\s-1ESPS\s+1), and \fIelint\fP (1\-\s-1ESPS\s+1) facilitate compilingand checking programs under ESPS (for details, see..[[ESPS programming.]]).lpHere are a few examples of functions in the ESPS library:.sh 3 "Signal Processing Support Library Functions".ta .1i 1i .nf	\fIanalyze\fP	compute prediction error filter and reflection coefficients	\fIblock-filter\fP	filter a data array	\fIconvolv\fP	convolution of polynomials or auto-correlations	\fIcovar\fP	compute reflection coefficients with covariance method 	\fIfdbk_latic\fP	feedback filtering with lattice form	\fIfeedbk_fil\fP	feedback filtering with transversal form	\fIgauss\fP	compute Gaussian random numbers	\fIget_auto\fP	compute auto-correlation coefficients	\fIget_burg\fP	compute reflection coefficients with Burg or modified		Burg method	\fIget_fft\fP	compute fast Fourier transform	\fIhamm_dec\fP	decode (8,4) Hamming code	\fIhamm_enc\fP	encode with (8,4) Hamming code	\fIinterp_filt\fP	perform interpolation filtering	\fIis_dist_td\fP	compute Itakura-Saito distortion	\fIpc_to_lsf\fP	convert prediction coefficients to line spectrum frequencies	\fIrand_intnr\fP	sample without replacement from uniformly		distributed integers	\fIrefl_to_filt\fP	convert reflection coefficients to filter coefficients	\fIremove_dc\fP	remove DC, using exponential weighting	\fIvqdesign\fP	design a full-search vector quantization codebook.fi.sh 3 "File Support Library Functions".ta.nf.ta .1i 1.4i	\fIadd_comment\fP	adds a string to the comment field of an ESPS header	\fIadd_fea_fld\fP	add a new field to data record in a FEA file	\fIadd_genhd\fP	adds a generic header item to a ESPS header	\fIadd_source_file\fP	add the header of a source file to an ESPS header	\fIcopy_header\fP	copies an ESPS header to a new header	\fIgenhd_list\fP	returns a list of defined generic header items	\fIget_cmd_line\fP	returns pointer to string containing program's command line	\fIget_fea_fld\fP	returns pointer to named field in a FEA record	\fIget_genhd\fP	returns pointer to named generic header item	\fIget_spec_rec\fP	get next spectral record from ESPS SPEC file	\fIget_sym\fP	get a parameter value after read_params called	\fInew_header\fP	create new ESPS file header	\fIprint_fea_rec\fP	prints a FEA file record	\fIput_fea_rec\fP	writes a FEA file record	\fIput_sym\fP	put value in ESPS common file	\fIrange_switch\fP	parse the argument to a command-line range switch	\fIread_header\fP	read an ESPS file header	\fIread_params\fP	read the parameters in ESPS parameter or common file	\fIskiprec\fP	skip records in ESPS file	\fIwrite_header\fP	write an ESPS file header.fi.sh 1 "EXAMPLE USER-LEVEL ESPS PROGRAMS".lpThis section lists some user-level ESPS programs of general interest.Note that the entire ESPS Manual is stored on-line.  The manual pagescan be viewed with the .i eman(1\-\s-1ESPS\s+1) command, which is an ESPS version of the \s-1UNIX\s+1 .i man command.  .i Emanincludes the \fB\-k\fP option to search the manual for programswhose one-line descriptions include a given keyword. .sh 2 "Conversion and Related Support Programs".ta .1i 1i .nf	\fIaddfea\fP	adds a FEA file field from ASCII data	\fIaddfeahd\fP	adds a FEA file header to binary data	\fIaddgen\fP	adds generic header item to ESPS file header	\fIatofilt\fP	convert ASCII file to FILT file	\fIatosps\fP	converts ASCII output to ESPS file (see spstoa)	\fIbhd\fP	behead an ESPS file	\fIeitem\fP	prints item from ESPS file header	\fIils_sps\fP	converts ILS sampled data file to ESPS SD file	\fIpplain\fP	print values from ESPS files in "plain" ASCII format 	\fIspstoa\fP	convert ESPS file to machine-independent ASCII format	\fItestsd\fP	make SD file with sine wave, pulses, Gaussian noise, or from ASCII data.fi.sh 2 "Signal I/O and Processing".ta .1i 1i .nf	\fIaddsd\fP	adds SD files with scaling	\fIana\fP	perform speech analysis from SD file	\fIme_spec\fP	compute spectra (FEA_SPEC file) from FEA_ANA file	\fIdistort\fP	compute distortion measures between ESPS files	\fIclassify\fP	classify records in FEA files	\fIfea_stats\fP	compute statistics from FEA files	\fIfft\fP	produces FEA_SPEC file by doing fft on SD file	\fIfilter\fP	performs digital filtering on SD file	\fIlloydcbk\fP	design a scalar quantizer using Lloyd's algorithm	\fInotch_filt\fP	design a notch filter	\fIplay\fP	play portions of SD files	\fIplaytest\fP	step through an "A-B" listening test with control options	\fIrandplay\fP	create play scripts for randomized "A-B" listening comparisons	\fIrecord\fP	digitize data using Masscomp EF-12M	\fIrefcof\fP	compute reflection coefficients from sampled data (FEA_ANA output)	\fIrem_dc\fP	remove DC component from SD file	\fIsdcomp\fP	listening program for detailed comparison of two sampled data files	\fIspectrans\fP	transform FEA_ANA from one spectral representation to another	\fIstats\fP	computes statistics from ESPS files	\fIsynt\fP	synthesize speech from ANA file	\fItestsd\fP	make SD file with sine wave, pulses, Gaussian noise, or from ASCII data	\fIvqdes\fP		design a vector quantization codebook from a FEA file	\fIvq\fP		encode FEA file with a vector quantization codebook	\fIwmse_filt\fP	design FIR filter using weighted mean square error criterion	\fIiir_filt\fP	design recursive filter.fi.sh 2 "File Manipulation and Plotting".nf	\fIaplot\fP	plot an array of ASCII data	\fIcomment\fP	displays or adds comments in the header of an ESPS file	\fIcopysd\fP	copy selected portions of SD files to a new file	\fIfea_edit\fP	edit a FEA file in ASCII form	\fIgenplot\fP	plot elements from any ESPS file in precise, multiline format 	\fIhistogram\fP	sort data into bins for plotting histograms			(screen, Imagen, or Tektronix) 	\fImlplot\fP	plot SD file in precise, multiline format 			(screen, Imagen, or Tektronix) 	\fIplotsd\fP	plot sampled data (screen, Imagen, or Tektronix) 	\fIplotspec\fP	plot spectra from FEA_SPEC file (screen, Imagen, or Tektronix) 	\fIpsps\fP	print ESPS file headers and records	\fIrange\fP	select a range from a graphics plot	\fIselect\fP	select FEA records that satisfy queries	\fIscatplot\fP	make a scatter plot.fi.sh 1 "FUTURE CHANGES".lpEverything discussed in the foregoing is available in ESPS Version3.3.  In this section, we mention some of the things that will addedin later versions.  .lpCurrent ESPS FEA files are restricted to fixed length records, one record type per file, with record fields containing only the machineprimitive data types (integer, float, double, character).  All of theserestrictions should be relaxed.  .lpWe will provide support for engineering units, so that plotting and printing programs can display data in terms of externally relevant units (volts, pressure, etc.).  .lpWe will provide some additional facilities to support ESPSprogramming.  For example, there will be a program for thesemi-automatic generation of new FEA file sub-types, and there willbe a program for the automatic generation of C skeletons foruser-level programs..lpThe ESPS parameter file format might be simplified so that users didn'thave to specify types (they don't on command lines).  Also, ESPS user-levelprograms will be modified to take all parameters from the parameter file(with possible command-line overrides) so that every program can be runinteractively using \fIeparam\fP (1\-\s-1ESPS\s+1) (some programs inVersion 3.3 require command line arguments for some or all parameters)..lpAnother significant enhancement will be provided by an interfacebetween ESPS and a \s-1UNIX\s+1 relational data base system.  Thisinterface will create data base records from ESPS file headers sothat the data base system can be used to manage sets of ESPS files..sh 1 "REFERENCES".lp.[$LIST$.]

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?