正在加载图片...
558 Chapter 13.Fourier and Spectral Applications for (j=2;j<=m;j++){ i2-i+ji p[jj+=(SQR(w1[02])+SQR(w1[j2-1]) +s0R(w1[m44-j2])+SQR(w1[m43-j2])); den sumw; den *m4; Correct normalization for (j=1;j<=m;j++)p[j]/den; Normalize the output. free_vector(w2,1,m); free_vector(w1,1,m4); 83g 18881892 CITED REFERENCES AND FURTHER READING: Oppenheim,A.V.,and Schafer,R.W.1989,Discrete-Time Signa/Processing (Englewood Cliffs, NJ:Prentice-Hall).[1] Harris,F.J.1978,Proceedings of the IEEE,vol.66,pp.51-83.[2] NUMERICAL RECIPES I Childers,D.G.(ed.)1978,Modern Spectrum Analysis(New York:IEEE Press),paper by P.D. Welch.[3] 三 令 Champeney,D.C.1973,Fourier Transforms and Their Physical Applications(New York:Academic Press). Elliott,D.F.,and Rao,K.R.1982,Fast Transforms:Algorithms,Analyses,Applications (New York: Press. Academic Press). Bloomfield,P.1976.Fourier Analysis of Time Series-An Introduction (New York:Wiley). Rabiner,L.R.,and Gold,B.1975,Theory and Application of Digital Signal Processing(Englewood Cliffs,NJ:Prentice-Hall). SCIENTIFIC 13.5 Digital Filtering in the Time Domain COMPUTING (ISBN 188810920 Suppose that you have a signal that you want to filter digitally.For example,perhaps you want to apply high-pass or low-pass filtering,to eliminate noise at low or high frequencies respectively;or perhaps the interesting part of your signal lies only in a certain frequency band,so that you need a bandpass filter.Or,if your measurements are contaminated by 60 uurggoglrion Numerical Recipes 10-621 43106 Hz power-line interference,you may need a notch filter to remove only a narrow band around that frequency.This section speaks particularly about the case in which you have chosen to do such filtering in the time domain. (outside Before continuing,we hope you will reconsider this choice.Remember how convenient it is to filter in the Fourier domain.You just take your whole data record,FFT it,multiply North Software. the FFT output by a filter function (f),and then do an inverse FFT to get back a filtered data set in time domain.Here is some additional background on the Fourier technique that you will want to take into account. Remember that you must define your filter function (f)for both positive and negative frequencies,and that the magnitude of the frequency extremes is always the Nyquist frequency 1/(2A),where A is the sampling interval.The magnitude of the smallest nonzero frequencies in the FFT is +1/(NA),where N is the number of (complex)points in the FFT.The positive and negative frequencies to which this filter are applied are arranged in wrap-around order. If the measured data are real,and you want the filtered output also to be real,then your arbitrary filter function should obey H(-f)=H(f)*.You can arrange this most easily by picking an H that is real and even in f.558 Chapter 13. Fourier and Spectral Applications Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). for (j=2;j<=m;j++) { j2=j+j; p[j] += (SQR(w1[j2])+SQR(w1[j2-1]) +SQR(w1[m44-j2])+SQR(w1[m43-j2])); } den += sumw; } den *= m4; Correct normalization. for (j=1;j<=m;j++) p[j] /= den; Normalize the output. free_vector(w2,1,m); free_vector(w1,1,m4); } CITED REFERENCES AND FURTHER READING: Oppenheim, A.V., and Schafer, R.W. 1989, Discrete-Time Signal Processing (Englewood Cliffs, NJ: Prentice-Hall). [1] Harris, F.J. 1978, Proceedings of the IEEE, vol. 66, pp. 51–83. [2] Childers, D.G. (ed.) 1978, Modern Spectrum Analysis (New York: IEEE Press), paper by P.D. Welch. [3] Champeney, D.C. 1973, Fourier Transforms and Their Physical Applications (New York: Academic Press). Elliott, D.F., and Rao, K.R. 1982, Fast Transforms: Algorithms, Analyses, Applications (New York: Academic Press). Bloomfield, P. 1976, Fourier Analysis of Time Series – An Introduction (New York: Wiley). Rabiner, L.R., and Gold, B. 1975, Theory and Application of Digital Signal Processing (Englewood Cliffs, NJ: Prentice-Hall). 13.5 Digital Filtering in the Time Domain Suppose that you have a signal that you want to filter digitally. For example, perhaps you want to apply high-pass or low-pass filtering, to eliminate noise at low or high frequencies respectively; or perhaps the interesting part of your signal lies only in a certain frequency band, so that you need a bandpass filter. Or, if your measurements are contaminated by 60 Hz power-line interference, you may need a notch filter to remove only a narrow band around that frequency. This section speaks particularly about the case in which you have chosen to do such filtering in the time domain. Before continuing, we hope you will reconsider this choice. Remember how convenient it is to filter in the Fourier domain. You just take your whole data record, FFT it, multiply the FFT output by a filter function H(f), and then do an inverse FFT to get back a filtered data set in time domain. Here is some additional background on the Fourier technique that you will want to take into account. • Remember that you must define your filter function H(f) for both positive and negative frequencies, and that the magnitude of the frequency extremes is always the Nyquist frequency 1/(2∆), where ∆ is the sampling interval. The magnitude of the smallest nonzero frequencies in the FFT is ±1/(N∆), where N is the number of (complex) points in the FFT. The positive and negative frequencies to which this filter are applied are arranged in wrap-around order. • If the measured data are real, and you want the filtered output also to be real, then your arbitrary filter function should obey H(−f) = H(f)*. You can arrange this most easily by picking an H that is real and even in f
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有