Sunteți pe pagina 1din 32

Fast Frequency and Response

Measurements using FFTs


Alain Moriat,
Senior Architect
Fri. 12:45p
Pecan (9B)
www.natinst.com
Accurately Detect a Tone

 What is the exact frequency and amplitude of


a tone embedded in a complex signal?

 How fast can I perform these measurements?

 How accurate are the results?

www.natinst.com
Presentation Overview

 Why use the frequency domain?


 FFT – a short introduction
 Frequency interpolation
 Improvements using windowing
 Error evaluation
 Amplitude/phase response measurements
 Demos

www.natinst.com
Clean Single Tone Measurement
2 Time signal 20 FFT Spectrum
Vo lt dBV
1 0

0 -20

-1 -40

-2 -60 kHz
0.0 0.2 0.4 0.6 0.8 ms 1.0 0 5 10 15 20 25 30 35 40 45 50

 Clean sine tone  Clean tone spectrum


 Easy to measure

www.natinst.com
Noisy Tone Measurement Our signal
2 Time signal 20 FFT Spectrum
Vo lt dBV
1 0

0 -20

-1 -40

-2 -60 kHz
0.0 0.2 0.4 0.6 0.8 ms 1.0 0 5 10 15 20 25 30 35 40 45 50

 Noisy signal  Noisy signal spectrum


 Difficult to measure in  Easier to measure
the time domain

www.natinst.com
Fast Fourier Transform (FFT)
Fundamentals (Ideal Case)
2 Time signal 20 FFT Spectrum
Vo lt dBV
1 0

0 -20

-1 -40

-2 -60
0.0 0.1 0.2 0.3 0.4 ms 0.5 0 5 10 15 20 25 30 35 40 45 50
kHz
Fsampling = 100 kHz Re cord size = 50 sample s
Time re s = 10 us Fre q. re s = 2 kHz
 The tone frequency is an exact multiple of the frequency
resolution (“hits a bin”)

www.natinst.com
FFT Fundamentals (Realistic Case)
2 Time signal 20 FFT Spectrum
Vo lt dBV
1 0

0 -20

-1 -40

-2 -60
0.0 0.1 0.2 0.3 0.4 ms 0.5 0 5 10 15 20 25 30 35 40 45 50
kHz
Fsampling = 100 kHz Re cord size = 50 sample s
Time re s = 10 us Fre q. re s = 2 kHz

 The tone frequency is not a multiple of the


frequency resolution
www.natinst.com
Input Frequency Hits Exactly a Bin
0
dB
-10  Only one bin
is activated
-20

-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +0.25 Bin “off”
0
dB
-10
Real top
Highest Bin
-20

-30 Next Highest


Bin
-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +0.50 Bin “off”
0
dB  Highest
-10
side-lobes
-20

-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +0.75 Bin “off”
0
dB  The Side
-10
lobe levels
-20 decrease
-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +1.00 Bin “off”
0
dB
-10  Only one
bin is
-20
activated
-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
The Envelope Function
1.1
1.0 Real top
0.8 Highest Bin = a
0.6
Next highest
0.4
Bin = b
0.2

0.0

-0.2
-0.3
-4 -3 -2 -1 0 1 2 3 Bin4

www.natinst.com
The Mathematics

 Envelope function:
Sin(π  bin)
Env 
(π  bin)

b
 Bin offset: Δbin  
(a  b)

(π  Δbin)
 Real amplitude: Amp  a 
Sin(π  Δbin)

www.natinst.com
Demo

 Amplitude and frequency detection by


Sin(x) / x interpolation

www.natinst.com
Aliasing of the Side-Lobes
0 Highest Bin =
dB Bin 4
-10

-20

Aliased Bin =
-30
“Negative Bin 4”
-40

-50

-60
0 1 2 3 4 5 6 7 8 9 Bin
10

www.natinst.com
Weighted Measurement

 Apply a Window to the signal


2 2
Volt Volt
1 1

0 0

-1 -1

-2 -2
0.0 0.1 0.2 0.3 0.4 ms 0.5 0.0 0.1 0.2 0.3 0.4 ms 0.5

Hanning window – one period of ( 1 - COS )

www.natinst.com
Weighted Spectrum Measurement

 Apply a Window to the Signal


20 Without Window 20With
dBV
Hanning Window
dBV
0 0

-20 -20

-40 -40

-60 -60
0 5 10 15 20kHz 25 0 5 10 15 20kHz 25

www.natinst.com
Rectangular and Hanning Windows
0
dB
-10
 Side lobes
for Hanning
-20
Window are
-30 significantly
lower than
-40
for
-50 Rectangular
-60 window
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency Exactly Hits a Bin
0
dB
-10
 Three bins
are
-20
activated
-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +0.25 Bin “off”
0
dB
-10
 More bins
are
-20
activated
-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +0.50 Bin “off”
0
dB
-10
 Highest
side-lobes
-20

-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +0.75 Bin “off”
0
dB
-10
 The Side
lobe levels
-20
decrease
-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
Input Frequency is +1.00 Bin “off”
0
dB
-10
 Only three
bins
-20
activated
-30

-40

-50

-60
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 Bin6

www.natinst.com
The Mathematics for Hanning ...
Sin(π  bin)
 Envelope: Env 
(π  bin)  (1  bin 2 )

(a - 2b)
 Bin Offset: Δbin  
(a  b)

(π  Δbin)
 Amplitude: Amp  a   (1  Δbin 2 )
Sin(π  Δbin)

www.natinst.com
A LabVIEW Tool

 Tone detector LabVIEW virtual instrument (VI)

www.natinst.com
Demo

 Amplitude and frequency detection using a


Hanning Window (named after Von Hann)

 Real world demo using:


 The NI-5411 ARBitrary Waveform Generator
 The NI-5911 FLEXible Resolution Oscilloscope

www.natinst.com
Frequency Detection Resolution
1000.00 Fre q e rror (ppm)
ppm
100.00

10.00

1.00

0.10

0.01
1 10 S ignal pe riods 100

www.natinst.com
Amplitude Detection Resolution
1000.00 Amplitude e rror (ppm)
ppm
100.00

10.00

1.00

0.10

0.01
1 10 S ignal pe riods 100

www.natinst.com
Phase Detection Resolution
1000.00 Phas e e rror (mde g)
mde g.
100.00

10.00

1.00

0.10

0.01
1 10 S ignal pe riods 100

www.natinst.com
Conclusions

 Traditional counters resolve 10 digits in one


second
 FFT techniques can do this in much less than
100 ms
 Another example of 10X for test
 Similar improvements apply to amplitude and
phase

www.natinst.com
Conclusions (Notes Page Only)

 Traditional Counters Resolve 10 digits in one


second
 FFT Techniques can do this in much less
than 100 ms
 Another example of 10X for test
 Similar improvements apply to Amplitude and
Phase

www.natinst.com

S-ar putea să vă placă și