Professional Documents
Culture Documents
Fan Wang
Huazhong University of Science & Technology
Photo of the System
Abstract
k.
X ( k + N / 2) = G ( k ) − W H ( k )
N k = 0,1,2,...N / 2 − 1
X (k ) = G (k ) + WNk H (k ) k = 0,1,2,...N / 2 − 1
N −1 N −1
where 2 2
G (k ) = ∑ x(2n)WNkn/ 2 H (k ) = ∑ x(2n + 1)W
n =0
nk
N /2
n =0
A. Discrete Fourier Transform and Fast Fourier
Transform
We have the FFT process as the following:
(N=4)
(N=8)
B.FFT Bit-Reversal Algorithm
☼ Anti-aliasing Filtering
☼ Windowing
C. Anti-aliasing Filtering and Windowing
☼ Windowing
Type Equation
0: None(Rectangular) W(n)=1
1: Triangular W(n)=n/(N/2) (0≤n≤N/2)
W(n)=2-n/(N/2) (N/2<n<N)
2: Hanning W(n)=0.5-0.5cos(2πn/N)
3: Hamming W(n)=0.54-0.46cos(2πn/N)
4: Blackman W(n) = 0.42 - 0.5cos(2πn / N)
+0.08cos(4πn / N)
D. Function Overview of the C8051 MCU
☼ A high performance
C8051 MCU by Silicon
Laboratories™—
C8051F120.
☼ Pipelined instruction
☼ On-chip PLL, the peak speed of the architecture 8051 core
chip can reach as high as 100MIPS. enables it to execute
most of instruction set in
☼ A 2-cycle 16×16 MAC engine only 1 or 2 system
accelerates the computation clocks.
SOFTWARE DESIGN
A. ADC0_ISR( )
B. WindowCalc( )
C. Bit_Reverse( )
D. Int_FFT( )
E. Spectrum_Display( )
A. ADC0_ISR( )
☼ Pre-calculated
The window coefficients are pre-calculated and stored in the header
file FFT_Code_Tables.h. The type define variable WINDOW_TYPE can
be selected from 0 to 4.
☼ Single-ended to differential
The function also converts the single-ended data collected by ADC0
into differential, in order to remove the DC component of the input
signal. The process is carried out by XOR the input data with
0x8000, which has the same effect with subtracting 32768 from the
input data, so that the data ranges from 32752 to -32768.
C. Bit_Reverse( )
D. Int_FFT( ) Stage =0
Group =0
Butterfly =0
Stage loop
Group loop
Butterfly loop
Re1 = Re1 + (cos(x) × Re2 + sin(x) × Im2)
Butterfly
Computation
Group +=1 N
where Re1 = ReArray[indexA] Butterfly =0
Im2 = ImArray[indexB] Y
Stage
Finished ?
End
E. Spectrum_Display( )
The FFT result is in complex form, of which the real part is stored in
Real[], and the imaginary part is stored in Imag[]. Based on the two
arrays, the magnitude spectrum and phase spectrum can be easily
obtained. This software only calculates power spectrum of the input
signal. The spectrum is displayed on a 128×64 point LCD screen.
EXPERIMENT RESULTS AND DISCUSSION
A. Function Change
C. Property of Symmetry
A. Function Change
RUN_ONCE Program runs once when the value is 0,many times when
the value is non-zero.
B. Software Configuration Change
☼ NUM_FFT Change
☼ WINDOW_TYPE Change
☼ SAMPLE_RATE Change
Fig.TR.11. 5k sine at 40kHz sampling rate. Fig.TR.12. 5k sine at 20kHz sampling rate.
B. Software Configuration Change
☼ RUN_ONCE Change
The real part of FFT output exhibits even symmetry and imaginary
part of FFT output exhibits odd symmetry. This results in the
symmetry of frequency spectrum. That is, for N-point FFT products,
point N/2+1 is the same as point N/2-1, point N/2+2 is the same as
point N/2-2, etc. To illustrate this property, set the full range of the
screen to 40kHz. Here are the results.
Fig.TR.13. 2kHz square wave at full range. Fig.TR.14. 13kHz square wave at full range.
REFERENCES
[1] Edward W. Kanmen and Bonnie S. Heck,
Fundamentals of Signals and Systems: Using the Web
and MATLAB, 2nd ed. Pearson Education, 2002.
[2] Julius O. Smith Ⅲ, Mathematics of the Discrete
Fourier Transform (DFT) with Audio Applications, 2nd
ed. http://ccrma.stanford.edu/~jos/mdft/
[3] Junli Zheng, Signals and systems, 2nd ed. Higher
Education Press, 2000.
[4] AN142 “FFT Routines for the C8051F12X Family”,
Rev.1.1. Inc. ©Silicon Laboratories, 2003.
[5] “FFT Library-Module user’s Guide C28x Foundation
Software”. Inc. ©Texas Instruments, 2002.
Thank you!