Information about FFT in Spectrum Lab
This chapter provides additional 'background' information, which is not necessary if you just want to use SpecLab. But it it's interesting for you to know how it works, and what the important FFT parameters actually do, then read on. Please don't expect a mathmatical explanation here, there are nice textbooks out there... ;-)
See also: Spectrum Lab's main index .
FFT means "Fast Fourier Transform". This is a clever algorithm which can be used to transform a signal from the time domain into the frequency domain.
From a less mathematical viewpoint, it can calculate the spectrum from a
block of audio samples. Imagine you have an analog/digital converter which
produces 11025 digital samples per second. To do the FFT, we need a block
of samples, say 8192 samples from the ADC (if you want to know why the blocksize
is always a power of two..see appendix).
From the 8192 samples the FFT makes an array of 4096 "frequency bins". Each frequency bin collects the energy / amplitude from a small frequency range. For our example, the bin width is (with a single exception) 11025 Hz / 8192 = 1.35 Hz wide. The last bin contains the amplitude of the highest detectable frequency, which is 5512.5 Hz (this is also dictated by Shannon's Law by the way).
To collect the 8192 samples from the ADC, we must wait for 8192 * (1/11025) seconds, which is 0.743 seconds (=1/1.35Hz).
(for the spectrogram display)
The higher frequency resolution, the higher the FFT blocksize must be, and the longer it takes to collect enough samples. An extreme example: For a frequency resolution of 5 Millihertz (mHz), we need 32*65536 samples at a 11025 Hz rate, and it will take more than 3 minutes to collect then (Spectrum Lab does not really calculate a "monster-FFT" with 32*65536 samples, it uses a decimation process instead, .. that's another story but the effect is the same).
To have a reasonably high screen update even with higher frequency resolution, a trick can be done: For the next screen update, we don't wait until we have collected enough samples to calculate a "completely new" FFT. Instead, we may use 75 % of "old" and only 25 % of "new" samples to speed things up. But: This must not be pushed to the limit, otherwise the waterfall display will look smeared, because it still takes 3 minutes (for the 5mHz-example) until the old input data have been completely replaced by new data in the FFT input buffer. Apart from the smearing effect, using too high FFT length can make the detection of short pulses impossible. A 1-second dot in a Spectrum which has been calculated from 3 minutes input data will be almost invisible, and its peak amplitude cannot be measured from the FFT output data.
For extreme frequency resolutions, very "long" FFTs are required (and, btw, a stabilized oscillator in the soundcard or SDR). For example, an FFT with 40 uHz (microhertz) bin with will require about 7 hours of data acquisition, until the first 'complete' FFT can be calculated and displayed on the screen. To eliminate the need to wait for seven hours until 'something gets visible', the FFT input data can be padded with zeroes if not enough data are available yet (use the "zero-pad" option in the FFT configuration dialog). The spectrogram below shows the effect of zero-padding :
The lower part of the spectrum shows a 'very broad' signal on 77.5 kHz, caused by the zero padding. The upper part of the spectrum shows the *SAME SIGNAL* (DCF77) after one hour of data acquisition, when about 14 percent of the FFT input buffer was filled. It would have taken another six hours until the full frequency resolution ( 40 uHz ) would have been reached. Of course, this level of FFT resolution can only be reached if the A/D converter's clock frequency is sufficiently stable (the screenshot was made with an SDR-IQ with a modified, temperature-stabilized clock oscillator, tied to DCF77 as the frequency reference).
Since November 2003, the FFT is not only used in SpecLab's spectrum display, but also for a special audio filter which uses the FFT and the inverse FFT to realize very long FIR filters. How to use the FFT-based filters in SpecLab can be found here.
The IFFT (inverse FFT) which is mentioned in the description of the audio filter transforms a signal in the frequency domain (a "spectrum") back into the time domain. By principle, the IFFT is almost the same algorithm as the FFT - in fact, the FFT code is called as a subroutine from the IFFT code. If you are interested in this subject, follow the links to literature about digital signal processing (look for "The Scientist and Engineer's Guide to Digital Signal Processing", this book can hopefully still be downloaded for free in PDF format).
See also: Spectrum Lab's FFT settings (for the spectrum analyzer), main index .
back to top