SlideShare a Scribd company logo
1 of 28
Fast Fourier Transform Computation Using a C8051 MCU
Fan Wang
Huazhong University of Science & Technology
Photo of the System
Abstract
☼ A method of calculating FFT using a C8051 MCU is
introduced in this paper. The software is aimed at
computational efficiency and accuracy.
☼ By three key techniques: (1)avoidance of multiplication
whenever possible; (2)16-bit integer storage; (3)on-chip
PLL, a real-time audio spectrum is achieved.
☼ The results are displayed on a LCD screen and carefully
analyzed. Basic theories of FFT and common problems in
practice are discussed in detail.
BACKGROUNDS
A. Discrete Fourier Transform and Fast Fourier Transform
B. FFT Bit-Reversal Algorithm
C. Anti-aliasing Filtering and Windowing
D. Function Overview of the C8051 MCU
A. Discrete Fourier Transform and Fast Fourier Transform
,
)
(
)
(
1
0




N
n
nk
N
W
n
x
k
X 1
,...
2
,
1
,
0 
 N
k N
j
N e
W /
2


☼ For a length N complex sequence x(n), n=0,1,2,…N-1,
the discrete Fourier transform(DFT) is defined by
where
☼ According to periodicity and symmetry
)
(
)
(
)
( k
H
W
k
G
k
X k
N


1
2
/
,...
2
,
1
,
0 
 N
k
)
(
)
(
)
2
/
( k
H
W
k
G
N
k
X k
N



1
2
/
,...
2
,
1
,
0 
 N
k




1
2
0
2
/
)
2
(
)
(
N
n
kn
N
W
n
x
k
G 




1
2
0
2
/
)
1
2
(
)
(
N
n
nk
N
W
n
x
k
H
where
,
.
)
0
(
)
0
(
)
0
( 0
4 H
W
G
X 

)
1
(
)
1
(
)
1
( 1
4 H
W
G
X 

)
0
(
)
0
(
)
2
( 0
4 H
W
G
X 

)
1
(
)
1
(
)
3
( 1
4 H
W
G
X 

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
Previous
Data
Previous
Index
New Index
Desired
Data
x(0) 000 000 x(0)
x(1) 001 100 x(4)
x(2) 010 010 x(2)
x(3) 011 110 x(6)
x(4) 100 001 x(1)
x(5) 101 101 x(5)
x(6) 110 011 x(3)
x(7) 111 111 x(7)
C. Anti-aliasing Filtering and Windowing
☼ Anti-aliasing Filtering
Solution: A passive low-pass filter.
C. Anti-aliasing Filtering and Windowing
☼ 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.
☼ On-chip PLL, the peak speed of the
chip can reach as high as 100MIPS.
☼ A 2-cycle 16×16 MAC engine
accelerates the computation
☼ Pipelined instruction
architecture 8051 core
enables it to execute
most of instruction set in
only 1 or 2 system clocks.
☼ Rich analog on-chip
sources a 12-bit, 8-
channel, 100kHz sample
rate ADC, two 12-bit
DACs, two analog
comparators, a voltage
reference, etc.
SOFTWARE DESIGN
A. ADC0_ISR( )
B. WindowCalc( )
C. Bit_Reverse( )
D. Int_FFT( )
E. Spectrum_Display( )
A. ADC0_ISR( )
☼ Conversation is initiated when a Timer3 overflow happens.
☼ The data is then stored in the ADC0H :ADC0L registers.
☼ The overflow interval of Timer3 is determined by a configurable
macro variable SAMPLE_RATE .
B. WindowCalc( )
☼ 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( )
☼ To save data storage space, only half of the bit-reverse
array is stored, the other half is useless for the data will be
exchanged by the first half of operation.
☼ For example, an 8-point FFT may use the following bit-
reverse array:
BRTable[ ]={0,2,1,3};
And the sentence NewIndex=BRTable[PreviousIndex]*2
will help us location the nth reversed index.
D. Int_FFT( )
Start
Stage=0
Group=0
Butterfly=0
Butterfly
Computation
Butterfly
finished?
Group
Finished?
Stage+=1
Group=0
Stage
Finished?
End
Y
N
Butterfly+=1
Group+=1
Butterfly=0
Y
Y
N
N
Butterfly
loop
Group
loop
Stage
loop
Re2)
sin(x)
-
Im2
(cos(x)
-
Im1
Im2
Re2)
sin(x)
-
Im2
(cos(x)
Im1
Im1
Im2)
sin(x)
Re2
(cos(x)
-
Re1
Re2
Im2)
sin(x)
Re2
(cos(x)
Re1
Re1
















where Re1 = ReArray[indexA]
Re2 = ReArray[indexB]
Im1 = ImArray[indexA]
Im2 = ImArray[indexB]
x =2×pi×(sin_index/NUM_FFT), in radians.
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
B. Software Configuration Change
C. Property of Symmetry
A. Function Change
☼ Magnitude and Frequency Change of a Sinusoidal Signal
Fig.TR.1. A 2.5kHz 1.3V sine. Fig.TR.2 A 2.5kHz 2.0V sine.
Fig.TR.3 A 2.5kHz 2.0V sine. Fig.TR.4 A 5kHz 2.0V sine.
A. Function Change
☼ Wave Form Change
Fig.TR.5. Triangular signal. Fig.TR.6. Rectangular signal.
B. Software Configuration Change
Name of variable Function
NUM_FFT Number of points of FFT algorithm
SAMPLE_RATE Sampling rate of ADC0 in Hz
WINDOW_TYPE Type of windows
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
Fig.TR.7. A 256-point square wave Fig.TR.8. A 128-point square wave
B. Software Configuration Change
☼ WINDOW_TYPE Change
Fig.TR.9. Rectangular without windowing. Fig.TR.10.Rectangular with Blackman window.
B. Software Configuration 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
To check the speed of the system, RUN_ONCE is set to zero. For
all audio signals at a sampling rate of 40kHz, the LCD screen
never blinks and a steady frequency spectrum of the input time
domain signals can be read without any obstacles. This proves the
real-time property of the system.
C. Property of Symmetry
Fig.TR.13. 2kHz square wave at full range. Fig.TR.14. 13kHz square wave at full range.
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.
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!

More Related Content

Similar to 13486500-FFT.ppt

Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisDigital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisChandrashekhar Padole
 
Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Rimple Mahey
 
Frequency Modulation.ppt
Frequency Modulation.pptFrequency Modulation.ppt
Frequency Modulation.pptStefan Oprea
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing ssuser2797e4
 
Mining of time series data base using fuzzy neural information systems
Mining of time series data base using fuzzy neural information systemsMining of time series data base using fuzzy neural information systems
Mining of time series data base using fuzzy neural information systemsDr.MAYA NAYAK
 
On The Fundamental Aspects of Demodulation
On The Fundamental Aspects of DemodulationOn The Fundamental Aspects of Demodulation
On The Fundamental Aspects of DemodulationCSCJournals
 
Computer aided design of communication systems / Simulation Communication Sys...
Computer aided design of communication systems / Simulation Communication Sys...Computer aided design of communication systems / Simulation Communication Sys...
Computer aided design of communication systems / Simulation Communication Sys...Makan Mohammadi
 
Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...
Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...
Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...eeiej_journal
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684quadrocopter
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684quadrocopter
 
Module1_dsffffffffffffffffffffgggpa.pptx
Module1_dsffffffffffffffffffffgggpa.pptxModule1_dsffffffffffffffffffffgggpa.pptx
Module1_dsffffffffffffffffffffgggpa.pptxrealme6igamerr
 
Course-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdfCourse-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdfShreeDevi42
 
Advanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdfAdvanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdfHariPrasad314745
 
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPT「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPTTsuyoshi Horigome
 
Report Simulations of Communication Systems
Report Simulations of Communication SystemsReport Simulations of Communication Systems
Report Simulations of Communication SystemsFerro Demetrio
 
An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...ijsrd.com
 

Similar to 13486500-FFT.ppt (20)

J0166875
J0166875J0166875
J0166875
 
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysisDigital Signal Processing Tutorial:Chapt 3 frequency analysis
Digital Signal Processing Tutorial:Chapt 3 frequency analysis
 
Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01
 
Ofdm.pptx
Ofdm.pptxOfdm.pptx
Ofdm.pptx
 
Frequency Modulation.ppt
Frequency Modulation.pptFrequency Modulation.ppt
Frequency Modulation.ppt
 
EC8553 Discrete time signal processing
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
 
Mining of time series data base using fuzzy neural information systems
Mining of time series data base using fuzzy neural information systemsMining of time series data base using fuzzy neural information systems
Mining of time series data base using fuzzy neural information systems
 
On The Fundamental Aspects of Demodulation
On The Fundamental Aspects of DemodulationOn The Fundamental Aspects of Demodulation
On The Fundamental Aspects of Demodulation
 
Computer aided design of communication systems / Simulation Communication Sys...
Computer aided design of communication systems / Simulation Communication Sys...Computer aided design of communication systems / Simulation Communication Sys...
Computer aided design of communication systems / Simulation Communication Sys...
 
Pcm
PcmPcm
Pcm
 
Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...
Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...
Development of Improved Diode Clamped Multilevel Inverter Using Optimized Sel...
 
Multirate sim
Multirate simMultirate sim
Multirate sim
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684
 
Pid En Un Pic16 F684
Pid En Un Pic16 F684Pid En Un Pic16 F684
Pid En Un Pic16 F684
 
Module1_dsffffffffffffffffffffgggpa.pptx
Module1_dsffffffffffffffffffffgggpa.pptxModule1_dsffffffffffffffffffffgggpa.pptx
Module1_dsffffffffffffffffffffgggpa.pptx
 
Course-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdfCourse-Notes__Advanced-DSP.pdf
Course-Notes__Advanced-DSP.pdf
 
Advanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdfAdvanced_DSP_J_G_Proakis.pdf
Advanced_DSP_J_G_Proakis.pdf
 
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPT「SPICEの活用方法」セミナー資料(28JAN2011) PPT
「SPICEの活用方法」セミナー資料(28JAN2011) PPT
 
Report Simulations of Communication Systems
Report Simulations of Communication SystemsReport Simulations of Communication Systems
Report Simulations of Communication Systems
 
An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...An Efficient Construction of Online Testable Circuits using Reversible Logic ...
An Efficient Construction of Online Testable Circuits using Reversible Logic ...
 

More from Pratik Gohel

Introduction to Asic Design and VLSI Design
Introduction to Asic Design and VLSI DesignIntroduction to Asic Design and VLSI Design
Introduction to Asic Design and VLSI DesignPratik Gohel
 
Information and Theory coding Lecture 18
Information and Theory coding Lecture 18Information and Theory coding Lecture 18
Information and Theory coding Lecture 18Pratik Gohel
 
introduction to machine learning 3c.pptx
introduction to machine learning 3c.pptxintroduction to machine learning 3c.pptx
introduction to machine learning 3c.pptxPratik Gohel
 
introduction to machine learning 3c-feature-extraction.pptx
introduction to machine learning 3c-feature-extraction.pptxintroduction to machine learning 3c-feature-extraction.pptx
introduction to machine learning 3c-feature-extraction.pptxPratik Gohel
 
introduction to machine learning 3d-collab-filtering.pptx
introduction to machine learning 3d-collab-filtering.pptxintroduction to machine learning 3d-collab-filtering.pptx
introduction to machine learning 3d-collab-filtering.pptxPratik Gohel
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptxPratik Gohel
 
710402_Lecture 1.ppt
710402_Lecture 1.ppt710402_Lecture 1.ppt
710402_Lecture 1.pptPratik Gohel
 
Interdependencies of IoT and cloud computing.pptx
Interdependencies of IoT and cloud computing.pptxInterdependencies of IoT and cloud computing.pptx
Interdependencies of IoT and cloud computing.pptxPratik Gohel
 
6-IoT protocol.pptx
6-IoT protocol.pptx6-IoT protocol.pptx
6-IoT protocol.pptxPratik Gohel
 
C Programming for ARM.pptx
C Programming for ARM.pptxC Programming for ARM.pptx
C Programming for ARM.pptxPratik Gohel
 
ARM Introduction.pptx
ARM Introduction.pptxARM Introduction.pptx
ARM Introduction.pptxPratik Gohel
 
machine learning.ppt
machine learning.pptmachine learning.ppt
machine learning.pptPratik Gohel
 

More from Pratik Gohel (18)

Introduction to Asic Design and VLSI Design
Introduction to Asic Design and VLSI DesignIntroduction to Asic Design and VLSI Design
Introduction to Asic Design and VLSI Design
 
Information and Theory coding Lecture 18
Information and Theory coding Lecture 18Information and Theory coding Lecture 18
Information and Theory coding Lecture 18
 
introduction to machine learning 3c.pptx
introduction to machine learning 3c.pptxintroduction to machine learning 3c.pptx
introduction to machine learning 3c.pptx
 
introduction to machine learning 3c-feature-extraction.pptx
introduction to machine learning 3c-feature-extraction.pptxintroduction to machine learning 3c-feature-extraction.pptx
introduction to machine learning 3c-feature-extraction.pptx
 
introduction to machine learning 3d-collab-filtering.pptx
introduction to machine learning 3d-collab-filtering.pptxintroduction to machine learning 3d-collab-filtering.pptx
introduction to machine learning 3d-collab-filtering.pptx
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
Lecture 3.ppt
Lecture 3.pptLecture 3.ppt
Lecture 3.ppt
 
710402_Lecture 1.ppt
710402_Lecture 1.ppt710402_Lecture 1.ppt
710402_Lecture 1.ppt
 
UNIT-2.pptx
UNIT-2.pptxUNIT-2.pptx
UNIT-2.pptx
 
Interdependencies of IoT and cloud computing.pptx
Interdependencies of IoT and cloud computing.pptxInterdependencies of IoT and cloud computing.pptx
Interdependencies of IoT and cloud computing.pptx
 
Chapter1.pdf
Chapter1.pdfChapter1.pdf
Chapter1.pdf
 
6-IoT protocol.pptx
6-IoT protocol.pptx6-IoT protocol.pptx
6-IoT protocol.pptx
 
IOT gateways.pptx
IOT gateways.pptxIOT gateways.pptx
IOT gateways.pptx
 
AVRTIMER.pptx
AVRTIMER.pptxAVRTIMER.pptx
AVRTIMER.pptx
 
C Programming for ARM.pptx
C Programming for ARM.pptxC Programming for ARM.pptx
C Programming for ARM.pptx
 
ARM Introduction.pptx
ARM Introduction.pptxARM Introduction.pptx
ARM Introduction.pptx
 
arm
armarm
arm
 
machine learning.ppt
machine learning.pptmachine learning.ppt
machine learning.ppt
 

Recently uploaded

S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxSCMS School of Architecture
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...jabtakhaidam7
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 

Recently uploaded (20)

S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 

13486500-FFT.ppt

  • 1. Fast Fourier Transform Computation Using a C8051 MCU Fan Wang Huazhong University of Science & Technology
  • 2. Photo of the System
  • 3. Abstract ☼ A method of calculating FFT using a C8051 MCU is introduced in this paper. The software is aimed at computational efficiency and accuracy. ☼ By three key techniques: (1)avoidance of multiplication whenever possible; (2)16-bit integer storage; (3)on-chip PLL, a real-time audio spectrum is achieved. ☼ The results are displayed on a LCD screen and carefully analyzed. Basic theories of FFT and common problems in practice are discussed in detail.
  • 4. BACKGROUNDS A. Discrete Fourier Transform and Fast Fourier Transform B. FFT Bit-Reversal Algorithm C. Anti-aliasing Filtering and Windowing D. Function Overview of the C8051 MCU
  • 5. A. Discrete Fourier Transform and Fast Fourier Transform , ) ( ) ( 1 0     N n nk N W n x k X 1 ,... 2 , 1 , 0   N k N j N e W / 2   ☼ For a length N complex sequence x(n), n=0,1,2,…N-1, the discrete Fourier transform(DFT) is defined by where ☼ According to periodicity and symmetry ) ( ) ( ) ( k H W k G k X k N   1 2 / ,... 2 , 1 , 0   N k ) ( ) ( ) 2 / ( k H W k G N k X k N    1 2 / ,... 2 , 1 , 0   N k     1 2 0 2 / ) 2 ( ) ( N n kn N W n x k G      1 2 0 2 / ) 1 2 ( ) ( N n nk N W n x k H where , .
  • 6. ) 0 ( ) 0 ( ) 0 ( 0 4 H W G X   ) 1 ( ) 1 ( ) 1 ( 1 4 H W G X   ) 0 ( ) 0 ( ) 2 ( 0 4 H W G X   ) 1 ( ) 1 ( ) 3 ( 1 4 H W G X   A. Discrete Fourier Transform and Fast Fourier Transform We have the FFT process as the following: (N=4) (N=8)
  • 7. B.FFT Bit-Reversal Algorithm Previous Data Previous Index New Index Desired Data x(0) 000 000 x(0) x(1) 001 100 x(4) x(2) 010 010 x(2) x(3) 011 110 x(6) x(4) 100 001 x(1) x(5) 101 101 x(5) x(6) 110 011 x(3) x(7) 111 111 x(7)
  • 8. C. Anti-aliasing Filtering and Windowing ☼ Anti-aliasing Filtering Solution: A passive low-pass filter.
  • 9. C. Anti-aliasing Filtering and Windowing ☼ Windowing
  • 10. 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)
  • 11. D. Function Overview of the C8051 MCU ☼ A high performance C8051 MCU by Silicon Laboratories™— C8051F120. ☼ On-chip PLL, the peak speed of the chip can reach as high as 100MIPS. ☼ A 2-cycle 16×16 MAC engine accelerates the computation ☼ Pipelined instruction architecture 8051 core enables it to execute most of instruction set in only 1 or 2 system clocks. ☼ Rich analog on-chip sources a 12-bit, 8- channel, 100kHz sample rate ADC, two 12-bit DACs, two analog comparators, a voltage reference, etc.
  • 12. SOFTWARE DESIGN A. ADC0_ISR( ) B. WindowCalc( ) C. Bit_Reverse( ) D. Int_FFT( ) E. Spectrum_Display( )
  • 13. A. ADC0_ISR( ) ☼ Conversation is initiated when a Timer3 overflow happens. ☼ The data is then stored in the ADC0H :ADC0L registers. ☼ The overflow interval of Timer3 is determined by a configurable macro variable SAMPLE_RATE .
  • 14. B. WindowCalc( ) ☼ 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.
  • 15. C. Bit_Reverse( ) ☼ To save data storage space, only half of the bit-reverse array is stored, the other half is useless for the data will be exchanged by the first half of operation. ☼ For example, an 8-point FFT may use the following bit- reverse array: BRTable[ ]={0,2,1,3}; And the sentence NewIndex=BRTable[PreviousIndex]*2 will help us location the nth reversed index.
  • 17. 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.
  • 18. EXPERIMENT RESULTS AND DISCUSSION A. Function Change B. Software Configuration Change C. Property of Symmetry
  • 19. A. Function Change ☼ Magnitude and Frequency Change of a Sinusoidal Signal Fig.TR.1. A 2.5kHz 1.3V sine. Fig.TR.2 A 2.5kHz 2.0V sine. Fig.TR.3 A 2.5kHz 2.0V sine. Fig.TR.4 A 5kHz 2.0V sine.
  • 20. A. Function Change ☼ Wave Form Change Fig.TR.5. Triangular signal. Fig.TR.6. Rectangular signal.
  • 21. B. Software Configuration Change Name of variable Function NUM_FFT Number of points of FFT algorithm SAMPLE_RATE Sampling rate of ADC0 in Hz WINDOW_TYPE Type of windows RUN_ONCE Program runs once when the value is 0,many times when the value is non-zero.
  • 22. B. Software Configuration Change ☼ NUM_FFT Change Fig.TR.7. A 256-point square wave Fig.TR.8. A 128-point square wave
  • 23. B. Software Configuration Change ☼ WINDOW_TYPE Change Fig.TR.9. Rectangular without windowing. Fig.TR.10.Rectangular with Blackman window.
  • 24. B. Software Configuration Change ☼ SAMPLE_RATE Change Fig.TR.11. 5k sine at 40kHz sampling rate. Fig.TR.12. 5k sine at 20kHz sampling rate.
  • 25. B. Software Configuration Change ☼ RUN_ONCE Change To check the speed of the system, RUN_ONCE is set to zero. For all audio signals at a sampling rate of 40kHz, the LCD screen never blinks and a steady frequency spectrum of the input time domain signals can be read without any obstacles. This proves the real-time property of the system.
  • 26. C. Property of Symmetry Fig.TR.13. 2kHz square wave at full range. Fig.TR.14. 13kHz square wave at full range. 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.
  • 27. 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.