param.vtme

来自「speech signal process tools」· VTME 代码 · 共 924 行 · 第 1/3 页

VTME
924
字号
.nf .ft CW	%plotsd	%play.ft LR.fi(i.e., without any command line options), the selected range of the samefile will be displayed and then played.  Note that \fIwaves\fP+ has amode (global parameter \fIwrite_common\fP non-zero) in which the ESPSCommon is written whenever the mouse is used to mark a segment of adisplayed ESPS file.  .lpFor most ESPS programs, common file processing is enabled (i.e., parameterfile values will be superseded by Common file values if rules (2)-(3) or(2)-(4) above apply).  Rule (4) was introduced to make it easier for ESPSprograms to do what users expect \- often, it would be annoying or amistake to use values from ESPS common unless one is processing the samefile that was being processed when ESPS common was written.  Which set ofrules applies can be determined from the "ESPS COMMON" section of themanual pages.  .sh 2 "Common File Location".lpThe default ESPS common file is".espscom" in the user's home directory, but this can be reset by usingthe ESPSCOM \s-1UNIX\s+1 environment variable, e.g.:  .nf.ft CW.sp .5    %setenv ESPSCOM /usr/shore/fftcommon.sp .5.fi.ft LR.sh 2 "User Control of Common Processing".lpBefore running an ESPS program, you can always disable common fileprocessing by removing the common file or touching the parameter file(so that the common file is not younger than the parameter file).Also, you can disable common processing completely by setting the Unixenvironment variable USE_ESPS_COMMON to "off".  For example, with\fIcsh\fP, the following will do the trick:.nf.ft CW    %setenv USE_ESPS_COMMON off.ft LR.fi.lpIn a \fIsh\fP script, common can be disabled by means of the following:.nf.ft CW    USE_ESPS_COMMON=off    export USE_ESPS_COMMON.fi.ft LR.sh 2 "User Feedback of Parameter and Common file Processing".lpParameter sets for different ESPS programs can be combined in one parameterfile \- since each program only reads the parameters it needs, no harm isdone by having other parameters in the same file.  One result of this isthat some users prefer to maintain one large parameter file for all of theprograms they run.  This can be error prone as it's easy to forget what'sin such a file.  Further confusion can arise from common file processing,since the final values for parameters can depend on the relative age ofthe common file, on which program is being run, and on which programs havebeen run previously..lpFor these reasons, ESPS provides a mechanism by which you can see the parameter values that actually are used by a particular program.  The degree of feedback is determined by the Unix environment variableESPS_VERBOSE according to the following scheme (higher values of ESPS_VERBOSE include the feedback provided by lower values):.bp.nf.TSbox,center,tab(/);c sc | cc | lw(3i).\fBESPS Parameter Processing Feedback\fP_ESPS_VERBOSE = /Feedback_0/no feedback_1/T{reports if common is processedT}_2 or greater/T{reports parameter file used and individual parameter values as taken from the parameter file or the common fileT}.TE.fi.lpThe default setting of ESPS_VERBOSE is 2.  As you become more experienced with ESPS, you should set a lower value for ESPS_VERBOSEin your .login file.  .nf.ft CW.lpAs an example, consider a case where the range of a sampled datafile is selected by running \fIplotsd\fP (1\-\s-1ESPS\s+1) followedby \fIrange\fP (1\-\s-1ESPS\s+1):.nf.ft CW    %plotsd test.sd    %range.ft LR.fi.lpAfter \fIrange\fP finishes, the contents of ESPS Common is as follows:.nf.ft CW    string filename = "test.sd";    string prog = "range";    int start = 192;    int nan = 4251;    int beginplot = 0;    int endplot = 8000;.ft LR.fi.lpNext, suppose you run \fIrefcof\fP (1\-\s-1ESPS\s+1) with the following parameter file:.ft CW.nf    int start = 1;    int nan = 1024;    int frame_len = 1024;    int order = 10;.fi.ft LR.lpIf ESPS_VERBOSE = 3, you would see the following output:.nf.ft CW    %refcof test.sd test.spec    read_params: Common processed.    getsym_i: symbol start, value 192, taken from Common.    getsym_i: symbol nan, value 4251, taken from Common.    getsym_i: symbol frame_len, value 1024 taken from param file.    getsym_i: symbol order, value 10 taken from param file..ft LR.fi.lpIf you happened to use the \fB\-l\fP0 option on \fIrefcof\fP (so thatthe the full range is treated as a single frame), you would see thefollowing output:.nf.ft CW    %refcof -l0 test.sd test.spec    read_params: Common processed.    getsym_i: symbol start, value 192, taken from Common.    getsym_i: symbol nan, value 4251, taken from Common.    getsym_i: symbol order, value 10 taken from param file..ft LR.fi.sh 1 "Format of Parameter and Common Files".lpParameter files and common files are written ina C-like language. Parameters may have six types: integer, real (storedas double precision values), string, character, array of integer, andarray of real. .lpFor each parameter, the parameter file contains the following: .ipparameter type.ipparameter name.ipdefinite assigned value (operator "=") or indefinite assigned value(operator "?=").ip(optional) prompt string.ip(optional) parameter limitations (discrete choices or range of values).lpIf the assigned value for a parameter is indefinite (indicated by theassignment operator "?=" or "=?"), then the user will be prompted forthe value to be used. The prompt will occur at runtime when thecorresponding \fIgetsym\fP (3\-\s-1ESPS\s+1) call is made.  If theoptional prompt string was supplied in the parameter file, that stringwill be used as the prompt; otherwise the parameter name will be used.If the user enters a RETURN in answer to the prompt, the default valuewill be used..lpIf the optional parameter limitations are supplied, they are appendedto the prompt string that is used for indefinite assignments.  Whilethey are not enforced by the \fIgetsym\fP (3\-\s-1ESPS\s+1) routines,the limitations are available to user programs by means of\fIsymchoices\fP (3\-\s-1ESPS\s+1) and \fIsymrange\fP(3\-\s-1ESPS\s+1).  (The program \fIxprompt\fP (1\-\s-1ESPS\s+1), forexample, does exploit this information.)  .lpA simplified grammar follows. In this grammar, parentheses indicate that thecontents may be repeated zero or more times. Square brackets indicate thatthe contents are optional (zero or one repetitions). Vertical bars indicate"or". CHRVAL, STRVAL, FLOVAL, and INTVAL represent legal C tokens forcharacters, strings, real values, and integers respectively. IDENTrepresents any legal C variable name, other than one of the reservedkeywords. Case is significant, and all characters of names are significant(the restriction imposed by LEX, which builds the lexical analyzer, is about200 characters). Most C escape sequences like '\en' are supported incharacter and string constants. Character constants like '^b', meaningcontrol-b, are also supported. However, octal and hexadecimal numbers arenot supported. Multiline strings are not supported..(l.ft CWfile      :==  ( statement )statement :== type decl ( \fR'\fP,\fR'\fP decl ) \fR'\fP;\fR'\fPtype      :== "int" | "float" | "char" | "string" | "char *"decl      :== IDENT assop value [prompt] [limits]value     :== CHRVAL | STRVAL | FLOVAL | INTVAL | arrayarray     :== \fR'\fP{\fR'\fP num ( \fR'\fP,\fR'\fP num ) \fR'\fP}\fR'\fPnum       :== INTVAL | FLOVALprompt    :== \fR'\fP:\fR'\fP STRVALlimits    :== choices | rangechoices   :== \fR'\fP:\fR'\fP strarraystrarray  :== \fR'\fP{\fR'\fP STRVAL ( \fR'\fP,\fR'\fP STRVAL) \fR'\fP}\fR'\fPrange     :== \fR'\fP:\fR'\fP \fR'\fP[\fR'\fP num \fR'\fP,\fR'\fP num \fR'\fP]\fR'\fP assop     :== \fR'\fP=\fR'\fP | \fR'\fP=\fR'\fP \fR'\fP?\fR'\fP | \fR'\fP?\fR'\fP \fR'\fP=\fR'\fP.ft CW.)lThe following keywords are reserved: int, char, string, float,yes, no, true, false. The keywords "yes" and "true" are treatedas integer constants with value one (the C convention for expressinglogical true); the keywords "no" and "false" are integer constantswith value zero..lpThe comment convention is different from C. It is the same as for theC shell. A '#' character indicates that the rest of the line is acomment, unless it is contained in a character or string constant.This makes it easier to comment out lines..lpHere is an example of a parameter file:.(l.ft CWint order      ?= 10 : "Model order"; # ask for promptint verbose     = no;#preemphasis specificationint preflg      = yes;float pre_num   = { 0.9, -0.5 },   # zeros of preemph filter      pre_den   = { 0.99, -0.99 }, # poles of preemph filter      scale     = 0.25;int frmlen     ?= 150: "Length of analysis window";int nshft      ?= 180: "Distance between frames";#method for autocorrelation computationstring method   = "BURG"; #Burg method.ft LR.)l.sh 2 "Parameter Assignment Statements".lpThere are three types of assignment statements.The most basic statement is something like.(l.ft CWint M = 22;.ft LR.)lIn this type of statement, a symbol named M is created, assigned the typeinteger and the value 22.  If the name has been declared previously, anerror occurs.  Type conversions, where sensible, work.  An integer orcharacter value may be assigned to a floating variable, and a character maybe assigned to an integer variable.  Integers in the range 0:127 may beassigned to character variables.  Arrays may mix integers and floatingvalues, provided that the array is assigned to a floating variable.  Somethings that don't work:.(l.ft CWint n    = 12.0; # cannot assign float to intchar q   = "a"; # cannot assign string (even 1 char) to charstring a = \fR'\fPc\fR'\fP; # cannot assign character to stringchar a   = \fR'\fPb\fR'\fP, *c = "def"; # unlike C, "char *" is just                            # a synonym for "string";                            # no mixing allowed.ft LR.)lThe other two types of assignment statements attach a default valueto a variable and are indicated by adding a question mark to theequal sign (either before or after). An optional prompt string mayappear, separated by a colon from the declaration..(l.ft CWint M ?= 22 : "Model order";.ft LR.)lWhen an attempt is made to retrieve the value of M, the user is prompted.If no prompt string is given, the variable name is used as the prompt.  Thedefault value is placed in square brackets:.(l

⌨️ 快捷键说明

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