Windowing High-Resolution ADC Data - Part 1
Windowing High-Resolution ADC Data - Part 1
Josh Carnes
Applications Engineer, National Semiconductor Corp.
Abstract
Analyzing data from ADCs requires the use of windowing functions for spectral
estimation and analysis but different windows suit different purposes. National
Semiconductors new WaveVision 5 software provides a family of mathematically
simple windowing functions that spans a fundamental tradeoff and provides the
flexibility to meet a wide range of user applications. Part 1 of this article is a discussion
on spectral analysis that presents the need for data windowing as well as the effect of
windowing functions in the time and frequency domain.
Introduction
Tpulse
X Tpulse sinc (1)
0 0
2
Fourier
Transform
In most cases other than the simplest mathematical exercises a Discrete Fourier
Transform (DFT) must be used for spectrum analyses where both the time-domain data
and frequency-domain spectrum are sampled in discrete steps. The DFT, as opposed to
the DTFT, results in a sampled representation of the continuous frequency spectrum and
loses the spectrum information that occurs between frequency bins.
Figure 3 illustrates this loss of information for sinusoidal segments with two
different frequencies. Figure 3(a) shows the continuous and sampled spectrum of a
sinusoidal signal that contains a non-integer number of sinusoidal periods and is therefore
said to be non-coherent with the sampling frequency. For illustrative purposes, the
continuous spectrum is scaled in frequency and magnitude to coincide with the sampled
values of the 16-point DFT. Notice how the red, sampled points of the DFT fall on the
leakage side lobes of the sinc shaping, creating an appearance of a skirt around the largest
tone. Note also that the sample on the main lobe falls short of the lobe maximum.
Figure 3(b) shows the case where the sinusoidal segment has an integer number of
periods so the frequency is coherent with the sampling frequency. In this case the points
of the DFT fall on the zeros of the sinc function and all information in the side lobes is
lost.
(a) (b)
Figure 3: Loss of side lobe information when using the DFT on (a) non-coherent
and (b) coherent signal frequencies
This example has two important points. First, as mentioned before, any finite-time
data segment always exhibits spectral leakage as side lobes in the continuous spectrum.
Second, the loss of side lobe information when using a DFT for coherent frequencies
results in a spectrum that more closely resembles the spectrum of an infininte-time
segment. In the coherent case the user can easily identify the power of the well-contained
fundamental signal in a single frequency bin.
The DFT spectrum of non-coherent sinusoidal segment exhibits a leakage skirt,
but the level of the skirt is dependent on the relative closeness of the sinusoid frequency
to the nearest coherent frequency which occurs at the center of a DFT frequency bin.
Figure 4 compares the leakage skirts of sinusoids that are offset from the bin center by
the given amount. Obviously, larger frequency offsets from the bin center result in more
pronounced leakage skirts.
The convenient loss of the side lobe information for coherent frequencies gives
the illusion that the data extends infinitely in time. If one were to cascade the sinusoidal
segment in time as in Figure 5 (a) and (b) for the sake of observation, non-coherent
frequencies would have a discontinuity at the boundary, giving rise to additional
frequency content. Coherent frequencies would have a smooth transition and display only
one sinusoid frequency component.
Non-Coherent Frequency Coherent Frequency
(a) (b)
Figure 5: Spectral leakage as a result of end-point discontinuities when
cascading the data segment in time
Testing ADCs with coherent frequencies is preferred so that the DFT output
spectrum can be easily analyzed. With a coherent ADC input frequency, all harmonic
tones at the output will also be coherent and the output spectrum will contain clear tones
with no spectral leakage and a clean, flat noise power density.
Unfortunately, requiring coherent frequencies is impractical in large systems and
broadband applications. Therefore the data must be manipulated to limit the spectral
leakage to a small bandwidth. Windowing functions are necessary for this purpose.
Windowing Functions
In the previous section, it is shown that the appearance of spectral leakage in the
DFT spectrum is attributed to discontinuity between the end points of the transient data
record. Data acquired from an ADC is also referred to as Rectangular windowed data
because the data record is a limited time block of the signal and the amplitude of the data
is not shaped. Therefore, the ADC data is prone to endpoint discontinuities. The purpose
of applying a windowing function is to reduce the discontinuity by attenuating the values
at the beginning and end of the data record. With the discontinuity attenuated, most of the
spectral leakage is confined to a smaller frequency range.
Applying a windowing function to an N-point sampled signal is as simple as
multiplying the signal by the N-point windowing function as shown in (2). Multiplying a
non-coherent sinusoidal segment by the common Hann window of (3), see [2], results in
the transient waveform and zoomed spectrum of Figure 6. In this case the fundamental
lobe spans only a few of bins but the side lobe suppression is merely -31.5 dB. This
window does not have sufficient side lobe suppression for an accurate performance
analysis of medium to high resolution ADCs because the side lobes distort the spectrum.
The profile of the side lobes must fall below the noise power density of the ADC for
accurate analysis results.
xw n xn wn
(2)
n
wn 0.5 0.5 cos 2 for 0 n N-1 (3)
N
The shape and distribution of the contained leakage depends on the form of the
windowing function itself. Multiplying two functions in the time domain is equivalent to
convolution in the frequency domain so the spectral shape of a sinusoid takes on the
inherent shape and frequency distribution of the windows frequency domain
representation.
The power of a windowed sinusoid is typically lumped into a large main lobe and
distributed into surrounding side lobes that are linked together in a fundamental tradeoff
balancing the bandwidth of the main lobe and the maximum side lobe level. Decreasing
the side-lobes for higher dynamic range increases the main lobe bandwidth, causing
lower frequency resolution because the lobe can mask signals in adjacent frequencies. In
the spectra of Figure 7, two different windowing functions are applied to two-tone data
to illustrate this tradeoff. Applying the Hamming window gives sufficient distinction
between the two frequency tones but results in poor side lobe suppression whereas
applying the Blackman-Harris window fuses the two-tone power into one block but gives
very low side lobes levels.
Figure 7: Dynamic range and frequency resolution comparison between the
Hamming and Blackman-Harris windows
The harsh reality is that the analysis of non-coherent frequency data from a high
dynamic range ADC requires a windowing function that keeps the windows side lobe
signature below the noise power density of the ADC. This prevents the distinction
between signals whose frequencies are very close.
The profiles of four common windows are shown in Figure 8 demonstrating their
varying main lobe widths and side lobe levels. Given the case of a high speed 16-bit
ADC the SNR may be as good as 78 dBFS (dB relative to full scale). If a ~32k sample
data set is the largest set that can be accommodated by data acquisition hardware, then
the noise power density of the DFT spectrum will be near -120 dBFS/bin. The side lobe
levels of the four presented windows are no better than -100 dB so these windows cannot
be applied to the ADC data of this example while guaranteeing accurate results across all
input frequencies.
(a) (b)
Figure 9: Scalloping loss of windowing functions
When applying a windowing function to a data set, care must be taken to properly
scale the window so that the total power of the data is conserved. This will ensure that the
correct fundamental power and noise power is calculated. For this to occur, the
incoherent gain, see [2], of the window is scaled to unity.
Another import gain factor is the processing gain. It can be easily visualized as
the change in the peak amplitude of a coherent sinusoidal signal in the frequency domain
when a windowing function is applied to the data. Without a windowing function, the
coherent signal will appear as a single-frequency tone with amplitude Asig. After the
window is applied, the signal will appear as a main lobe with a maximum value of
Asig/PGw where PGw is the processing gain. This reduction of the main lobe maximum
conserves power by compensating for the fact that the signal power spans a wider
bandwidth. More details including the importance of these gain quantities will be covered
in the second installment of this article.
Conclusion
References
[1] E. W. Kamen and B. S. Heck, Fundamentals of Signal and Systems, Prentice
Hall, Upper Saddle River, NJ, 2000.
[2] F. J. Harris, On the Use of Windows for Harmonic Analysis with the Discrete
Fourier Transform, Proceedings of the IEEE, vol. 66, pp. 51-83, Jan. 1978.