Fast Fourier Transform (FFT) and Digital Filtering Using Labview
Fast Fourier Transform (FFT) and Digital Filtering Using Labview
Fast Fourier Transform (FFT) and Digital Filtering Using Labview
Instructors Portion
Summary
ThisexperimentrequiresthestudenttouseLabVIEWtoperformsignal
analysisontheacquiredanalogsignals.Studentsshouldbefamiliarwith
theFastFourierTransform(FFT)anddigitalfilteringusingLabVIEW
Uses
Thislectureappliestoallcoursesofvirtualinstrumentation.
Equipment List
Computers
LabVIEW7Express
NIELVISbenchtopworkstation
LectureSlidesofDataAnalysisUsingLabVIEW
VIsfromtheprojectDataAcquisitionUsingNIDAQmx
References
SubmittinganExperiment
Students Portion
Introduction
ThestudentsshouldlearnthebasicLabVIEWprogrammingtechniquesfor
the FFT and digital filtering. They will modify two VIs developed in the
projectDataAcquisitionUsingNIDAQmxandaddfrequencyspectrum
analysisanddigitalfilterinthetwoVIs.
Objectives
LabVIEWFrequencySpectrumExpressVI
LabVIEWFilterExpressVI
Theory
The Fast Fourier Transform (FFT) and the power spectrum are powerful
tools for analyzing and measuring signals from plug-in data acquisition
(DAQ) devices. It can measure the frequency components within the
signal. FFT-based measurement requires digitization of a continuous
signal. According to the Nyquist criterion, the sampling frequency, Fs,
must be at least twice the maximum frequency component in the signal. If
this criterion is violated, a phenomenon known as aliasing occurs. When
the Nyquist criterion is violated, frequency components above half the
sampling frequency appear as frequency components below half the
sampling frequency, resulting in an erroneous representation of the signal.
This is called frequency aliasing. Therefore, before a signal is digitized,
antialiasing filters are used to attenuate the frequency components at and
above half the sampling frequency to a level below the dynamic range of
the analog-to-digital converter (ADC). Spectral leakage is another issue in
FFT analysis. It is the result of an assumption in the FFT algorithm that
the time record is exactly repeated throughout all time and that signals
contained in a time record are thus periodic at intervals that correspond to
the length of the time record. If the time record has a nonintegral number
of cycles, this assumption is violated and spectral leakage occurs. To
alleviate the spectrum leakage, a predefine window function is applied to
the signals to be analyzed.
Filters alter or remove unwanted frequencies from your signal. Depending
on the frequency range that they either pass or attenuate, they can be
classified into the following types:
SubmittinganExperiment
Lab Procedure
Experiment1:CreateaLabVIEWapplicationoffrequencyspectrum
analysis:
1. LaunchLabVIEW.
2. LoadcontinuousdataacquisitionVIfrompreviousprojectData
AcquisitionUsingNIDAQmx.
3. Inthewhileloop,addthefrequencyspectrumVI.Configurethe
outputoftheexpressVIaslinearinresultsection.
4. ConvertthewaveformdatafromDAQmxreadVItodynamicdata
andconnectthedynamicdatatothesignalterminalofthe
frequencyspectrumexpressVI.
5. Addagraphindicatoronthefrontpanelandconnecttheoutputof
thefrequencyspectrumVI(FFT)tothegraph.
6. KeeptheELVISunitoff.Connecttheoutputoffunctiongenerator
FUNCOUTtoACH0usingconnectionwireontheprototype
board.
7. TurnELVISunitonincludingtheprototypeboard.
8. LaunchELVISapplicationandchoosefunctiongenerator.
9. Selectthefrequency,waveformtypeandamplitudeofthefunction
generatorandturniton.
10. EntertheparametersforthecontrolsoftheLabVIEW.
11. Changethefrequency,andfunctiontypeofthesignalgenerator
andobservethechangeofthefrequencyspectrum.
SubmittinganExperiment
Experiment2,CreateaLabVIEWapplicationofdigitalfilter:
1. LaunchLabVIEW.
2. LoadfinitesampledataacquisitionVIfrompreviousprojectData
AcquisitionUsingNIDAQmx.
3. Disconnectthelinkbetweenthewaveformoutputfromthe
DAQmxreadVIandtheWriteLabVIEWMeasurementData
expressVI.
4. Addthreegraphindictorsonthefrontpanelfortheoriginalsignal
spectrum,filteredsignalandthespectrumofthefilteredsignal.
5. AddafrequencyspectrumexpressVIandafilterVIintheblock
diagram.
6. ConvertthewaveformdatafromDAQmxreadVItodynamicdata
andconnectthedynamicdatatothesignalterminalofthe
frequencyspectrumexpressVIandfilterexpressVI.SelectIIR
filterinthefilterexpressVI.
7. ConnecttheoutputoffrequencyspectrumexpressVItothegraph
indicatoroftheoriginalsignalspectrum.
8. Connecttheoutputoffiltertothegraphindicatoroffilteredsignal.
9. AddanotherfrequencyspectrumexpressVIontheblockdiagram
andconnectthefilteredsignaltoitsinput.
10. ConnecttheoutputoftheabovefrequencyspectrumexpressVIto
thegraphindicatorofthefilteredsignalspectrum.
11. Combinethefourdynamicdata,theoriginalsignal,spectrumof
theoriginalsignal,thefilteredsignalandthespectrumofthe
filteredsignalandconnectittotheWriteLabVIEWMeasurement
DataexpressVI.
12. Runtheapplicationasdescribedinthepreviousexperimentand
recordtheresultsinfiles.Thefollowingarethesuggestionsforthe
expectedresults.
a. Usesquarewaveatlowfrequency,farbelowthesampling
frequency.
b. Changethecutofffrequencyofthefilter.
c. Changethetypeoffilter,e.g.lowpassorhighpass.
d. Changetheorderofthefilter.
e. Changethetopologyofthefilter.
Lab Report
Thelabreportshouldcontainthefollowing:
1. Theexperimenttitle
2. Theexperimentobjective
SubmittinganExperiment
3. Theexperimentprocedureandtheory
4. Resultsanddiscussion
5. Youmayaddyourlabdesignintothisproject.
Pleasesubmitthereportthroughemail.
SubmittinganExperiment