Fast Fourier Transform (FFT) Frequency Analysis

An oscilloscope provides powerful capability to debug frequency-related effects. Fast Fourier Transform (FFT) math functions have long been part of oscilloscope toolboxes. This tutorial is intended to give a basic understanding of setting up and using FFT based spectrum analysis.

Equipment Required

WaveRunner Zi series Oscilloscope
10:1 High impedance passive probe.

Initial Setup

Displays shown in the tutorial are based on the following initial setup on a WaveRunner 6 Zi scope:

  1. Connect the passive probe from the channel 1 input to the Cal test point on the front panel of the oscilloscope.
  2. Recall the default setup: File pull down > Recall Setup> Recall Default.
  3. Turn off channel 2.
  4. Auto Setup the scope: Press Scope Setup, then select Auto Setup from the fly-out menu.

This completes the initial setup. The scope display should be similar to Figure 1.

Figure 1:

The initial setup for this tutorial, the input signal is the 1 kHz calibrator square wave

Open the Timebase dialog box by using the Timebase pulldown menu and selecting Horizontal Setup or touching or clicking on the Timebase annotation box. Change the Real-Time Memory Maximum Sample points to 50 kS and the Timebase mode Time /Division to 20 ms as shown in Figure 2. We are now acquiring 50,000 points at 250kS/s for a total record length of 200 ms.

Figure 2:

The timebase acquisition setup to capture a 200 ms record length

Use the Math pulldown menu to open the Math dialog box. Select the F1 tab and setup the F1 math trace to be the FFT of C1 as shown in Figure 3.

Figure 3:

The basic FFT setup in math trace F1

Looking at the right hand FFT tab in Figure 3 we have all the FFT setup controls. These include the output type, Algorithm, and Window.

The selections available under output type are shown in Figure 4. The FFT computation is complex in a mathematical sense and its native output type consists of Real and Imaginary components. These outputs are linear with units of Volts.

Figure 4:

The Output Type selections

Magnitude is the amplitude output in linear units (Volts). This reads the peak value of a sine at each frequency. This is useful as an input to math operations like adding and subtracting spectra.

Mag(nitude) Squared is the square of magnitude (power) in Squared vertical units (V^2). This is useful if you need to integrate the spectrum as a function of frequency.

Power Spectrum (default output type) is the power as a function of frequency using a logarithmic amplitude scale in units of decibels relative to 1 mW (dBm). This is a good general purpose view offering wide dynamic range so that you can see small spectral details.

Power Spectral Density is the power per unit frequency (power spectrum divided by the equivalent noise bandwidth of the FFT) the vertical scaling is also logarithmic with units of dBm. This view provides spectrum amplitude measurements that do not vary with the resolution bandwidth of the FFT as they are normalized to the bandwidth.

Phase is the phase TAN-1 (Imaginary/Real) and represents the phase of the FFT at each frequency.

Cycle through all the output types and see how it affects the vertical scaling and units as reported in the F1 trace annotation box. Restore the output type to Power Spectrum.

Algorithm Selection

The Algorithm selection offers two choices shown in Figure 5. The default algorithm is Power of 2. This provides a faster computation of the FFT. Since the oscilloscope timebases are usually multiples of 1, 2, or 5 using the Power of 2 algorithm results in using only the first half of the acquisition. The Least Prime Algorithm uses the full acquisition at the price of a slightly slower computation.

Figure 5:

FFT algorithm selections

Look at the FFT status summary on the right hand dialog of the F1 math tab as shown in Figure 6. This provides a summary of the FFT transform size and resolution bandwidth.

Figure 6:

The FFT status summary for the power of 2 algorithm

Select the Power of 2 algorithm. It only uses 32768 points (nearest power of two below 50,000) as a transform size of the original 50,000 point acquisition. The resolution bandwidth (Δf), the size of the frequency steps in the spectrum, is 8Hz. Beneath the resolution bandwidth is the FFT Span, from Δf (8 Hz) to 125 kHz.

