0% found this document useful (0 votes)
25 views

Spectral Leakage in The Discrete Fourier Transform: Greg Adams, LMCO MS2, 4/10/07

Spectral leakage occurs in the discrete Fourier transform (DFT) when the test signal frequency does not complete an exact number of cycles within the DFT time window. A small frequency error has little effect on the main signal but has a strong effect on the DFT noise floor. As the frequency error increases, the signal-to-noise ratio decreases according to an established relationship that can be used to determine the required frequency resolution of the signal generator. Examples are shown comparing DFT results from a test signal with 0 Hz, 0.01 Hz, 0.1 Hz, and 1 Hz frequency errors.

Uploaded by

nctgayaranga
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Spectral Leakage in The Discrete Fourier Transform: Greg Adams, LMCO MS2, 4/10/07

Spectral leakage occurs in the discrete Fourier transform (DFT) when the test signal frequency does not complete an exact number of cycles within the DFT time window. A small frequency error has little effect on the main signal but has a strong effect on the DFT noise floor. As the frequency error increases, the signal-to-noise ratio decreases according to an established relationship that can be used to determine the required frequency resolution of the signal generator. Examples are shown comparing DFT results from a test signal with 0 Hz, 0.01 Hz, 0.1 Hz, and 1 Hz frequency errors.

Uploaded by

nctgayaranga
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

Spectral Leakage in the Discrete Fourier Transform

Greg Adams, LMCO MS2, 4/10/07


1
Spectral Leakage in the Discrete Fourier Transform
Synchronous Sampling is typically used with a Discrete Fourier Transform
when testing analog to digital converters in the laboratory. A pure sine wave
test signal is generated at such a frequency that the input signal goes through a
whole number of cycles during the sampling period.

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.

LMCO NE&SS SS Math & Physics Seminar


16 April 2003 Greg Adams, 856 722 4705 2
http://www.motown.lmco.com/~gadams/
FFT, On Frequency
Unwindowed data
0
Signal amplitude in dBFS

-50

-100

5
-150 3 2
4
0 5 10 15 20 25 30 35 40
Frequency in MHz

Risk Reduction ADC test


Signal Level (dBFs) -1.004
SNR(dB) (Ignoring Harmonics)= 97.0809
Noise Only (dBFs) = -98.0849
Signal to Noise and Harmonic Ratio(dB) = 97.0806
Noise & Harmonics (dBFs) = -98.0846
Effective Number of Bits 16.0008
DC Offset, Counts -3578.2502
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -121.303
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 0.28887
Harmonic Power in dBFS 2,3,4,5th Harms=
-148.9824 -146.4321 -162.1588 -140.6946
REAL DATA

fs=80e6, N=32768, signal freq = 24 MHz, FFT Bin size = 2441 Hz 3


FFT, .01 Hz offset
Unwindowed data
0
Signal amplitude in dBFS

-50

-100

-150 3 4 2 5

0 5 10 15 20 25 30 35 40
Frequency in MHz

Risk Reduction ADC test


Signal Level (dBFs) -1.004
SNR(dB) (Ignoring Harmonics)= 96.8828
Noise Only (dBFs) = -97.8867
Signal to Noise and Harmonic Ratio(dB) = 96.8826
Noise & Harmonics (dBFs) = -97.8866
Effective Number of Bits 15.9679
DC Offset, Counts -3578.2492
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -119.1449
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 0.29553
Harmonic Power in dBFS 2,3,4,5th Harms=
-146.7464 -150.9325 -145.977 -147.5872
REAL DATA

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

Risk Reduction ADC test


Signal Level (dBFs) -1.004
SNR(dB) (Ignoring Harmonics)= 89.3711
Noise Only (dBFs) = -90.3751
Signal to Noise and Harmonic Ratio(dB) = 89.3708
Noise & Harmonics (dBFs) = -90.3748
Effective Number of Bits 14.7201
DC Offset, Counts -3578.2487
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -100.7661
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 0.70177
Harmonic Power in dBFS 2,3,4,5th Harms=
-135.9006 -133.4494 -157.6867 -145.4939
REAL DATA

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

Risk Reduction ADC test


Signal Level (dBFs) -1.004
SNR(dB) (Ignoring Harmonics)= 70.2033
Noise Only (dBFs) = -71.2072
Signal to Noise and Harmonic Ratio(dB) = 70.2033
Noise & Harmonics (dBFs) = -71.2072
Effective Number of Bits 11.5361
DC Offset, Counts -3578.2504
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -80.7903
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 6.3764
Harmonic Power in dBFS 2,3,4,5th Harms=
-132.9379 -136.8904 -135.7796 -136.7833
REAL DATA

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

Risk Reduction ADC test


Signal Level (dBFs) -1.0042
SNR(dB) (Ignoring Harmonics)= 50.2122
Noise Only (dBFs) = -51.2164
Signal to Noise and Harmonic Ratio(dB) = 50.2122
Noise & Harmonics (dBFs) = -51.2164
Effective Number of Bits 8.2153
DC Offset, Counts -3578.2598
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -60.7904
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 63.6964
Harmonic Power in dBFS 2,3,4,5th Harms=
-118.0023 -123.0603 -117.5391 -122.6652
REAL DATA

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

