man.diff
来自「speech signal process tools」· DIFF 代码 · 共 459 行 · 第 1/2 页
DIFF
459 行
.\" Copyright (c) 1987 Entropic Speech, Inc.; All rights reserved.\" @(#)testsd.1 3.13 3/28/97 ESI.TH TESTSD 1\-ESPS 3/28/97.ds ]W (c) 1992 ERL, Inc..SH "NAME"testsd - make test signal (sine wave, square wave, noise, pulses, ASCII input, etc.).SH "SYNOPSIS".B testsd[.BI \-P " param_file"] [.BI \-x " debug_level"] [.BI \-T " signal_type"] [.BI \-f " frequency"] [.BI \-A " phase"] [.BI \-l " level"] [.BI \-C " sweep_rate"] [.BI \-d " decay_time"] [.BI \-r " sampling_rate"] [.BI \-{ps} " length"] [.BI \-a " asciifile"] [.BI \-S " seed"] [ .BI \-t " data_type"] [.B \-c] [.B \-i] .I "sdfile".SH "DESCRIPTION".PP.I Testsdproduces test sampled data and puts it into the real or complex,single-channel FEA_SD file \fIsdfile\fP. For many of the signaltypes, one can specify an exponential amplitude decay and a linearfrequency sweep..PPIf "\-" is supplied in place of.I sdfile,then standard output is used. The default data type in the outputFEA_SD file is FLOAT (or FLOAT_CPLX). Any output data type can be specified with the \fB-t\fP option (see also \fB-c\fP and\fB-i\fP). .PPThe following signal types are supported:.TPSine waves or complex exponentials (\fB-T\fP sine)If real sine waves are specified, the output data are\fIlevel\fP*\fIsin\fP[ pi (2fn/r + P/180)], where "pi" stands for theobvious thing, f is the frequency, n is the sample number, r is thesampling rate, and P is the phase (in degrees). Complex exponentialsof the form \fIlevel\fP*\fIexp\fP[i pi (2fn/r + P/180)] will be generated if the signal type is "sine" and a complex \fIdata_type\fPis specified. .TPSquare waves (\fB-T\fP square)In the terms defined above, the output data are\fIlevel\fP*\fIsquare\fP[pi (2fn/r + P/180)], where \fIsquare\fP() isa function with positive constant value from 0 to 180 degrees, andnegative constant value from 180 to 360 degrees. .TPTriangular waves (\fB-T\fP triangle) The output data are \fIlevel\fP*\fItriangle\fP[pi (2fn/r + P/180)],where \fItriangle\fP() is a piecewise constant function that"approximates" a sine wave with alternating positive and negativeslope segments. .TPSaw tooth wave (\fB-T\fP sawtooth)The output data are \fIlevel\fP*\fIsaw\fP[pi (fn/r + P/180)],where \fIsaw\fP() is a constant-slope (ramp) function with value zero at 0 degrees and value one at 360 degrees. .TPPulse train (\fB-T\fP pulses)Positive pulses of amplitude \fIlevel\fP are spaced equally through.I sdfile, starting at record 1 and with spacing equal to the reciprocal of the .I frequency (rounded to the closest sample). More precisely, the output data arezero everywhere except at the sample closest to the points at which theangle function pi*(fn/r + P/180) goes through multiples of 2*pi..TPConstant (\fB-T\fP constant)A constant value \fIlevel\fP is generated. .TPGaussian noise (\fB-T\fP gauss) Gaussian noise is generated with\fIlevel\fP being the rms value. .TPUniform noise (\fB-T\fP uniform)Uniform noise is generated in the interval [-\fIlevel\fP,\fIlevel\fP]. .TPASCII input data (\fB-a\fP) Arbitrary data can be provided using theinput ASCII file.I asciifile. (If "\-" is supplied in place of.I asciifile,then standard input is used). .PPIf a complex output data type is specified (see \fB-t\fP and\fB-c\fP), the action taken depends on the \fIsignal_type\fP. ForSINE, complex exponentials are generated (as described above). Forthe signal types SQUARE, TRIANGLE, SAWTOOTH, CONSTANT, and PULSES thereal and imaginary parts are identical. For noise types (GAUSS andUNIFORM), independent noise is generated for the real and imaginaryparts. For ASCII input, it is assumed that the real and imaginaryparts alternate in the input, with the first value being real..PPFor all signal types but ASCII, a decaying exponential envelope can beimposed by means of the \fB-d\fP option. In this case, each generatedsample is multiplied by \fIexp\fP[- n/rT], where T is the\fIdecay_time\fP, n is the sample number, and r is the sampling rate.(Growing exponentials can also be generated by means of a negative\fIdecay_time\fP, but be careful since no checks are made foroverflow.).PPFor the periodic signal types (SINE, SQUARE, TRIANGLE, SAWTOOTH, andPULSES), the instantaneous frequency can be swept linearly with timeif the \fB-C\fP option is used. That is, the instantaneous frequency(derivative of the phase) is given by \fIf + Cn/r\fP, where f is theinitial frequency (e.g., from the \fB-f\fP option), C is the sweeprate, n is the sample number, and r is the sampling rate. Note that,since the frequency is modified at every sample (rather than, forexample, at the end of every period), the waveform shapes for TRIANGLE and SAWTOOTH will be distorted from their usualpiecewise-linear shapes. For PULSES, the point at which the pulseappears is rounded to the nearest sample..PPExcept for the case of ASCII input data, the output from \fItestsd\fPis buffered, which means that one can generate an extremely longsignal without running out of memory (one might, for example, want todo this as the input to a pipe). In the case of ASCII data, theoutput is not buffered \- all the data are input before the outputfile is generated. For applications in which this is a problem, onecan instead use \fIaddfea\fP(1\-\s-1ESPS\s+1), which does buffer thedata (it does it one sample at a time, however, so it will be slowerthan \fItestsd\fP for the same input). Another advantage of\fIaddfea\fP, is that one can use it to convert ASCII data to amulti-channel FEA_SD file. For example, the command.nf %addfea \-T FEA_SD \-f samples \-t float_cplx \-s 2 data.ascii data.fea.ficonverts ASCII data to a two-channel, complex FEA_SD file. .SH OPTIONS.PPThe following options are supported:.TP.BI \-P " param_file \fR[params]\fP"uses the parameter file .I param_filerather than the default, which is.I params..TP.BI \-x " debug_level \fR[0]\fP"If .I debug_levelis positive,.I testsdprints debugging messages and other information on the standard erroroutput. The messages proliferate as the .I debug_levelincreases. If.I debug_levelis 0, no messages are printed. Only levels 0 and 1 are supported. .TP.BI \-T " signal_type \fR[sine]\fP"Specifies the signal_type of test data. Possible values are "sine"(for a sine wave or complex exponential), "square" (for square waves),"triangle" (for triangle waves), "sawtooth" for sawtooth waves,"pulses" (for a pulse train), "constant" (for a sequence of constantvalues), "gauss" (for Gaussian noise), and "uniform" (for uniform noise).The \fB-T\fP option may not be used if .B \-a is specified (for ASCII input). .TP.BI \-f " frequency \fR[500]\fP"Specifies the frequency in the case of periodic signals (sine, square,triangle, sawtooth, pulses). This option is ignored if .B \-ais specified. .TP.BI \-A " phase\fR[0]\fP"Specifies the phase in the case of all periodic signals (sine, square,triangle, sawtooth, pulses). The phase is given in units of degrees..TP.BI \-l " level \fR[500]\fP"Selects the power level of the test data. For Gaussian noise, .I levelis the RMS amplitude (standard deviation). For uniform noise, values are generated in the interval [-\fIlevel\fP, \fIlevel\fP]. For periodic signals (sine, square, triangle, sawtooth, pulses), .I levelis the maximum amplitude of the waveform. For constant data, allsamples have the value \fIlevel\fP. This option is ignored if.B \-ais specified. .TP.BI \-r " samp_rate \fR[8000]\fP"Specifies the sampling rate. The default is 8000 Hz. .TP.BI \-C " sweep_rate \fR[0]\fP"Specifies the linear sweep rate ("linear chirp") for periodic signaltypes (sine, square, triangle, sawtooth, and pulses)..TP.BI \-d " decay_time \fR[0]\fP"Specifies the decay time for an optional exponential factor that isapplied to all samples (except ASCII input). The \fIdecay_time\fP isthe time (in seconds) it takes for the factor to decay to from 1.0 to1/e. If a negative number is supplied for \fIdecay_time\fP,exponential growth (instead of decay) will result. Note that nochecks for overflow are made in this case (so beware!)..TP .BI \-p " length \fR[8000]\fP"Specifies that .I sdfile
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?