Besides probing with our single cycle sine and cosine , the presumed fundamental of the target wave, we continue with the harmonic series 2x, 3x, 4x… through half the sample rate. At that point, there are only two sample points per probe cycle, the Nyquist limit. We also probe with 0x, which is just the average of the target and gives us the DC offset.
Doubling the number of target samples higher time resolution doubles the number of harmonic probes higher frequency resolution. By tradition, the sine and cosine probe results are represented by a single complex number, where the cosine component is the real part and the sine component the imaginary part.
There are two good reasons to do it this way: The relationship of cosine and sine follows the same mathematical rules as do complex numbers for instance, you add two complex numbers by summing their real and complex parts separately, as you would with sine and cosine components , and it allows us to write simpler equations.
Many computer languages and math packages support the atan2 function. This give you the phase shift of each harmonic in radians. Since the real part corresponds to cosine, you can see that a harmonic with an imaginary part of zero results in a phase of zero—corresponding to a cosine.
First, note that all of the sine probes are zero at the start and in the middle of the record—no need to perform operations for those. Further, all the even-numbered sine probes cross zero at one-fourth increments through the record, every fourth probe at one-eighth, and so on.
Note the powers of two in this pattern. Similarly, there are patterns for when the sine and cosine are at 1. The Fourier transform works correctly only within the rules laid out—transforming a single cycle of the target periodic waveform. In practical use, we often sample an arbitrary waveform, which may or may not be periodic.
Even if the sampled waveform is exactly periodic, we might not know what that period is, and if we did it may not exactly fit our transform length we may be using a power-of-two length for the FFT. And for arbitrarily long signals analyzing a constant stream of incoming sound, for instance , we can perform FFTs repeatedly—much in the way a movie is made up of a constant stream of still pictures—and overlap them to smooth out errors. There is a wealth of information on the web. Or maybe having a basic idea of how it works is good enough to feel more comfortable with using the FFT.
For another source on the transform and basic C code, try Numerical Recipes in C. Thanks for this. I have been scratching my head to work out how FFT works and this provided a very good background. Thanks for posting this. Thank you SO much for this web page. I seen FFT being mentioned for 30 years, even used it, but never understood what the principle behind was. Now in 3 paragraphs I understood completely! Thank you, Hans, for catching this. This explanation really worked for me. Still, the idea of probing with sin and cos is easier to wrap my head around.
The result is that the sampled and subsequent "windowed" signal begins and ends at amplitude zero. The sample can now be repeated periodically without a hard transition. A classic example of the signal theory is the spectral composition of a square-wave signal.
This consists of the sum of all weighted odd multiples of the fundamental frequency. For multi-channel and more detailed analysis or calculations, a more powerful system with large bandwidth and fast signal processors such as the FLEXUS FX Audio Analyzer is required. In conjunction with the FX-Control PC software, the FFT can be easily and quickly adapted and visualized according to the requirements of the measurement.
The larger internal memory of the FLEXUS FX allows significantly longer blocklengths to be processed, resulting in a much finer frequency resolution.
This second part of this article deals with specific aspects that are helpful in the practical application of FFT measurements. FFT measurements are used in numerous applications. The results are usually presented as graphs and are easy to interpret. For accurate FFT measurements, there are some things to look out for.
This article provides valuable tips. As explained in the first part, the sampling rate fs of the measuring system and the block length BL are the two central parameters of an FFT. The sampling rate indicates how often the analog signal to be analyzed is scanned. When recording wav files via a commercially-available PC sound card, for example, the audio signal is usually sampled 44, times per second.
Harry Nyquist was the discoverer of a fundamental rule in the sampling of analog signals: the sampling frequency must be at least double the highest frequency of the signal. If, for example, a signal containing frequencies up to 24 kHz is to be sampled, a sampling rate of at least 48 kHz is required for this purpose.
Half the sampling rate, in this example 24 kHz, is called the "Nyquist frequency". But what happens if signals above the Nyquist frequency are fed in to the system? For the most, a signal is sampled with a more-than-sufficient number of samples. With a 48 kHz sampling rate, for example, the 6 kHz frequency is sampled 8 times per cycle, while the 12 kHz frequency is only sampled 4 times per cycle. At the Nyquist frequency, only 2 samples are available per cycle.
With 2 samples or more it is still possible to reconstruct the signal without loss. If, however, less than 2 samples are available, artifacts which do not occur in the sampled original signal are generated. In the FFT, these artifacts appear as mirror frequencies. If the Nyquist frequency is exceeded, the signal is reflected at this imaginary limit and falls back into the useful frequency band.
The following video shows an FFT system with Tukey 1 Their work led to the development of a program known as the fast Fourier transform. The fast Fourier transform FFT is a computationally efficient method of generating a Fourier transform. The main advantage of an FFT is speed, which it gets by decreasing the number of calculations needed to analyze a waveform.
A disadvantage associated with the FFT is the restricted range of waveform data that can be transformed and the need to apply a window weighting function to be defined to the waveform to compensate for spectral leakage also to be defined. The DFT allows you to precisely define the range over which the transform will be calculated, which eliminates the need to window.
The transformation from the time domain to the frequency domain is reversible. Once the power spectrum is displayed by one of the two previously mentioned transforms, the original signal can be reconstructed as a function of time by computing the inverse Fourier transform IFT.
Each of these transforms will be discussed individually in the following paragraphs to fill in missing background and to provide a yardstick for comparison among the various Fourier analysis software packages on the market. The FFT algorithm reduces an n-point Fourier transform to about. For example, calculated directly, a DFT on 1, i. But the increase in speed comes at the cost of versatility. The FFT function automatically places some restrictions on the time series to be evaluated in order to generate a meaningful, accurate frequency response.
Because the FFT function uses a base 2 logarithm by definition, it requires that the range or length of the time series to be evaluated contains a total number of data points precisely equal to a 2-to-the-nth-power number e.
Therefore, with an FFT you can only evaluate a fixed length waveform containing points, or points, or points, etc. For example, if your time series contains data points, you would only be able to evaluate of them at a time using an FFT since is the highest 2-to-the-nth-power that is less than Because of this 2-to-the-nth-power limitation, an additional problem materializes. When a waveform is evaluated by an FFT, a section of the waveform becomes bounded to enclose points, or points, etc.
One of these boundaries also establishes a starting or reference point on the waveform that repeats after a definite interval, thus defining one complete cycle or period of the waveform. Any number of waveform periods and more importantly, partial waveform periods can exist between these boundaries. This is where the problem develops. The FFT function also requires that the time series to be evaluated is a commensurate periodic function, or in other words, the time series must contain a whole number of periods as shown in Figure 2a to generate an accurate frequency response.
Obviously, the chances of a waveform containing a number of points equal to a 2-to-the-nth-power number and ending on a whole number of periods are slim at best, so something must be done to ensure an accurate representation in the frequency domain. What would happen if an FFT was performed on a waveform that did not contain a whole number of periods as shown in Figure 2b?
Figure 2 — An example of waveform continuity versus discontinuity that avoids complicated mathematical explanation. This waveform possesses end-point continuity as shown in c , which means the resulting power spectrum will be accurate and no window need be applied.
A more typical encounter is shown in b , where the range of the FFT does not contain a whole number of periods. The discontinuity in the end-points of this waveform d means the resulting power spectrum will contain high frequency components not present in the input, requiring the application of a window to attenuate the discontinuity and improve accuracy.
Think of the length of waveform to be evaluated as a ring that has been uncoiled. If the ends of the uncoiled ring were joined back together to again form a ring, a waveform consisting of a whole number of periods would join together perfectly as shown in Figure 2c.
However, a waveform consisting of a fractional number of periods would not join together perfectly without a gap between or an overlapping of the ends as shown in Figure 2d. Thus, the FFT would evaluate this waveform with the end-point error and generate a power spectrum containing false frequency components representative of the end-point mismatch.
Consider the spectra shown in Figure 3. This figure shows the power spectrum of two sine waves of equal amplitude and frequency. However, the peak of the right power spectrum appears somewhat "spread out".
This inaccuracy is the result of an FFT performed on a waveform that does not contain a whole number of periods. The spreading out or "leakage" effect of the right power spectrum is due to energy being artificially generated by the discontinuity at the end points of the waveform.
Fortunately, a solution exists to minimize this leakage effect error and ensure accuracy in the frequency domain. Aside from the DFT to be defined , the only solution is to multiply the time series by a window weighting function before the FFT is performed. Most window weighting functions often referred to as just "windows" attenuate the discontinuity by tapering the signal to zero at both ends of the window, as shown in Figure 5d.
However, if your waveform has important information appearing at the ends of the window, it will be destroyed by the tapering. In this case, a solution other than a window must be sought. With the window approach, the periodically incorrect signal as processed by the FFT will have a smooth transition at the end points which results in a more accurate power spectrum representation.
A number of windows exist. Each has different characteristics that make one window better than the others at separating spectral components near each other in frequency, or at isolating one spectral component that is much smaller than another, or whatever the task.
Some popular windows named after their inventors are Hamming, Bartlett, Hanning, and Blackman. The Hamming window offers the familiar bell-shaped weighting function but does not bring the signal to zero at the edges of the window. The Hamming window produces a very good spectral peak, but features only fair spectral leakage reduction. The Bartlett window offers a triangular shaped weighting function that brings the signal to zero at the edges of the window.
This window produces a good, sharp spectral peak and is good at reducing spectral leakage as well. The Hanning window offers a similar bell-shaped window a good approximation to the shape of the Hanning window can be seen in Figure 5d that also brings the signal to zero at the edges of the window. The Hanning window produces good spectral peak sharpness as good as the Bartlett window , but the Hanning offers very good spectral leakage reduction better than the Bartlett.
The Blackman window offers a weighting function similar to the Hanning but narrower in shape. Because of the narrow shape, the Blackman window is the best at reducing spectral leakage, but the trade-off is only fair spectral peak sharpness. As Figure 4 illustrates, the choice of window function is an art.
0コメント