Risk Reduction ADC test


Signal Level (dBFs) -1.028
SNR(dB) (Ignoring Harmonics)= 30.2114
Noise Only (dBFs) = -31.2394
Signal to Noise and Harmonic Ratio(dB) = 30.2114
Noise & Harmonics (dBFs) = -31.2394
Effective Number of Bits 4.8969
DC Offset, Counts -3578.3523
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -40.7328
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 635.2798
Harmonic Power in dBFS 2,3,4,5th Harms=
-97.2244 -103.1862 -97.0626 -101.4381
REAL DATA

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

Risk Reduction ADC test


Signal Level (dBFs) -3.5496
SNR(dB) (Ignoring Harmonics)= 10.1535
Noise Only (dBFs) = -13.7031
Signal to Noise and Harmonic Ratio(dB) = 10.1535
Noise & Harmonics (dBFs) = -13.7031
Effective Number of Bits 1.9839
DC Offset, Counts -3577.914
Number of Time Samples 32768
Spur Free Dynamic Range (dBFs) = -22.4024
Measured Fundamental Frequency MHz = 24.425
Number of Bits= 16
FFT Noise Floor (dBFS)= -140.2242
Sampling Frequency in MHz = 80.004
Rms Noise Counts 4783.9015
Harmonic Power in dBFS 2,3,4,5th Harms=
-77.9403 -91.9748 -81.8592 -81.1407
REAL DATA

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.

The resulting signal is


not sinusoidal.
10
The Fourier Series (1)

f (t )   Cn  exp(i  n  t )
n  

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).

We’ll also be restricting ourselves to real-valued 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 

The Discrete Fourier Transform transforms a


Finite length series of Discrete time samples f(k), into a
Finite length, series of Discrete frequency samples F(n).
16
Finite Length
Because the DFT operates on a
data set of finite length, the
Function f(t) must be
multiplied by a rectangular f(t)
window function before
Being transformed.
The window function is
defined to be One for – < t <
,
and zero otherwise. B(t)
This is the first function
Appearing in our table of
transforms, with T=2.

We’ll denote this window


f(t)*B(t)
function as B(t) since it’s
sometimes called a
Boxcar Window*. 17
*AKA the gate function, or the rectangular function.
Discrete time samples

X =

P(t) B(t)*f(t) B(t)*P(t)*f(t)


Because the DFT must operate on a data set consisting of discrete
time samples, the Function f(t) must also be multiplied by a
Picket Fence function, P(t), defined as: P (t )   [sin( N  t / 2)]
This product B(t)*P(t)*f(t) is the input data set on which our
DFT will operate.
18
Series, Transform, DFT compared

Fourier Series 1
Coefficients
Cn 
2  f (t ) exp(i  n  t )dt

N 1
 2   n  k 
DFT F ( n)   f (k ) exp  i 
k 0  N 

Fourier
Transform
F ( ) 

 f (t ) exp(i    t )dt
1. By comparing the defining equations, we can see that the
2   k
DFT is proportional to the set of Fourier Series coefficients of t
B(t)*P(t)*f(t), with the substitution: N
2. The DFT is integrated (summed) over an interval equivalent
to 0 to 2while the Fourier Series is integrated over – to 
3. The terms of the DFT are equal to the integrand of the Fourier
Transform of B(t)*P(t)*f(t), with the additional  n 19
substitution.
Table of Properties
Fourier Fourier DFT
Transform Series
Time Interval Infinite Finite Finite

Frequency Continuous Discrete Discrete


Samples
Frequency Interval Infinite Infinite Finite

Time Samples Continuous Continuous Discrete

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

Since the Fourier Series coefficients Cn were shown to be Proportional


to the DFT frequency coefficients Fn, the RATIO of signal to integrated
noise power will be identical whether we use the DFT or the series.

We will proceed to quantify the ratio of Signal to Integrated Leakage


Noise in a Fourier Series, having proved that this signal to noise ratio is
the same whether we use the series or the DFT.

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

B(t)= The Boxcar function (boxcar window)

23
Fourier Series, with frequency error
fa  N
  m Frequency Error, as a fraction of
fs The frequency resolution.

S  mn Sideband Number

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

Fourier Series expressed in terms of integer frequency m, plus error.

24
Evaluate the integral
1 
Cn 
2   exp[i(m  n   )t ]dt

1 
Cs 
2   exp[i(S   )t ]dt

Integer frequency now expressed as “sideband number” S

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 
2S 2S

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.

An analog to digital converter was set up to sample a signal at 80 MSPS. The


analog input signal frequency was adjusted 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.

The approximation may be used to determine what frequency accuracy is required,


or how many sidebands must be discarded, to measure a given signal to noise ratio
within a given error bound.

31

You might also like