Как выбрать гостиницу для кошек
14 декабря, 2021
It is possible to implement the method of Section 2.7 for the evaluation of the frequency response on a digital computer. This would involve the numerical evaluation of the input-output cross-correlation function and the input autocorrelation function using
Ci/Ap) = (1/N) X хі(Р)х/.Р + Ap) (4.12.1)
p= 1
where Cij is the autocorrelation function if і = j, or the cross-correlation function if і ф j, and Ap the number of sampling intervals to give the desired lag. Both correlation functions are then Fourier transformed, and the ratio of the Fourier transform of the cross-correlation function to the Fourier transform of the input autocorrelation gives the system frequency response.
It is informative to consider the use of the indirect method for analyzing n periods of a periodic signal to get the power spectrum. The usual procedure is to compute the correlation function for enough different lags Ap to give correlation function results for a span of one period. Thus the maximum lag to be calculated is equal to the period. The maximum number of terms in the calculation at any lag is (n — 1)5, where n is the number of periods and S the number of samples per period. The reason the factor is (n — 1) instead
of n is that each term in the series must use two values of the function, and one of them is lagged as much as a period. In order to obtain the same sampling interval (and the same Nyquist frequency) in the correlation function, we must calculate the correlation function for a total of S lags. Then the total number of multiplications required to form the correlation function is
(n — 1)S2.
If we add on the number of multiplications required for the Fourier analysis, then the total number of multiplications is
(n — 1)S2 + SF using the DFT of Section 4.4
(n — 1)S2 + 2Slog2 S using FFT
where F is the number of frequencies to be analyzed.
This can be compared with direct Fourier analysis of the signal. The number of multiplications required would be nSF using the DFT of Section 4.4 and 2Sn log2 Sn using the FFT. The ratio of the analysis time for the indirect method and for direct Fourier analysis is
We observe the direct Fourier analysis based on the DFT of Section 4.4 is faster than the indirect method as long as the number of frequencies to be analyzed is fewer than S. The direct method based on FFT is much faster than the indirect method for all practical values of n and S.
A roundabout way of evaluating the correlation functions has been developed that exploits the great speed of the FFT. This involves the calculation of the power spectra of input and output signals and their cross-power spectrum using Fourier coefficients obtained from the FFT. The correlation functions are then obtained by performing inverse Fourier transforms of the power spectra using the FFT. This is readily accomplished, and the time required is much less than a straightforward calculation of the correlation functions.