📄 param.vtme
字号:
.\" for SPS. .lo.de SM \"macro to shrink left margin.br.nr $i \\n($i+\\$1i...de RM \"macro to restore original left margin.br.nr $i 0...SJ "Parameter and Common Files in ESPS".AU "Joe Buck".RB "John Shore".TM ETM-S-86-12:jtb 1.3 6/5/87.*REntropic Signal Processing System (ESPS), Programmers Reference Manual.*RETM-S-86-13:rap, Data Files in the Entropic Signal Processing System (ESPS).*RETM-S-86-25, Guidelines for Implementing ESPS Feature File Subtypes.*RJ. Shore and R. Parker, Introduction to the Entropic Signal Processing System (ESPS).*RETM-S-86-14, Entropic Signal Processing System Programming Guidelines.sh 1 Introduction.lpThis document describes the Entropic Signal Processing System (\s-1ESPS\s+1)parameter and common files, and presents information required to writeprograms using them. .(f\(co Copyright 1987 Entropic Speech, Inc.; All rights reserved. .)f.lpThe reader must also read and understand the \s-1ESPS\s+1 manual pagesin reference [1]. These manual pages are in the standard \s-1UNIX\s+1format; section 1 describes user commands, section 3 describes libraryroutines, and section 5 describes the format of \s-1ESPS\s+1 files (see also [2] and [3])..lpFor a general introduction to ESPS, see [4]. .sh 1 "ESPS Parameter and Common Files".lpMany ESPS programs are affected by a large set of parameters. Because it would be extremely inconvenient to type their values as command line options each time a program is called, ESPS uses a different approach. 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 overides any of the other mechanisms by which programsget parameter values. .sh 2 "Parameter and Common File Processing".lpFor parameters that are not specified on the command line (eitherbecause no option is available or because an available option is notused), the parameters usually are obtained from an ESPS parameter file,which specifies parameter values with a C-like syntax. .lpSometimes, a value in the parameter file is superceded by a value in theESPS common file \- this is determined by the following rules. For someprograms, the parameter file value is superceded if rules (1)-(3) apply; for other programs, it is superceded if rules (1)-(4) apply. .SM .5i.ip (1)Common file processing has not been disabled..ip (2)The common file exists and is younger than the parameter file. .ip (3)The common file contains a value for the parameter in question. .ip (4)A file name stored in the common file matches a stated file name. .RM.lpThe purpose of the ESPS common file is to allow one ESPS program tocommunicate parameter values to another ESPS program that is run subsequently. For example, suppose that.i plotsd(1-ESPS) is used to plot the first 10,000 points of an SD file in aMasscomp graphics window: .nf %plotsdm -p1:10000 file.sd .fiAfter this plot is made, the user can run.i range(1-ESPS) to select a portion of the displayed data. When .i rangeexits, it writes the selected range and the filename "file.sd" into theESPS common file. If the user then runs .nf %plotsdm %play.fi(i.e., without any command line options), the selected range of the samefile will be displayed and then played. .lpFor most ESPS programs, common file processing is enabled (i.e.,parameter file values will be superceded 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 the manpages. Before running an ESPS program, a user can always have the effectof disabling common file processing by removing the common file ortouching the parameter file. Some programs may also have an option todisable common file processing. Also, the user can disable common file processing completely (see next subsection). .lpFor details about the format and processing of parameter files, see [4]. .sh 2 "Parameter and Common File Names".lpThe default convention for the parameter file name is "params" in thecurrent directory, but for most programs this can be changed by acommand line option (usually \fB\-P\fP). The default ESPS common file is".spscom" in the user's home directory, but this can be reset by usingthe SPSCOM \s-1UNIX\s+1 environment variable, e.g.: .nf %setenv SPSCOM /u/shore/anacommon.fi.lpCommon file processing can in effect be disabled by the following command:.nf %setenv SPSCOM /dev/null.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. .lpThe assignment of a value to a symbol may be definite or indefinite.If it is indefinite (indicated by the assignment operator "?=" or "=?")then the user will be prompted for the value to be used. If the userenters a RETURN in answer to the prompt, the default value will beused..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..(lfile :== ( statement )statement :== type decl ( ',' decl ) ';'type :== "int" | "float" | "char" | "string" | "char" '*'decl :== IDENT assop value [prompt]value :== CHRVAL | STRVAL | FLOVAL | INTVAL | arrayarray :== '{' num ( ',' num ) '}'num :== INTVAL | FLOVALprompt :== ':' STRVALassop :== '=' | '=' '?' | '?' '='.)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:.(lint 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.)l.sh 2 "Parameter Assignment Statements".lpThere are three types of assignment statements.The most basic statement is something like.(lint M = 22;.)lIn this type of statement, a symbol namedM is created, assignedthe type integer and the value 22. If the name has been declaredpreviously, an error occurs. Type conversions, where sensible, work.An integer or character value may be assigned to a floating variable,and a character may be assigned to an integer variable. Integersin the range 0:127 may be assigned to character variables. Arraysmay mix integers and floating values, provided that the array isassigned to a floating variable. Some things that don't work:.(lint n = 12.0; # can't assign float to intchar q = "a"; # can't assign string (even 1 char) to charstring a = 'c'; # can't assign character to stringchar a = 'b', *c = "def"; # unlike C, "char *" is just # a synonym for "string"; # no mixing allowed.)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..(lint M ?= 22;int M ?= 22 : "Model order";.)lWhen an attempt is made to retrieve the value of M,the user isprompted. If no prompt string is given, the variable name is usedas the prompt.The default value is placed in square brackets:.(lM [22]:Model order [22]:.)l.sh 1 "Programming Procedures for Parameter and Common Files".lpParameter processing takes place in two steps: building a symboltable from the parameter and common files, and reading values from that table. .sh 2 "Building the Symbol Table".lpThe program.i read_params(3\-\s-1ESPS\s+1)is called to process the parameter and common files and to build an
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -