intro.vrme

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

VRME
1,038
字号
	%plotspec data.spec .ft LR.fi.lpThe first command causes the reflection coefficients computed fromdata frames in the SD file data.sd to be placed in the FEA_ANA filedata.fana.  The second command computes spectra for each set ofreflection coefficients and puts the results in the SPEC filedata.spec.  The third command plots all the spectra on the screenusing a single set of axes.  If there is no need to retain theintermediate FEA_ANA and FEA_SPEC files, one could do the followinginstead:.nf.ft CW	%refcof data.sd \- | me_spec \- \- | plotspec \- .ft LR.fi.lpSimilarly, if only the FEA_SPEC file is wanted, the first two commands could be replaced by:.nf.ft CW	%refcof data.sd \- | me_spec \- data.spec.ft LR.fi.lpAn important consideration in using pipes with ESPS programs is thatrecord keeping is not compromised.  Thus, the file header fordata.spec in the command above will include the header of the file produced by \fIrefcof\fP (i.e., the header of data.fana in the first version of this sequence of operations, above).  For a more detailed example, see..[ESPS record keeping.].sh 1 "PARAMETERS FOR ESPS PROGRAMS".lpSignal processing programs often are affected by a large set of inputparameters.  Rather than requiring that all parameters be specifiedon the command line, which is not only error-prone but leads toridiculously-long command lines, ESPS provides a mechanism that usesa distinguished ASCII file called the parameter file.  Parameters arespecified in this file using a C-like syntax that allows the usereither to provide specific values for the parameters within theparameter file or to have the program prompt the user for theirvalues at run time.  The default convention for the parameter filename is "params" in the current directory, but for all programs thiscan be changed using the \fB\-P\fP command-line option..lpFor example, \fIrefcof\fP (1\-\s-1ESPS\s+1) computes reflectioncoefficients for fixed-length segments of sampled-data.  To do so itrequires parameters that specify the starting point, the number of pointsto analyze, the frame length, and the order of the analysis.  The call.nf.ft CW    %refcof \-P params.3 john.sd john.fana.ft LR.fiindicates that reflection coefficients are to be computed for data inthe file john.sd using parameter values in the file params.3 (thenuser may be prompted for some of the values), and that the resultsare to be written to the file john.fana.  .lpThe ESPS distribution contains a "default" parameter file for every ESPS program that processes a parameter file.  Easy accessto these parameter files is provided by \fIeparam\fP (1\-\s-1ESPS\s+1), which invokes any given ESPS program with its default parameter file.  The default parameter files are written to prompt for all values so you can override each default.  Here is an example of running\fIvqdes\fP (1\-\s-1ESPS\s+1) by means of \fIeparam\fP:.nf.ft CW    %eparam vqdes rc.fana rc.cbk    max_iter [100]:     fea_dim [10]:     vq_size [32]: 16    fea_field [spec_param]:     cbk_type [MISC]:     cbk_struct [FULL_SEARCH]:     conv_ratio [0.050000]: .01    dist_type [MSE]:     %.ft LR.fi.lpHere, the defaults were taken for all parameters but .ft CWvq_size.ft LRand.ft CWconv_ratio..ft LR.lpThe ESPS parameter file provides a convenient means for users tocommunicate parameter values to signal processing programs.  In manysignal processing applications, however, there is also a need for oneprogram to communicate parameter values to another program that is runsubsequently.  In ESPS, this need is met by the ESPS common file.  If the common file exists and was written more recently than the parameter file, then parameter values in the common file may supersede those in the parameter file (for a detailed discussion of the conditions, see..]]ESPS parameters.]])Thus, a program can write a value into the common file and have that valuebe used by a subsequent program.  For example, suppose that.i plotsd(1\-\s-1ESPS\s+1) is used to plot the first 10,000 points of an SDfile in a graphics window:.nf.ft CW 	%plotsd \-p1:10000 file.sd.ft LR .fiAfter this plot is made, the user can run \fIrange\fP(1\-\s-1ESPS\s+1) to select a portion of the displayed data (using themouse).  When \fIrange\fP exits, it writes the selected range and thefilename "file.sd" into the ESPS common file.  If the user then runs.nf.ft CW 	%plotsd.ft LR.fi(i.e., without any command line options), the selected range of the samefile will be displayed.  Similarly, if the user runs .nf.ft CW	%play.ft LR.fi(again, without options), the selected range of the same file will be played out over the system D/A converter.  .lpThe default ESPS common file is ".espscom " in the user's homedirectory, but this default can be changed by using the \s-1UNIX\s+1shell environment variable ESPSCOM.  Thus, for csh users, .nf.ft CW 	%setenv ESPSCOM /u/shore/common.3.ft LR.firesets the common file to /u/shore/common.3.  This facility for changingthe common file is needed so that users can prepare and run several shellscripts without having them interfere with each other.  Common processingcan also be turned off entirely by setting the \s-1UNIX\s+1 environmentvariable USE_ESPS_COMMON to "off".  By default, ESPS provides detaileduser-feedback about the parameter values taken from the parameter andcommon files.  The verbosity of the resulting messages is controlledby the \s-1UNIX\s+1 environment variable ESPS_VERBOSE.  The default value is 3; a value of 0 inhibits all messages.  .lpTo summarize, ESPS programs get their parameters from three sources:.SM .5i.ip \(bu 3the ESPS parameter file.ip \(bu 3the ESPS common file.ip \(bu 3command line options.RM.lpIn general, if a command-line option is available to set a parametervalue, its use overrides any of the other mechanisms by which programsget parameter values.  For details about ESPS parameter and common file processing see..[ESPS parameters.].sh 1 "CONVERSIONS TO OR FROM ESPS FILES".lpMost ESPS users have occasion to import non-ESPS data into ESPS files,and also to export data from ESPS files for use by non-ESPS programs.Here is a list of the ESPS programs that are the main utilities forconverting back and forth between ESPS files and ASCII or headerlessbinary data:.sp .5.nf.ta 1.25i  \fIaddfea\fP \-	adds a new FEA file field based  on ASCII data  \fIaddfeahd\fP \-	adds an ESPS feature file header to non-ESPS binary or ASCII data  \fIaddgen\fP \-	adds a generic header item to an existing  nor new ESPS file header  \fIbhd\fP \-	behead an ESPS file  \fIbtosps\fP \-	convert binary sampled data file to an ESPS FEA_SD file  \fIcomment\fP \-	displays or appends to comment field in ESPS file headers  \fIdemux\fP \-	(demultiplex) extract real or complex channels from a FEA_SD file  \fIeman\fP \-	displays or prints ESPS manual pages  \fIeparam\fP \-	run an ESPS program with parameter prompts  \fIesps2mu\fP \-	convert an ESPS sampled data file to a headerless mu-encoded file  \fIfea2mat\fP \-	converts FEA to MATLAB .mat   \fIfea_edit\fP \-	feature file editor  \fIfea_element\fP \-	prints binary format table for ESPS FEA files  \fIfea_print\fP \-	 print data from FEA records with user-controlled formatting  \fIfeafunc\fP \-	apply function, gain factor, additive constant, and type change to FEA fields  \fIfea_deriv\fP \-	derive a new FEA file containing elements from an existing one  \fIhditem\fP \-	print an item from an ESPS header  \fIils_esps\fP \-	convert an ILS sampled data file to an ESPS file  \fImat2fea\fP \-	converts from MATLAB .mat to FEA  \fImergefea\fP \-	merge two FEA files so that output records contain fields from both  \fImux\fP \-	multiplex sampled-data files into a single multichannel or complex file  \fImu2esps\fP \-	converts mu-encoded data to ESPS FEA_SD file  \fIpplain\fP \-	print values from ESPS file in "plain format"  \fIepsps\fP \-	print headers and data from ESPS file in "pretty format"  \fIselect\fP \-	applies arbitrary queries to select records from FEA files  \fItestsd\fP \-	make test signal (sine wave, square wave, noise, pulses, ASCII input, etc.)  \fIxeparam\fP \-	run an ESPS program with X Window parameter prompts  \fIexprompt\fP \-	interactive ESPS parameter entry in a pop-up window  \fIexpromptrun\fP \-	interactive ESPS parameter entry and program run.sp .5.fi.lpESPS also includes facilities for dealing directly with headerlessfiles as well as with files that have foreign (non-ESPS) headers.  Onetype of foreign header \- NIST (Sphere) sampled data headers \- areread directly by ESPS programs.  For a detailed discussion discussionof file conversion and foreign data, see the ESPS applications note"Converting Data to and from ESPS FEA Files"..sh 1 "PROGRAMMING WITH ESPS FILES".lpThis section contains a brief introduction to the C structures usedfor ESPS headers and records, as well as to some of the ESPS libraryroutines that facilitate ESPS file processing.  If you are notinterested in ESPS programming, skip to Section 7.  For an introduction to ESPS file headers see..[ESPS record keeping.].sh 2 "ESPS File Headers".lpThe standard ESPS file header consists of two primary parts, theuniversal section and the type-specific section.  All headeritems (including generics) are referred to by name in programs.This makes it easier to write, read, and maintain programs.Also, when headers are output in ASCII form using.i psps(1\-\s-1ESPS\s+1), all of the items (including generics) are identified by name.  .sh 3 "The Universal Section of the Header".lpAs the name implies, the universal section of the ESPS header has thesame definition for all ESPS file types.  This section of the headeris divided into a fixed-length portion called the \fIcommon\fPsection, and a variable-length portion called the \fIvariable\fPsection..lpThe universal section of an ESPS header contains information about thetype of data in the file, the program that created the file, the userwho created the file, the creation date, version information,housekeeping information required by the header access routines,history data, etc.  When user programs need to refer directly tothese items, they do so by name.  For example, consider the items"tag" in the common portion and "refer" in the variable portion."Tag" determines whether or not the records in the file each containa tag pointing to a particular record in some pre-existing sourcefile; if they do, then "refer" is the name of the source file towhich they refer.  Here is an example of how these header items arereferred to in source code:.vS.nf    #include <esps/sps.h>    struct header *h;    . . .    if (h->common.tag) printf("source file for tags is %s\n", h->variable.refer);.fi.vEIn most cases, ESPS programs do not refer directly to items in theuniversal section of the header because these items are maintained directly or indirectly by utility routines in the ESPS library.  For example, the universal section of the header contains avariable-length comment field that is used to record arbitraryASCII comments.  Programs add comments to an existing header though use of \fIadd_comment\fP (3\-\s-1ESPS\s+1), as in.vS.nf    add_comment(h, "This file contains clipped values.\n");.fi.vEThe user-level program \fIcomment\fP (1\-\s-1ESPS\s+1), mentioned in Section 3 above, is implemented by means of calls to\fIadd_comment\fP.  .sh 3 "The Type-Specific Section of the Header".lpAs the name implies, this section of the header is used to record information relevant to the specific file type.  The items defined for a particular file type are described in the manual page forthat file type in Section 5 of the ESPS Manual.  For example, seeSD (5\-\s-1ESPS\s+1) for the type-specific header definition for sampled data files.  For FEA files, the type-specfic section contains the field definitions.  .sh 3 "Generic Header Items" .lp The pre-defined items in the universal and type-specific headersections are intended to be useful in a broad range of typicalapplications.  However, they cannot anticipate every application.For example, the SD file type does not make provision for storing in

⌨️ 快捷键说明

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