filspectru.3

来自「speech signal process tools」· 3 代码 · 共 70 行

3
70
字号
.\" Copyright (c) 1992 Entropic Research Laboratory, Inc.; All rights reserved.\" @(#)filspectru.3	1.2 27 Sep 1997 ERL.ds ]W (c) 1992 Entropic Research Laboratory, Inc..TH  fil_spectrum 3\-ESPS 27 Sep 1997.SH NAMEfil_spectrum \- computes FIR, IIR filter spectral response.SH SYNOPSIS.nf.ft B#include <esps/feafilt.h>#include <esps/feaspec.h>int fil_spectrum( spec_rec, mag, phase, filt_rec, fhd, nsamp )struct feaspec *spec_rec;double *mag;double *phase;struct feafilt *filt_rec;struct header *fhd;long nsamp;.ft.fi.SH DESCRIPTION.PP\fIfil_spectrum\fR computes the spectral response from a FIR or IIR filter as specified by \fIfilt_rec\fR.  The number of output points for frequency range from0 to the Nyquist rate is given by \fInsamp\fR.  Output can bepointed to by any one of the non-NULL pointers, \fIspec_rec, mag\fR, or\fIphase\fR.  Output complex spectrum is pointed to by \fIspec_rec\fR,output linear spectral magnitude response is pointed to by \fImag\fR,and ouput phase response is pointed to by \fIphase\fR.  \fIfhd\fR isthe file header of the \fIfilt_rec\fR.  Currently \fIfhd\fR is not usedin the function..PPFor IIR spectral response, \fInsamp\fR can be an arbitrary number ifpoles and zeros coefficients are stored in \fIfilt_rec\fR.  The overallgain for the IIR pole/zero system equals to\fIfilt_rec->re_num_coeff[0]\fR.If \fIfilt_rec->re_num_coeff[0]\fR does not exist, the gain is set to 1..PPFor FIR spectral response, \fInsamp\fR must be a power of 2 plus 1..SH EXAMPLES.nf/* The following computes linear spectral magnitude */double mag[1025];struct feafilt *filt_rec;struct header *fhd;FILE fp;get_feafilt_rec( filt_rec, fhd, fp);fil_spectrum( NULL, mag, NULL, filt_rec, fhd, 1025 );.PP.SH ERRORS AND DIAGNOSTICSThe function returns 0 upon success, 1 otherwise.  The function printsan error message if \fInsamp\fR is not a power of 2 plus 1 when computingFIR spectral response..PP.SH "SEE ALSO".IR filtspec (1\-ESPS),.IR FEA_FILT (5\-ESPS).PP.SH AUTHOR.PPDerek Lin

⌨️ 快捷键说明

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