Select the Least Prime algorithm and review the FFT summary status as shown in Figure 7. Notice that the Transform size is now using the full 50,000 point acquisition. Because it is using a longer record length the resolution bandwidth (Δf) has been reduced to 5 Hz.

Figure 7:

The FFT status summary for the Least Prime algorithm

How FFT Resolution Bandwidth and Span are Determined

As we have seen in the previous section, the resolution bandwidth of the FFT is dependent on the acquisition or record length. Resolution bandwidth is the reciprocal of the acquisition or capture time of the scope. The example in Figure 7 has acquired 200 ms of data (20 ms/division times 10 divisions). The resulting resolution bandwidth is 1/200ms or 5 Hz.

The span or the total range of frequencies in the FFT spectrum is one half of the oscilloscopes sample rate. In our setup the sample rate is 250kS/s so the span is 125 kHz.

Open the timebase dialog box by touching or clicking on the timebase annotation box. Increase the Time/Division setting from 20 ms/division to 50 ms/ division. The sample rate will decrease to 100kS/s. Go back to the F1 Setup FFT tab. Note that the span is now 50 kHz; again, one half of the sample rate. The resolution bandwidth has decreased from 5 Hz to 2 Hz because the capture time increased to 500 ms (1/500 ms = 2 Hz).

Restore the Time/division setting to 20 ms. Turn off the channel 1 display by pressing the button marked 1 in the vertical control group on the front panel. Restore the FFT algorithm selection to Power of 2.

Using the Zoom Tab to Set Displayed Center Frequency and Horizontal Scale

The FFT span, as we discussed previously, is one half of the scopes sample rate. You can use the zoom setting of the math trace to select a center frequency and horizontal scale for the FFT display. Touch or click on the F1 dialog box Zoom tab. We are going to view the spectral line at 1 kHz.

Touch or click on the Center Frequency box in the Horizontal zoom area twice. This will bring up a pop up keypad. Enter the desired center frequency of 1 kHz then press OK.

Touch or click on the Scale/Div box twice. This will again bring up a pop up keypad. Enter the value 200 (Hz) then press OK. The FFT display should now have a horizontal scale of 200 Hz per division centered at 1 kHz.

In the Vertical zoom area check the Var(iable) check box this will allow us to set a scale outside of the normal 1-2- 5 progression. Touch or click on the Vertical Scale/div box, enter the value 12 to set the vertical scale to 12 dB/div. Touch or click on the Vertical Center box, it will be highlighted in inverse video. Use the WavePilot SuperKnob (or alternatively the Vertical offset knob on the front panel)to move the FFT display vertically until the spectral peak is just below the top of the display as shown in Figure 8.

Figure 8:

Using the Zoom tab on the F1 Math dialog box to set center frequency and span of the FFT display

We have just used the math zoom controls to set up both the vertical and horizontal center and scale settings. Using this technique it is possible to display any part of the FFT spectrum on the screen.

Weighting Window Selection

The Fourier transform calculation assumes that the input signal is infinite in length. Obviously, oscilloscopes have a finite record length. The result of using a finite length input to a Fourier transform is to generate sidebands close to the signal frequencies. These sidebands manifest themselves as broader “skirts’. Return to the FFT tab on the F1 dialog box. Touch or click the Window box. A pop up will show the available weighting window selections as shown in Figure 9. There are five window selections Rectangular, Hamming, Von Hann (Hanning), Blackman Harris, and Flat Top. Select Rectangular.

Figure 9:

The Weighting Window Choices

The rectangular window applies no weighting, but presents the finite record acquired in the oscilloscope to the FFT. You can think of this as an infinite input record weighted by a unity amplitude rectangular pulse with a duration equal to the scope’s acquisition time (hence the name Rectangular). The FFT spectrum should now exhibit broad skirts extending out about 800 Hz on each side of the 1 kHz fundamental frequency as shown in Figure 10.

Figure 10:

Applying Rectangular weighting to the FFT spectrum

