⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pkmc_filt.1

📁 speech signal process tools
💻 1
字号:
.\" Copyright (c) 1992 Entropic Research Laboratory, Inc.; All rights reserved.\" @(#)pkmc_filt.1	1.7 4/3/97 ERL.ds ]W (c) 1992 Entropic Research Laboratory, Inc..TH  PKMC_FILT 1\-ESPS 4/3/97.SH NAME.nfpkmc_filt \- design an equiripple FIR filter using the Parks-McClellan algorithm.fi.SH SYNOPSIS.Bpkmc_filt.BI \-P " param_file"[.BI \-x " debug_level"].I file.filter.SH DESCRIPTION.PPThe program \fIpkmc_filt\fR designs a linear-phase finite-impulse response(FIR) filter that meets the specification defined in the parameter file \fIparam_file\fR.  The filter coefficients are saved in the output file\fIfile.filter\fR.  If \fIfile.filter\fR is replaced by "-", the standard output is written..PPThe design method is based on the Parks-McClellan algorithm.  The resultingfilter minimizes the maximum-weighted approximation-error.  One of thefour standard FIR types is produced.  For a filter with multiple stopbandsand passbands, the Type 1 (symmetric and odd length) or Type 2 (symmetric andeven length) filter is designed.  For a differentiator or a HilbertTransformer, either the Type 3 (anti-symmetric and odd length) orthe Type 4 (anti-symmmetric and even length) is designed..PPFrequency responses of Types 2 and 3 filters are equal to 0 at PI, which is undesirable for a highpass filter.  For multiple stopbands/passbandsfilters, type 1 and 2 are used.  For differentiator and Hilbert transformer,type 3 and 4 are used..PPA generic Parks-McClellan algorithm is implemented here, withoutnumerical optimization.  Numerical problem occurs for filter with morethan 100 taps, narrow passbands/stopbands, large transition bands, andnon-symmetrical transition bands.  In some cases, the algorithm does not detect the problem.Typically the filter gain for such cases are large, exceeding 1.0.  Always check the result by \fIfiltspec (1\-ESPS)\fR and \fIplotspec (1\-ESPS)\fR..PPAlso see the shell script \fIxfir_filt(1\-ESPS)\fR that is a coverscript for this and other FIR filter design programs..PP.SH OPTIONS.PPThe following option is supported:.TP.BI \-x " debug_level \fR[0]\fP"If \fIdebug_level\fR is positive, \fIpkmc_filt\fR prints debugging messages and other information on the standard error output.  The messages proliferate as the \fIdebug_level\fR increases.  If \fIdebug_level\fP is 0 (the default), no messages are printed.  .SH ESPS PARAMETERSThe following parameters are read from the \fIparam_file\fR:.TP.I filt_type - stringThe type of filter desired.  Use \fIMULTIBAND\fR for lowpass, highpass, bandpass, bandstop, and arbitrary multiple stop/passbands FIRs.  Use \fIDIFFERENTIATOR\fR for a differentiator and \fIHILBERT\fR forHilbert transform filter..TP.I filt_length - intNumber of taps for the filter..TP.I ngrid - intThis is an optional parameter. It specifies the number of grid points used for interpolation from 0 to PI/2.  The default value is 2 *\fIfilt_length\fR..TP.I samp_freq - floatThe sampling frequency.  This number is used for rescaling the valuesof bandedge parameters..TP.I nbands - intNumber of bands from 0 to \fIsamp_freq/2\fR.  For example, for a \fIMULTIBAND\fR filter type, a lowpass filter has 2 bands -- a passband from 0 to some frequency \fIf1\fR and a stopband from some frequency \fIf2\fR to \fIsamp_freq/2\fR, where \fIf1<f2\fR.For a differentiator, \fInbands\fR is 1 if a full band differentiator is desired, 2 otherwise. For a Hilbert transform filter, \fInbands\fR is always 1, and its band extend from 0 to \fIsamp_freq/2\fR..PPThe following set of the parameters have the forms of \fIband[i]_edge1\fR,\fIband[i]_edge2\fR, \fIband[i]_des\fR, and \fIband[i]_wt\fR, where\fIi\fR denotes the band number.  For example, \fIband2_edge1\fR isa parameter for the left edge of the second band.  The number of sets ofthese parameters must be equal to \fInbands\fR.Band 1 is the left-most band, band \fInband\fR is the right-most band..PPThe response at the band edges is automatically determined by thealgorithm, the error on the band edge is the same equi-ripple errorof the band.  The generic header item \fIripple_db\fR in the outputfile contains the equi-ripple error in dB that represents thesmallest approximation error that meets the specification..TP.I band[i]_edge1 - floatThe left edge of \fIi\fRth band.  It must be 0 for \fIband1_edge1\fR..TP.I band[i]_edge2 - floatThe right edge of \fIi\fRth band.  It must be \fIsamp_freq/2\fR for the last band.  \fIband[i]_edge2\fR and \fIband[i+1]_edge1\fRcan not be the same number.  In fact \fIband[i]_edge2 >band[i+1]_edge1\fR.  .TP.I band[i]_des - floatFor \fIMULTIBAND\fR filter type, it is the desired constant value forthe \fIi\fRth band.  For \fIDIFFERENTIATOR\fR filter type, it is the slope of the frequency response on the passband.  The slope is measured bythe amplitude response over normalized frequency axis.  For \fIHILBERT\fR, it should be set to 1..TP.I band[i]_wt - floatFor \fIMULTIBAND\fR filter type, it is the constant weighting factor for the approximation error in \fIi\fRth band.  The weights in bands are relativeto one another.  For example, in a two band filter, \fIband1_wt\fR of 10and \fIband2_wt\fR of 20 are the same as \fIband1_wt\fR of 1 and 2 forthe other band.  For \fIDIFFERENTIATOR\fR filter type, the weighting function \fI1/f\fR is appplied to thethe passband region of the differentiator. For \fIHILBERT\fR, it shouldalways be set to 1..PP.SH ESPS COMMONNo ESPS common parameter processing is used..PP.SH ESPS HEADERSA new FEAFILT header is created for the  output  file.   Theprogram  fills  in  appropriate values in the common part ofthe header as well as the  following  generic  header  itemsassociated with the FEAFILT type..PPThe \fIsamp_freq\fR generic header item contains value of the \fIsamp_req\fRparameter..PPThe \fIband_edges\fR generic header item of size \fI2*nbands\fR is an arraycontaining the left and rights band edges of bands..PPThe \fIdesired_value\fR generic header item of size \fInbands\fR is an arraycontaining the \fIband[i]_des\fR parameters.PPThe \fIdesired_weight\fR generic header item of size \fInbands\fR is an arraycontaining the \fIband[i]_wt\fR parameters.PPThe \fIripple_db\fR generic header item of size \fInbands\fR is an arraycontaining the error in dB for each band..PPIn addition, the generic header item \fIdelay_samples\fR  (type  DOUBLE) isadded  to the header. \fIDelay_samples\fR  is  equal  to  (filter length  -  1)/2.   This represents  the  delay  to  the  center  of  the peak of theimpulse response..PP.SH FUTURE CHANGES.PP.SH EXAMPLESThe following parameter file designs a bandpass filter with stop bandfrom 0 to 500 Hz, passband from 1000 to 2000 Hz, and stopband from2500 to 4000 Hz..PP.nf	int filt_length = 32;	float band1_edge1 = 0.000000;	float band1_edge2 = 500.000000;	float band1_des = 0.000000;	float band1_wt = 1.000000;	float band2_edge1 = 1000.000000;	float band2_edge2 = 2000.000000;	float band2_des = 1.000000;	float band2_wt = 1.000000;	float band3_edge1 = 2500.000000;	float band3_edge2 = 4000.000000;	float band3_des = 0.000000;	float band3_wt = 1.000000;	string filt_type = "MULTIBAND";	float samp_freq = 8000.000000;	int nbands = 3;.fi.PPThe unspecified regions from 500 to 1000 Hz and 2000 to 2500 Hz areunspecified and are taken as transition bands which will have arbitrayrepsonse..SH ERRORS AND DIAGNOSTICS.PP.SH BUGS.PPNone known..SH REFERENCESOppenheim & Schafer, \fIDiscrete-Time Signal Processing\fR,Prentice Hall, 1989.PP.SH "SEE ALSO"xfir_filt(1\-ESPS), cb_filt(1\-ESPS), win_filt(1\-ESPS), notch_filt(1\-ESPS), FEA_FILT(5\-ESPS), atofilt(1\-ESPS), wmse_filt(1\-ESPS), iir_filt(1\-ESPS), sfconvert(1\-ESPS).PP.SH AUTHORDerek Lin.PP

⌨️ 快捷键说明

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