Spectral Leakage in The Discrete Fourier Transform: Greg Adams, LMCO MS2, 4/10/07
Spectral Leakage in The Discrete Fourier Transform: Greg Adams, LMCO MS2, 4/10/07
If the test signal is slightly off frequency, i.e. the input signal doesn’t complete a
whole number of cycles within the DFT time window, A distortion called
spectral leakage occurs. A small frequency error has little effect on the
main signal, but has a strong effect on the DFT noise floor.
The relationship between frequency error, and the signal to noise ratio due to
leakage noise has been established. This relationship can be used to determine
the frequency resolution which the sine wave generator must have in order to
generate a sine wave at a sufficiently accurate frequency. A simple calculator
program is provided to evaluate the equations.
-50
-100
5
-150 3 2
4
0 5 10 15 20 25 30 35 40
Frequency in MHz
-50
-100
-150 3 4 2 5
0 5 10 15 20 25 30 35 40
Frequency in MHz
4
FFT, 0.1 Hz offset
Unwindowed data
0
Signal amplitude in dBFS
-50
-100
3 2
-150 5
4
0 5 10 15 20 25 30 35 40
Frequency in MHz
5
FFT, 1 Hz offset
Unwindowed data
0
Signal amplitude in dBFS
-50
-100
3 4 2 5
-150
0 5 10 15 20 25 30 35 40
Frequency in MHz
6
FFT, 10 Hz offset
Unwindowed data
0
Signal amplitude in dBFS
-50
-100
4 2 5
3
-150
0 5 10 15 20 25 30 35 40
Frequency in MHz
7
FFT, 100 Hz offset
Unwindowed data
0
Signal amplitude in dBFS
-50
-100 4 2 5
3
-150
0 5 10 15 20 25 30 35 40
Frequency in MHz
8
FFT, 1000 Hz offset
Unwindowed data
0
Signal amplitude in dBFS
-50
4 2 5
3
-100
-150
0 5 10 15 20 25 30 35 40
Frequency in MHz
9
Time Discontinuity
One way of looking at
the leakage problem is
to observe the
requirement that the
Fourier Series operate
on a periodic data set.
If the off-frequency
sinusoid is repeated to
generate a periodic
signal as shown, there
is a discontinuity in
the waveform.
Where:
1
Cn
2 f (t ) exp(i n t ) _ dt i 1
The Fourier Series may be used to express any periodic function of TIME as the
sum of Sine and Cosine functions of TIME. (expressed here in complex exponential form)
Note that the coefficients Cn are derived by Correlating f(t) with the
Discrete frequency sinusoids sin(nt) and cos(nt).
The condition that f(t) be Periodic insures that it can be represented as a sum of
Discrete sine and cosine functions. (whether Laurent believed it or not! ) 11
The Fourier Series (2)
A Fourier series may be used, for example, to show that
a square wave is the sum of a sine wave, and all of it’s
odd harmonics.
12
The Fourier Series (3)
While the independent variable may be something other than time, and the
Series may break the function down in terms of any complete set of
Orthogonal functions, this discussion will assume a function of time,
Broken down into a sum of circular functions (of time).
13
The Fourier Transform
F ( ) [ f (t )] f (t ) exp(i t )dt
The Fourier Transform is an extension of the Fourier Series. Whereas the Fourier Series was
restricted to periodic functions of (t), the Transform may be applied functions which are
aperiodic.
While the Fourier SERIES resulted in an infinite series of discrete frequencies, the
TRANSFORM, F() is a continuous function of frequency, defined for all real
values of frequency.
A continuous
function of frequency
14
A table of Fourier Transforms
15
The Discrete Fourier Transform
N 1
2 n k
F ( n) f (k ) exp i
k 0 N
X =
From the table above, we see that the DFT has more in common with the Fourier Series
than the Transform. The DFT and the Fourier Series both have a finite time interval of
integration, and therefore yield discrete frequency samples. The DFT alone uses discrete
time samples, and is therefore limited to a finite frequency interval as well.
20
Equivalence of DFT and Fourier Series
The Integrated Leakage Noise is defined as the sum of the noise powers, at
all frequencies other than the desired one, which result from the frequency
error.
21
Notation
The traditional notation used for the DFT is incompatible with the traditional notation
used for the Fourier Series. We’ll be using the following harmonized notation:
t= time, seconds
f(t)= function of time, the input function
N= Number of time samples used
k= index of the k’th time sample
n= Harmonic index, e.g. the n’th frequency bin.
Cn=Coefficient of the n’th harmonic, Fourier Series
Cs= Coefficient of the n’th sideband, Fourier Series
F(n)=DFT of f(k)
fa= analog signal frequency, Hz
fs= sample rate, Hz
m= number or whole sine waves sampled
S= sideband number
P= integrated noise power
P(t)= ‘Picket fence’ function
22
Notation (cont.)
F ( ) Fourier Transform of f(t)
Radian Frequency
Frequency Error, as a fraction of on frequency BIN
(x) Dirac's delta function
( p) The Riemann zeta function of p
23
Fourier Series, with frequency error
fa N
m Frequency Error, as a fraction of
fs The frequency resolution.
Sinusoid with
f (t ) exp[i ( f t )] exp[i (m )t ] frequency error
1
Cn
2 exp[i(m )t ] exp[i(n t )]dt
24
Evaluate the integral
1
Cn
2 exp[i(m n )t ]dt
1
Cs
2 exp[i(S )t ]dt
1
Cs exp[i ( s )t ]
2 ( s )i
Indefinite integral evaluated
25
The arithmetic
1
Cs [cos(s ) i sin( s ) ] [cos ( s ) i sin ( s ) ]
2 ( s )i
1
Cs [cos(s ) i sin(s ) cos(s ) i sin(s ) ]
2 ( s )i
i
Cs 2 i sin( s )
2 ( s )
i i
for small delta, and 2 i sin( s ) i 2
2 ( s ) 2 ( s )
i 2
Cs i 2
2S 2S
Cs
S
We now have an approximation to Cs, the noise amplitude in each sideband. 26
Summing the Sidebands
The noise power in each sideband is proportional to Cs^2.
There are infinitely many sidebands above and below the “carrier”.
The sidebands which fall outside the normal frequency range alias
back into the output spectrum, so we must sum Cs^2 for all S not zero,
from positive to negative infinity. Since Cs^2=(-Cs)^2, we can
Just sum from 1 to positive infinity, and multiply by two.
2
1
1
P 2 2 2 But 2 ( 2)
2
S 1 S S 1 S S 1 S 6
The above sum is equal to the Riemann Zeta function of 2, which Euler solved
Explicitly in 1736.
2
2
1
2 2 2 (2) 2
2 2
S 1 S 6 27
Signal to Noise Ratio
2
SNRdB 10 log 2 2
10
6
If some sidebands are to be omitted in the calculation of SNR, which is often the
case, we may use the expression:
2 d 1
For sidebands
SNRdB 10 log 2 2 2
10 1 through d
6 S 1 S
removed
N f
f In same units as fS
fS 28
Testing the theory
The Leakage Noise was estimated using the formula from the previous page,
for a signal sampled at 80MSPS, with frequency offset errors ranging from
0.01 to 1000 Hz. The FFT frequency resolution will be 2441.40625 Hz.
A sinusoid was generated by software. The resulting sine wave was truncated
to 16 bit resolution. This signal’s frequency was varied over the same range
of frequency offsets.
A 32756 point FFT was performed on both the computer generated signal, and
the signal sampled by the analog to digital converter. The resulting signal to
noise ratios are tabulated below.
29
Results
Frequency Calculated SNR FFT on FFT on real
synthetic data data from ADC
Error, Hz
0 - 97.08 n/a
.01 110.21 96.88 79.29
not measured
.1 90.21 89.37
1 70.21 70.20 69.60
10 50.21 50.20 50.19
100 30.21 30.21 30.21
1000 10.21 10.15 10.15
FFT Bin size = 2441 Hz, nearest three sidebands removed.
fs=80e6, N=32768, signal freq = 24 MHz
At .01 Hz error, the real data shows ADC thermal noise. 30
Results cont.
The computer generated data had a signal to noise ratio of 97.08 dB. The noise on
the signal results from truncating the data to 16 bits.
The Analog to digital converter had a noise floor of 79.29 dB. The noise on this
signal is thermal noise from the analog input circuit.
When the leakage noise, as predicted in the first column, is well below the process
noise, the FFT provides an accurate measure of process noise.
When the leakage noise is significant compared with the process noise, the
noise measured by the FFT is the sum of the process and leakage noise.
31