Why use an FFT? The list of answers is almost as long as the one for "Why use a scope?" Measuring distortion is a classic example, whether it's at 50/60 Hz, audio, or RF frequency. Perhaps you want to see the spectral characteristics of some noise, or maybe the occupied spectrum of a serial data signal.
As an aside, the first real FFT equipment I got my own hands on was a lovely HP dedicated audio signal analyser in the mid-1980s.
Figure 1. The HP 3561A Dynamic Signal Analyser.
Unfortunately, this spoiled me in terms of UI and functionality, and I've yet to meet a scope that comes close. Factoid: This instrument used bubble memory to store setups and data (think hard disc on a chip).
Reviewing the utter basics: An FFT takes a signal in the time domain and converts it (transforms it, you might say) to the frequency domain. A 60 Hz sinewave (time domain) transforms to a spike at 60 Hz (frequency domain). If there are spikes at 120 Hz, 180 Hz, and so on, then you know there's distortion.
And reviewing our basic waveshapes: A square wave has only odd harmonics, falling off at 1/N. A triangle has only odd harmonics, falling off at 1/N2. A ramp has all harmonics, at 1/N. A pulse-train can have missing harmonics. For example, a 10% duty-cycle pulse will lack the 10th, 20th, 30th harmonics, and so on.
OK, we want to look at the FFT of a signal on our scope. What parameters will sculpt the view? There's:
- Record size
- Ratio of signal period to record time
- Windowing function
Record size is limited by the scope's buffer size – and your patience. Well, patience is becoming less of an issue, because a modern scope can churn out million-point FFTs in the blink of an eye. The main effect of record size is on frequency resolution. For example, an 8k record FFT will generate 4k frequency bins (it's always half). FFTs always start at 0 Hz, so if the frequency span is 20 kHz, our resolution is 20k/4k = 5 Hz. That's pretty good on a linear scale, but if you prefer to view your frequency axis logarithmically, and you don't want the low end to be too coarse, more points may be called for.
The ratio of signal period to record time determines where on the X-axis frequency scale the signal components appear. If you time things such that exactly one cycle fills the FFT's input record, its fundamental spectral line will be in the second bin (the first being DC). Any harmonics in the signal will fill up successive bins. It might seem neat and tidy, but it is not usually possible.
First off, in the real world, it's virtually impossible to get exactly one cycle in the buffer. Let's say you get 1.01 cycles. This will cause every spectral line to be smeared into its neighbours. It's usable but messy. You're much better off capturing perhaps 10 cycles or 100 (depending on the FFT size and the signal's harmonic content). All the spectral lines will be moved up and spread out. That's much better.
I mentioned frequency span, but not in the parameter list. That's because it's a secondary value. Span simply equals half the sampling rate. Therefore, we can redefine frequency resolution as the sampling rate divided by FFT size.
In normal scope operation, there is usually some interaction between sampling rate, sweep speed, and record size. If the FFT UI isn't well thought out, these interactions can drive one to drink (or worse), as you adjust controls and find your careful FFT settings ruined by a well-meaning turn of a knob. If the FFT is something you'll be using a lot on a new scope, make sure to try before you buy.
The last item under our control is the window function. "What nonsense is this?" you ask. It's an unfortunate necessity in dealing with real-world signals, and it's actually pretty ingenious.
The Fourier transform, regardless of flavour, assumes a continuous signal over infinite time. Discrete versions of the transform still adhere to this rule – it's assumed the finite waveform record repeats infinitely. So, imagine multiple records spliced together: The end of the record must splice smoothly to the beginning of the next – identical – record (recall the previous talk about fitting exactly one cycle in your FFT input). If we could do this – feed a perfectly integral number of cycles to the FFT – all would be simple (and this also assumes we're only interested in analysing harmonically related signals).
But we both know it ain't gonna work out that way. The inevitable glitch at the join point between the end and start of the record will cause a whole slew of nasty faux harmonics to appear. Try it. That's where the window function comes in.
Figure 2. A von Hann, or Hanning, window.
The window above is a commonly used one, and its basic shape is typical. This curve is aligned with the captured record, and is used to scale each point by the curve value at that X-position. The resulting record looks like a tone burst, and as the record is assumed to repeat infinitely, the FFT performs its magic on, in effect, this repeating tone burst. "And that's better!?" you exclaim.
next; yes, it is better....