Spectral Flatness

Spectral flatness is a way to quantify the deviation of a passband from being perfectly flat across the frequency spectrum. Like most specifications, the behavior of signals measured in the passband is not ideal and we want to quantify the deviation from the ideal case.

An ideal DAQ is one that passes all frequencies equally while rejecting frequencies above the Nyquist frequency (half of the sampling rate). The exception is when the input mode is set to AC coupling, which puts a capacitor in series between the input signal and A/D converter to create a high-pass filter. The cutoff frequency of the AC coupling high-pass filter also affects flatness in the passband, but in a predictable way (and optional, because it can be switched on or off).

The primary circuit that contributes to the lack of spectral flatness is the analog anti-aliasing filter. With a delta-sigma A/D converter, which has a 1-bit resolution at a very high sampling rate, it is possible to achieve sufficient attenuation with just a first-order analog anti-alias filter. Other types of converters generally would require higher order filters at lower cutoff frequencies to avoid aliasing in the passband. Our anti-alias filter is designed to have a cutoff around 500 kHz, and the cutoff frequency for a first order filter is where the attenuation is 3 dB (the circle on the curve in Figure 1). After the cutoff, the attenuation increases by 20 dB per decade (x10), or 6 dB per octave (x2).

Figure 1: Typical curve of a first-order analog anti-alias filter

Figure 1: Typical curve of a first-order analog anti-alias filter

Even though the cutoff is at 500 kHz, it is not perfectly flat up to this frequency. Some attenuation occurs at lower frequencies, which is one reason to make the cutoff frequency higher, but if the cutoff is too high, there will be aliasing. The zoomed-in frequency response (Figure 2) shows approximately 0.1 dB of attenuation at 100 kHz. Note that the circle on this plot is not in the same location as the first plot.

Figure 2: Zoomed-in plot to show attenuation at 100 kHz

Figure 2: Zoomed-in plot to show attenuation at 100 kHz

The other advantage of having a high frequency, first order AAF is that the phase shift caused by the AAF is minimized in the passband. The cutoff frequency of a first order filter is where the magnitude has decreased by 3 dB and the phase shift is 45 degrees. This is the main reason why the phase match on our DAQ’s is as good as it is, although other factors like clock synchronization also play a role in phase match.

Depending on the testing procedure, a passband can that is otherwise flat can appear to have ripple due to window effects or due to the type of signal, which is usually a chirp or swept sine. Ripple that is caused by testing parameters is different than ripple caused by certain types of anti-alias filters. This procedure is not designed to eliminate the ripple from anti-alias filters that is inherent in Elliptic or Chebyshev lowpass filters, but our anti-alias filters are designed using a Butterworth lowpass filter, so this type of ripple is not present.

Eliminating the ripple due to testing parameters can be achieved by using a discrete swept sine (not a continuous variation in frequency) such that the frequencies generated only correspond to exact bins in the analyzer’s frequency spectrum, which depends on the sampling rate and block size of the analyzer.

The discrete swept sine will then increase according to the frequency resolution that is calculated in a typical spectrum: frequency resolution = sample rate/block size, so for a sample rate of 256 kHz and a block size of 1024, the generator’s frequencies will be set to 250 Hz, 500 Hz, 750 Hz, and so on. Each frequency from the generator is output for 1 second to ensure enough cycles are measured at the analyzer. The Peak Hold Average mode is used with the APS signal type in EDM, which will create a spectrum that retains the peak amplitude at each frequency throughout the duration of the test.

The testing procedure uses a Koolertron 15 MHz signal generator. This generator a has very good passband characteristics, mainly because it was designed for generating very high frequencies, which means the reconstruction (lowpass) filters following the DAC are designed to be higher than the highest frequency it can generate.

The flatness of the source can be checked with a multimeter – the RMS value at 100 kHz is 0.11 dB lower than the RMS value at 1 kHz. Although it cannot be determined whether the source or the multimeter is responsible for the attenuation, this is sufficient to make a comparison as long as the attenuation is not very large. Ultimately, measurements using a single generator and analyzer cannot be completely separated from each other, but it is possible to establish upper and lower bounds, which is discussed more at the end of this article.

The following diagram shows the hardware setup between the generator and the Spider-80X, which was the unit under test whose spectral flatness was measured. The two are connected with a standard BNC cable.

The following screenshot is an APS signal, taken from EDM, after conducting the test on a Spider-80X at 256 kHz sampling rate and 1024 block size, which gives a frequency spacing of 250 Hz. No window is perfectly flat in the frequency domain, but the uniform window does not create leakage between bins like the Flattop window, so the uniform window is used. The Average Mode is set to Peak Hold, which maintains the largest amplitude measured, and the Average Number is set to zero, which allows for an unlimited number of frames to be used.

Spectral flatness.png

Even though the signal is displayed in the auto-power spectral format, it is not computed using the conventional FFT Auto Power spectrum method. It is created by synthesizing 450 points of discrete peak values of auto-power spectra. Each peak value is generated when the signal source has a precise frequency at the bins that are integer multiples of 250 Hz. The auto-power spectrum of each computation will take a few seconds to finish. Therefore, it will take roughly 30 minutes to generate this particular spectrum plot. Fortunately, this computation process is fully automated using the computer program.

The markers on the screenshot show an attenuation of 0.17 dB at 100 kHz relative to 1 kHz. Although the measurement of flatness between the Koolertron and the multimeter showed 0.11 dB of attenuation, it is possible that either the source or the multimeter is solely responsible, or some combination.

We can establish an upper and lower bound by looking at each of the extreme cases – if the multimeter is the only cause of attenuation, the source is perfectly flat, which means the attenuation shown in the Spider’s APS measurement is only due to the Spider. On the other hand, if the multimeter is perfectly flat, the source has 0.11 dB of attenuation at 100 kHz, and that means the Spider’s attenuation at 100 kHz is 0.17-0.11 = 0.06 dB. Therefore, we can conclude the Spider’s attenuation at 100 kHz is between 0.06 dB and 0.17 dB.