This site uses cookies to deliver our services and to show you relevant ads and job listings. By using our site, you acknowledge that you have read and understand our Cookie Policy , Privacy Policy , and our Terms of Service.
For a continuous signal like a sinewave, you need to capture a segment of the signal in order to perform the DFT. Usually, you also need to apply a window function to the captured signal before taking the DFT [1 - 3]. There are many different window functions and each produces a different approximation of the spectrum.
This article is available in PDF format for easy printing. The DFT is good at finding the spectrum of finite-duration signals, but a snag arises for signals that are continuously present over long duration, for example, a sinewave. The snag is apparent in the DFT formula, which is defined over a finite number of samples N:.
Figure one is an example of a finite-duration signal — it is fully captured in less than time samples. On the other hand, the sinewave at the top of Figure 2 has an infinite number of samples. If we try, as in the bottom of Figure 2, to capture a chunk of it and take the DFT, there is no reason to expect a happy result. The mismatch in amplitude between the two ends of the signal distorts the spectrum, a phenomenon called spectral leakage. We would have to capture an exact integer number of periods to get an accurate spectrum.
The way around this problem is illustrated in Figure 3. In this example, we capture samples of the sinewave, then multiply each sample by the corresponding sample of the window function shown in the middle plot, which has the property of smoothly approaching zero at each end.
Figure 1. Signal of finite duration. Figure 2. Top: Signal of infinite duration. Bottom: point capture of signal. Figure 3. Top: Captured sinewave. The first and last elements of w n are zero. Note that limiting n to 1:N-1 removes the zero-valued elements. This is done automatically by the Matlab function hanning. The window is plotted at the top of figure 4. We can approximate the Fourier Transform of the window by appending zeros to the window zero-padding and taking the DFT. If we zero-pad such that the number of samples is increased by a factor of L, then the DFT frequency spacing is reduced by a factor of L compared to the N-point DFT [5].
Here is the code to find the spectrum of the hanning window:. The dB-magnitude spectrum is plotted in the middle plot of Figure 4. The dB-magnitude spectrum is plotted in blue in the bottom plot of Figure 4, along with that of the zero-padded window. Figure 4. It will behoove us to keep careful track of the power of the signal and its spectrum. First, we define the window, then scale it such that the power of the window function is 1 watt refer to my earlier post on the power spectrum [6].
Now define the sinewave. This sinewave has exactly 4 of periods over N, and f 0 falls exactly on a DFT frequency sample — i. Next apply the window and find the DFT by using the Matlab fft function. The Matlab operator. Each spectrum is just that of the Hanning window in Figure 4 convolved with that of a sinewave at 2 Hz multiplication in the time domain is equivalent to convolution in the frequency domain.
Unlike the ideal sine spectrum, the windowed spectrum has a finite bandwidth and sidelobes. The bandwidth is inversely proportional to the number of samples N of the captured sinewave.
For an unwindowed sine at bin center, we expect the spectral peak to be 0 dB 1 watt into 1 ohm. But the peak of the spectrum using the Hanning window is If power of a narrowband spectral component is important, this reduction of the peak level, called processing loss, should be taken into account.
Processing loss is proportional to the bandwidth of the window. In fact, it is exactly equal to the noise bandwidth in bins of the window see appendix B. This sinewave has 4. However, the N-point DFT has a different peak value and higher skirts. The difference in peak value is about 1. So here is another source of error in the displayed spectrum. This variation in the DFT amplitude is called scalloping loss [7]. Note that scalloping is only an issue for narrowband signals that have bandwidth less than the frequency bin of the DFT.
The 3-dB or 6-dB bandwidth of the main lobe is sometimes called resolution bandwidth. The sidelobe level with respect to the main lobe peak level is sometimes called dynamic range.
Dynamic range is a measure of the ability to discern a small signal in the presence of a larger signal. Figure 5. The inputs to the function are a window vector win and sample frequency fs Hz. The length of win must be a power of 2. The function outputs the figures of merit shown and plots the DFT spectrum. However, unfortunately, its first sidelobe level is only —13 dB below the main lobe peak, which is not so good. Notice that we're only showing the positive frequency portion of the window responses in Figure The triangular window has reduced sidelobe levels, but the price we've paid is that the triangular window's main lobe width is twice as wide as that of the rectangular window's.
The various nonrectangular windows' wide main lobes degrade the windowed DFT's frequency resolution by almost a factor of two. However, as we'll see, the important benefits of leakage reduction usually outweigh the loss in DFT frequency resolution. Notice the further reduction of the first sidelobe level, and the rapid sidelobe roll-off of the Hanning window. The Hamming window has even lower first sidelobe levels, but this window's sidelobes roll off slowly relative to the Hanning window.
This means that leakage three or four bins away from the center bin is lower for the Hamming window than for the Hanning window, and leakage a half dozen or so bins away from the center bin is lower for the Hanning window than for the Hamming window.
When we apply the Hanning window to Figure a 's 3. As we expected, the shape of the Hanning window's response looks broader and has a lower peak amplitude, but its sidelobe leakage is noticeably reduced from that of the rectangular window. Hanning window: a sample product of a Hanning window and a 3. We can demonstrate the benefit of using a window function to help us detect a low-level signal in the presence of a nearby high-level signal.
Let's add 64 samples of a 7 cycles per sample interval sinewave, with a peak amplitude of only 0. When we apply a Hanning window to the sum of these sinewaves, we get the time-domain input shown in Figure a.
From a practical standpoint, people who use the DFT to perform real-world signal detection have learned that their overall frequency resolution and signal sensitivity are affected much more by the size and shape of their window function than the mere size of their DFTs.
Increased signal detection sensitivity afforded using windowing: a sample product of a Hanning window and the sum of a 3. As we become more experienced using window functions on our DFT input data, we'll see how different window functions have their own individual advantages and disadvantages. Furthermore, regardless of the window function used, we've decreased the leakage in our DFT output from that of the rectangular window.
There are many different window functions described in the literature of digital signal processing—so many, in fact, that they've been named after just about everyone in the digital signal processing business.
It's not that clear that there's a great deal of difference among many of these window functions. What we find is that window selection is a trade-off between main lobe widening, first sidelobe levels, and how fast the sidelobes decrease with increased frequency.
The use of any particular window depends on the application[5], and there are many applications. Windows are used to improve DFT spectrum analysis accuracy[6], to design digital filters[7,8], to simulate antenna radiation patterns, and even in the hardware world to improve the performance of certain mechanical force to voltage conversion devices[9].
So there's plenty of window information available for those readers seeking further knowledge. The mother of all technical papers on windows is that by Harris[10].
A useful paper by Nuttall corrected and extended some portions of Harris's paper[11]. Again, the best way to appreciate windowing effects is to have access to a computer software package that contains DFT, or FFT, routines and start analyzing windowed signals. By the way, while we delayed their discussion until Section 5. They're the Chebyshev and Kaiser window functions, which have adjustable parameters, enabling us to strike a compromise between widening main lobe width and reducing sidelobe levels.
Previous page. Table of content. Next page. Chapter One. Discrete Sequences and Systems Chapter One. Periodic Sampling Chapter Two. Quadrature Signals Chapter Eight. Sample Rate Conversion Chapter Ten. Signal Averaging Chapter Eleven. Decibels dB and dBm Appendix E. Decibels dB and dBm Section E. Digital Filter Terminology Appendix F. Frequency Sampling Filter Design Tables show all menu. Understanding Digital Signal Processing 2nd Edition.
Authors: Richard G.
0コメント