?? ellf.doc
字號:
ellf.cThis program calculates design coefficients fordigital filters of the Butterworth, Chebyshev, orelliptic varieties.Usage:Inputs are entered by keyboard, or are redirected to come froma command file, as follows:Kind of filter (1: Butterworth, 2: Chebyshev, 3: Elliptic, 0: exit to monitor)Shape of filter (1: low pass, 2: band pass, 3: high pass, 4: band reject, 0: exit to monitor)Order of filter (an integer)Passband ripple (peak to peak decibels)Sampling frequency (Hz)Passband edge frequency (Hz)Second passband edge frequency (for band pass or reject filters)Stop band edge frequency (Hz) or stop band attenuation (entered as -decibels)The "exit to monitor" type 0 may be used to terminate theprogram when input is redirected to come from a command file.If your specification is illegal, e.g. the stop band edgeis in the middle of the passband, the program will make youstart over. However, it remembers and displays the lastvalue of each parameter entered. To use the same value, justhit carriage return instead of typing it in again.The program displays relevant pass band and stop band edgefrequencies and stop band attenuation. The z-plane coefficientsare printed in these forms: Numerator and denominator z polynomial coefficients Pole and zero locations Polynomial coefficients of quadratic factorsAfter giving all the coefficients, the program prints atable of the frequency response of the filter. You canget a picture by reading the table into gnuplot.Filter design:The output coefficients of primary interest are shown as follows:(z-plane pole location:)pole 3.0050282041410E-001 9.3475816516366E-001(quadratic factors:)q. f.z**2 9.6407477241696E-001z**1 -6.0100564082819E-001(center frequency, gain at f0, and gain at 0 Hz:)f0 2.00496167E+003 gain 2.9238E+001 DC gain 7.3364E-001zero 1.7886295237392E-001 9.8387399816648E-001q. f.z**2 1.0000000000000E+000z**1 -3.5772590474783E-001f0 2.21379064E+003 gain 0.0000E+000 DC gain 1.6423E+000To make a biquad filter from this, the equation for theoutput y(i) at the i-th sample as a function of the inputx(i) at the i-th sample isy(i) + -6.0100564082819E-001 y(i-1) + 9.6407477241696E-001 y(i-2)= x(i) + -3.5772590474783E-001 x(i-1) + 1.0000000000000E+000 x(i-2).Thus the two coefficients for the pole would normally benegated in a typical implementation of the filter.Compilation:This program has been compiled successfully on many differentcomputers. See the accompanying output listing file ellf.ans,for a set of correct answers. Use the batch file test.bat tocheck your executable program. If the low pass and high passoptions work but the others don't, then examine your atan2()function carefully for reversed arguments or perhaps an offest ofpi. On most systems, define ANSIC to be 1. This sets theexpected atan2() arguments but does not otherwise imply anythingabout the ANSI-ness of the program.Files:mconf.h system configuration include file Be sure to define type of computer here!cmplx.c complex arithmetic subroutine packageellf.ans right answer file for some elliptic filtersellf.que elliptic filter questionsellf.c main programellf.doc this fileellf.mak Microsoft MSDOS makefileellfu.mak Unix makefileellik.c incomplete elliptic integral of the first kindellpe.c complete elliptic integral of the second kindellpj.c Jacobian Elliptic Functionsellpk.c complete elliptic integral of the first kindmakefile Unix makefilemtherr.c common math function error handlerpolevl.c evaluates polynomialstest.bat batch file to run a testdescrip.mms VAX makefileellf.opt VAX makefiletestvax.bat VAX testReferences:A. H. Gray, Jr., and J. D. Markel, "A Computer Program forDesigning Digital Elliptic Filters", IEEE Transactions onAcoustics, Speech, and Signal Processing 6, 529-538(December, 1976)B. Gold and C. M. Rader, Digital Processing of Signals,McGraw-Hill, Inc. 1969, pp 61-90M. Abramowitz and I. A. Stegun, eds., Handbook of MathematicalFunctions, National Bureau of Standards AMS 55, 1964,Chapters 16 and 17- Steve Moshier, December 1986Last rev: November, 1992
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -