tofspec.1
来自「speech signal process tools」· 1 代码 · 共 428 行
1
428 行
.\" Copyright (c) 1988-90 Entropic Speech, Inc..\" Copyright (c) 1991-93 Entropic Research Laboratory, Inc. All rights reserved..\" @(#)tofspec.1 1.10 3/31/97 ESI/ERL.ds ]W (c) 1993 Entropic Research Laboratory, Inc..if n .ds - ---.if t .ds - \(em\h'-0.2m'\(em.TH TOFSPEC 1\-ESPS 3/31/97.SH "NAME"tofspec \- transforms data from arbitrary FEA field to FEA_SPEC file.SH "SYNOPSIS".B tofspec[.BI \-d] [.BI \-f " fea_field"] [.BI \-i " input_range"] [.BI \-o " output_range"] [.BI \-r " record_range"] [.BI \-s " sf"] [.BI \-v " freqs"] [.BI \-x " debug_level"] [.BI \-F " freq_format"] [.BI \-P " params"] [.BI \-R] [.BI \-S].I "input output".SH "DESCRIPTION".PP.I Tofspecaccepts an arbitrary FEA file \fIinput\fP and produces a FEA_SPEC file\fIoutput\fP. The "power spectrum" in the FEA_SPEC output \*- i.e.,the contents of the re_spec_val field \*- is taken from the field in\fIinput\fP specified by the \fB\-f\fP option. The main purpose of\fItofspec\fP is to allow \fIwaves\fP+ users to display arbitrary FEAdata in spectrogram form..PPThe output FEA_SPEC file has frequency format SYM_EDGE by default (see.IR FEA_SPEC (5\-ESPS)).However, there is an option for specifying frequency format ARB_FIXED instead,which also requires specifying an explicit list of frequencies to be storedin the output file header (see the.B \-Fand.B \-voptions).The spectrum type is DB (logarithmic power spectral density in decibels; see.IR FEA_SPEC (5\-ESPS)).To conserve space, the file is stored in BYTE format.Unless the\fB\-S\fP option (no scaling) isspecified, \fITofspec\fP clips the input data to the input rangespecified by the \fB\-i\fP option, scales the resulting data to thedefault output range (\-64, +50), and stores the scaled data as floatvalues in the re_spec_val field of \fIoutput\fP. The output range canbe changed from the default range of (\-64, +50) by means of the\fB\-o\fP option, although the BYTE format of the output file forcesthe range to stay within (\-64, +63). If the \fB\-i\fP option is notused, the input data are not clipped \*- the miminum and maximum valuesare determined from the input data and this range is scaled to theoutput range. If the \fB\-S\fP option is specified, no scaling isperformed \*- input data are copied directly to output data withclipping at the limits of the output range. If the \fB\-d\fP isspecified, the log (base 10) of the (possibly clipped) input data istaken before the data are stored (after possible scaling) inre_spec_val of \fIoutput\fP..PPThe data type of the field \fIfea_field\fP can be any supported FEAdata type. If the type is complex, only the real part is used. .PPIf \fIinput\fP is "\-" and the input range is specified by the\fB\-i\fP option or is determined from the parameter file, then theinput is taken from standard input. (Standard input can not be used ifthe input range is determined automatically from the input data.) If\fIoutput\fP is "\-", the output is directed to standard output..PPThe default output range provides 115 levels, from \-64 to +50. Thisis intended to use the first 115 entries in the \fIwaves\fP+ colormap. The entire color map has 128 values, but the top 13 levels areused for cursors, borders, and backgrounds. Thus, if the full 128levels are covered in the \fItofspec\fP output, various colors willintrude when data is displayed using the grey scale map. .SH OPTIONS.PPThe following options are supported:.TP.BI \-d Apply log (base 10) to input data before scaling (no \fB\-S\fP) or storing (\fB\-S\fP) . .TP.BI \-f " field_name" "\fR [sd]"Specifies the name of the data field in \fIinput\fP to be converted.The default name is "sd"..TP.BI \-i " low_input" : "high_input" " \fR[(determined from data)]".TP.BI \-i " low_input" :+ "incr"The first form gives the low and high limits of the range of inputdata to scale to the output range. This option is ignored if the\fB\-S\fP option is used. If .IR high_input " = " low_input " + " incr,the second form (with the plus sign) specifies the same range as thefirst. If this option is not used, the limits are determined from thedata. .TP.BI \-o " low_output" : "high_output" " \fR[\-64:+50]".TP.BI \-o " low_output" :+ "incr"The first form gives the low and high limits of the output range. If .IR high_output " = " low_output " + " incr,the second form (with the plus sign) specifies the same range as thefirst. If \fIlow_output\fP < \-64, it is reset to \-64 and a warning isprinted. If \fIhigh_output\fP > 63, it is set to 63 and a warning isprinted. This option specifies the range of output data. Unlessthe\fB\-S\fP option is specified, the input range is scaled to theoutput range (see also \fB\-d\fP). If \fB\-S\fP is specified, the inputrange is ignored, and the input data are clipped to the output range (see also \fB\-d\fP). .TP.BI \-r " start" : "last" "\fR [1:(last in file)]".TP.BI \-r " start" :+ "nan"In the first form, a pair of unsigned integers specifies the rangeof records to be processed.Either.I startor.I lastmay be omitted; then the default value is used.If.IR last " = " start " + " nan,the second form (with the plus sign) specifies the same range as the first.The \fB\-r\fP overrides the values of \fIstart\fP and \fInan\fP from the parameter file. .TP.BI \-s " sf" "\fR [0]"Specifies the value to be used for the generic header item \fIsf\fPin \fIoutput\fP.As a result, if the frequency format of.I outputis SYM_CTR, the frequency scale will range from 0to \fIsf\fP/2 when \fIoutput\fP is displayed with \fIwaves\fP+.(If the output.I freq_formatis ARB_FIXED,.I sfplays no role in setting the frequency scale, which is determinedby an explicit list of values in the header instead\*-see the.B \-Fand.B \-voptions.)If the option argument is 0 (the default), the generic's value is set to2*(\fIsize\fP \- 1), where \fIsize\fP is the size of the input field\fIfea_field\fP (this is done so that the implicit "frequencies"correspond to element number in the input field)..TP.BI \-v " freqs" "\fR [(none)]"A list of frequencies to be stored as the value of the generic header item.I freqsin the output file (see.IR FEA_SPEC (5\-ESPS)).This option is ignored unless the.I freq_formatof the output file is specified as ARB_FIXED, either with the.B \-Foption or with the.I freq_formatparameter in a parameter file.The format of the argument is a list of real numbers,separated by commas or blanks.If blanks are present, they must be escaped with back slashes (\\),or the argument must be enclosed in double quotes (")..TP.BI \-x " debug_level" "\fR [0]"Print diagnostic messages as program runs (for debugging purposesonly).Higher levels give more messages.The default level of zero suppresses all debugging messages..TP.BI \-F " freq_format" "\fR [SYM_EDGE]"The value to assign to the.I freq_formatgeneric header item in the output file (see.IR FEA_SPEC (5\-ESPS)).Currently supported values are SYM_EDGE and ARB_FIXED (case-insensitive).If ARB_FIXED is specified,a list of frequency values must be given also, either with the.B \-voption or with the.I freqsparameter in a parameter file..TP.BI \-P " params" " \fR[params]\fP"Specifies the name of the parameter file..TP.BI \-RReverse the order of elements in the \fIfea_field\fP before writing to \fIoutput\fP. This is useful if you want to invert the orientationof the display shown when \fIoutput\fP is displayed with \fIwaves\fP+. .TP.BI \-SDo not scale the data. This means that any input range is ignored. The input data (or the log of the input data, if \fB\-d\fP) are stored in \fIoutput\fP with clipping at the output range limits. .SH "ESPS PARAMETERS".PPThe parameter file does not have to be present, since all theparameters have default values. The following parameters are read, ifpresent, from the parameter file:.TP.I "field_name \- string"This is the name of the source field in \fIinput\fP.The default is "sd". This parameter is not read if the \fB\-f\fPoption is used. .TP.I "freq_format \- string"The value to assign to the.I freq_formatgeneric header item in the output file (see.IR FEA_SPEC (5\-ESPS)).This parameter is not read if the.B \-Fcommand-line option is specified.Currently supported values are SYM_EDGE (the default) and ARB_FIXED(both case-insensitive).If ARB_FIXED is specified,a list of frequency values must be given with the.B \-voption or the.I freqsparameter..TP.I "freqs \- float array"A list of frequencies to be stored as the value of the generic header item.I freqsin the output file (see.IR FEA_SPEC (5\-ESPS)).This option is not read if the.B \-vcommand-line option is specified,and it is ignored unless the.I freq_formatof the output file is specified as ARB_FIXED with the.B \-Foption or the.I freq_formatparameter..TP.I "start \- integer"This is the first record of \fIinput\fP to process. The default is 1. Itis not read if the \fB\-r\fP option is used..TP.I "nan \- integer"This is the number of records to process. It is not read if the \fB\-r\fPoption is used. A value of zero means all subsequent records in the file;this is the default..TP.I low_input \- string (converted to float)Lower limit of range of input data to scale to the output range. Databelow this value are clipped. If the string "determine from file" isentered, the limit is determined from the file. This parameter is notread if the.B \-ioption is specified. If the command-line option is not specified andthe parameter is not present in the parameter file, the default used isthe minimum value of the input data. .TP.I high_input \- string (converted to float)Upper limit of range of input data to scale to the output range. Dataabove this value are clipped. If the string "determine from file" isentered, the limit is determined form the file. This parameter is notread if the.B \-ioption is specified. If the command-line option is not specified andthe parameter is not present in the parameter file, the default used isthe maximum value of the input data. .TP.I low_output \- floatLower limit of range of output data. Data in the input range are scaled to the output range. This parameter is not read if the.B \-ooption is specified. If the command-line option is not specified andthe parameter is not present in the parameter file, the default usedis \-64. .TP.I high_output \- floatUpper limit of range of output data. Data in the input range are scaled to the output range. This parameter is not read if the.B \-ooption is specified. If the command-line option is not specified andthe parameter is not present in the parameter file, the default usedis +50. .TP.I "sf \- float"Specifies the value to be used for the generic header item \fIsf\fPin \fIoutput\fP.As a result, if the frequency format of.I outputis SYM_CTR, the frequency scale will range from 0to \fIsf\fP/2 when \fIoutput\fP is displayed with \fIwaves\fP+.(If the output.I freq_formatis ARB_FIXED,.I sfplays no role in setting the frequency scale, which is determinedby an explicit list of values in the header instead\*-see the parameters.I freq_formatand.IR freqs. )If the parameter value is 0 (the default), the generic's value is set to2*(\fIsize\fP \- 1), where \fIsize\fP is the size of the input field\fIfea_field\fP (this is done so that the "frequencies" correspond toelement number in the input field). This parameter is not read if the option \-\fBs\fP is used. .PPRemember that command line option values override parameter filevalues..SH "ESPS COMMON".PPESPS Common processing may be disabled by setting the environment variableUSE_ESPS_COMMON to "off". The default ESPS Common file is .espscom in the user's home directory. This may be overridden by settingthe environment variable ESPSCOM to the desired path. User feedback ofCommon processing is determined by the environment variable ESPS_VERBOSE,with 0 causing no feedback and increasing levels causing increasinglydetailed feedback. If ESPS_VERBOSE is not defined, a default value of 3 isassumed..PPThe following items are written into the ESPS Common file provided that \fIoutput\fP is not <stdout>. .IP.I "start \- integer".IPThe starting point from the input file..sp.I "nan \- integer".IPThe number of points in the selected range..sp.I "prog \- string".IPThis is the name of the program ("tofspec" in this case)..sp.I "filename \- string".IPThe name of the input file \fIinput\fP..SH ESPS HEADERS.PPThe \fIoutput\fP header is a FEA_SPEC file header. The generic items\fIstart\fP and \fInan\fP are written to store the range of inputdata records processed. The items \fIlow_input, high_input,low_output,\fP and \fIhigh_output\fP are written to record the range of input data that was transformed tothe output data. If the \fB\-d\fP was used the log of the input range limits are also written as generics \fIlog_low_input\fPand \fIlog_high_input\fP. .PPThe generic header item \fIstart_time\fP is written in the outputfile. The value written is computed by taking the \fIstart_time\fPvalue from the header of the input file (or zero, if such a headeritem doesn't exist) and adding to it the relative time from the firstrecord in the file to the first record processed. The computation of\fIstart_time\fP depends on the value of the generic header item\fIrecord_freq\fP in the input file. If this item is not present,\fIstart_time\fP is just copied from the input file to the outputfile. .PPThe generic header item \fIsf\fP is written in the output file;the value is specified by the parameter \fIsf\fP or the value given in the\fB\-s\fP option.See the discussions of the parameter and the option for details..PPIf the input file is tagged, then the output, and the generic header item.I src_sfis written in the output file header.In that case, the value of.I src_sfis copied from the input if the input header contains a.I src_sfitem; otherwise the values is taken from.I sfin the input header.(A warning message is printed if a tagged input file has neither.I src_sfnor.I sfin its header.).PPAs usual, the command line is added as a comment and the header of\fIinput\fP is added as a source file to \fIoutput\fP. .SH "SEE ALSO".PP.nf\fIFEA_SPEC\fP(5\-\s-1ESPS\s+1), \fIxwaves\fP(1\-\s-1ESPS\s+1), \fIaddfea\fP(1\-\s-1ESPS\s+1),\fIaddfeahd\fP(1\-\s-1ESPS\s+1), FEA(5\-\s-1ESPS\s+1), \fIimage\fP(1\-\s-1ESPS\s+1),\fIplotsgram\fP(1\-\s-1ESPS\s+1).fi.SH "WARNINGS AND DIAGNOSTICS".PP.I tofspecwill exit with an error message if any of the following are true:the \fB\-d\fP is used and any of the input data are not positive; .I inputdoes not exist or is not an ESPS FEA file; the data field does not exist in.I input;.PP.SH "BUGS".PPNone known. .SH "AUTHOR".PPManual page and program by John Shore.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?