The other windows apply a variety of raised sinusoidal windows to the signal input of the FFT. In Figure 11 we have overlaid the spectral response for each of the available windows with a horizontal scale of 20 Hz/division. Note that the effect of the weighting function is to reduce the sideband levels but at the same time they tend to broaden the main spectral line. This broadening is indicated by an increase in the effective noise bandwidth (ENBW) indicated in the FFT status.

Figure 11:

The effects of the weighting Windows on the spectral response

Step through each window and note the response. As you step through note the ENBW on the FFT tab and see that the value is proportional to the broadening of the window.

In general Rectangular weighting is used for transient signals that can occur anywhere in the acquisition. This is because the weighting is uniform over the acquired record.

Hamming and Vonn Hann weighting are good general purpose windows with good sidelobe suppression and nominal broadening.

The broader response of the Blackman Harris and Flat Top weighting are excellent for frequency domain measurements requiring the highest amplitude flatness.

Complete details of the window characteristics can be found in the oscilloscopes on-line help under FFT.

Return the FFT window setting to Vonn Hann and reset the zoom (Zoom tab > Reset Zoom).

FFT Spectrum Averaging

Oscilloscopes can also average the FFT spectrum as well as time domain waveforms. Spectral averaging is synchronous with the FFT processing and forms an ensemble average where each frequency point in the FFT is averaged with the corresponding point in subsequent FFT’s.

Averaging improves the signal to noise ratio of the spectrum and can increase the dynamic range of the averaged FFT to about 72 dB for an eight bit oscilloscope. As in all averaging processes this improvement is proportional to the number of spectra averaged.

Go to the F1 math dialog box. Press the button marked dual to enable a second math operator in trace F1. Click or touch the Operator 2 box. Select Average from the pop up scroll list. On the right hand side the Average tab will appear. Open the average tab. Press the button labeled Continuous and set the number of averages to 10. The scope screen should appear like that in Figure 12. Note the thickness of the baseline.

Figure 12:

Setting up spectrum averaging

Increase the number of averages from 10 to 100. The average will restart, after 100 sweeps have been averaged note that the thickness of the baseline has decreased.

Increase the number averages to 1000, there should be an additional decrease in the baseline noise. Averaging improves the signal to noise ratio of the FFT.

There are two types of averaging Summation and Continuous. Summation averaging will average spectra until the preset number of spectra are included in the average and then will stop. Continuous mode will average continually by maintaining a moving window in which the newer spectra more heavily weighted than the older data. Either mode works the same way in that the greater the number of averages the greater the signal to noise improvement.

Note the Skip Invalid Input check box on the average tab. If this box is checked the average will not include any spectra which are not valid due to overloading the scope input.

Odds and Ends

Click on the FFT tab. Note the two buttons labeled Trunc(ate) and Zero Fill. These buttons are only used if the signal input to the FFT is shorter than expected. This can happen if the data source has been filtered (as with the channel noise filter or by using the digital filter package (DFP2) option). Digital filtering removes samples from the signal (points where the filter output is not valid). The FFT needs a fixed number of samples so these two buttons tell the FFT what to do if the record is short of samples.

If Truncated is pushed the FFT will shorten the FFT to the next lower standard record length.

If Zero Fill is selected the FFT will add the missing points by doing a weighted fill (the first and last point amplitudes of the input are determined and the missing points are added with amplitudes arranged to produce a continuous transition).

The Suppress DC check box determines if the FFT computes the DC point in the FFT. The default is not to compute the DC point. The user can elect to add the DC point by un-checking this box.

Complete and detailed information about the Fast Fourier Transform are available in the oscilloscope’s on-line help.

Additional information can be found in the following LeCroy Application briefs available on the LeCroy Website;

“Setting Up An FFT In WaveMaster” LAB WM 714

http://cdn.lecroy.com/files/appnotes/setting_up_an_fft_in_wavemaster.pdf

“Using Long Fast Fourier Transforms” LAB 773

http://cdn.lecroy.com/files/appnotes/using_long_fast_fourier_transforms.pdf

This completes the tutorial.