• No results found

FAST Fourier Transform (FFT) and Digital Filtering Using LabVIEW

N/A
N/A
Protected

Academic year: 2021

Share "FAST Fourier Transform (FFT) and Digital Filtering Using LabVIEW"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

FAST Fourier Transform (FFT) and Digital

Filtering Using LabVIEW

Wei Lin

Department of Biomedical Engineering Stony Brook University

Instructor’s Portion

Summary

This experiment requires the student to use LabVIEW to perform signal analysis on the acquired analog signals. Students should be familiar with the Fast Fourier Transform (FFT) and digital filtering using LabVIEW

Uses

This lecture applies to all courses of virtual instrumentation.

Equipment List

• Computers

• LabVIEW 8.5 Express

• NI-ELVIS benchtop workstation

References

• Lecture Slides of “Data Analysis Using LabVIEW”

• VIs from the project “Data Acquisition Using NI-DAQmx”

Student’s Portion

Introduction

(2)

project “Data Acquisition Using NI-DAQmx” and add frequency spectrum analysis and digital filter in the two VIs.

Objectives

• Perform FFT analysis using LabVIEW Frequency Spectrum Express VI

• Design and test digital filter using LabVIEW Filter Express VI

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:

• A lowpass filter passes low frequencies, but attenuates high frequencies.

• A highpass filter passes high frequencies, but attenuates low frequencies.

(3)

• They are programmable in terms of filter order, cutoff frequencies, and amount of ripple.

• They are stable and predictable.

• They do not drift with temperature or humidity and do not require precision components.

• They have a superior performance-to-cost ratio.

Therefore, it is recommended to use digital filters in instrumentation except for the antialiasing filter.

LabVIEW has two express VIs for FFT analysis and digital filtering. They are frequency spectrum express VI and filter express VI.

Lab Procedure

Experiment 1: Create a LabVIEW application of frequency spectrum analysis:

1. Launch LabVIEW.

2. Load finite data acquisition VI.

3. Add the frequency spectrum VI (Express->Signal Analysis->Spectral). Configure the output of the express VI as linear in result section and set window as None.

4. Connect the waveform data from DAQmx read VI to the signal terminal of the frequency spectrum express VI.

5. Add a graph indicator on the front panel and connect the output (FFT-(RMS)) of the frequency spectrum VI (FFT) to the graph. 6. Keep the ELVIS unit off. Connect the output of function generator

“FUNC OUT” to ACH0 using connection wire on the prototype board.

7. Turn ELVIS unit on including the prototype board.

8. Launch ELVIS application and choose function generator. 9. Enter the parameters for the controls of the LabVIEW.

Recommended sampling frequency is 1000 Hz and number of samples is 1000.

10. Set the frequency, and function type of the signal generator (recommended function: sine wave, frequency 20 Hz. and run the VI and observe the frequency spectrum. In this case, you should collected integer number of cycles of the signal. Therefore, no spectrum leakage is present.

11. Change the signal frequency or the number of samples so that there is a disconnection at the end of the signal (non integer number of cycles collected) and observe the spectrum leakage.

(4)

Experiment 2, Create a LabVIEW application of digital filter: 1. Use the VI from previous experiment.

2. Add two more graph indictors on the front panel for the filtered signal and the spectrum of the filtered signal.

3. Add a filter express VI (Express->Signal Analysis->Filter) and connect the output from the DAQmx VI to the signal terminal of the filter VI

4. Connect the output of filter to the graph indicator of filtered signal. 5. Add another frequency spectrum express VI (Express->Signal

Analysis->Spectral) on the block diagram and connect the filtered signal to its input.

6. Connect the output of the above frequency spectrum express VI to the graph indicator of the filtered signal spectrum.

7. Combine the two dynamic data, the spectrum of the original signal and the spectrum of the filtered signal using signal manipulation VI (Express->Signal Manipulate->merge signals) and connect it to the “Write LabVIEW Measurement Data” express VI (Express->Output->write meas data). In the wizard, select

a. Ask user to choose file b. Ask each iteration

c. If a file already exists, overwrite file d. X value columns: one column per channel

8. Run the application and record the results in files. The following are the suggestions for the test of digital filters.

a. Use square wave at low frequency, far below the sampling frequency. (20 Hz)

b. Change the cutoff frequency of the filter.

c. Change the type of filter, e.g. lowpass or highpass. d. Change the order of the filter. (optional)

e. Change the topology of the filter. (optional)

Experiment 3. (Extra credits): Using FFT to measure the cutoff frequencies of the band pass filter you made in the previous lab. The expected solution will use one or two measurements to estimate the cutoff frequencies instead of using multiple sinusoidal signals.

Lab Report

1. Objective.

2. Theory (What it FFT? Filter?)

3. Data: Demonstrate frequency spectrum of the tested signal and filter effects.

(5)

Reference VIs

FFT VI

References

Related documents

Keywords: Severe pancreatitis, Step-up approach, Video-assisted retroperitoneal debridement, Endoscopic transgastric necrosectomy, Percutaneous drainage, Walled-off

Conclusions: Our purpose in writing this article was to clarify the conditions under which GWAS are expected to be reproducibly misleading. As our simula- tion results

The purpose of this study, thus, is to describe the patient population who visited the Mexican chiropractic college public clinic with respect to demographics and

Case reports and case series studies were eligible for the inclu- sion if they met the following criteria, (a) reporting one or more pregnant women diagnosed with brucellosis;

Using model interaction Hamiltonians for both electrons and phonons and Green’s function formalism for ballistic transport, we have studied the thermal conductance and

The new COP 2540 is a high frequency rock drill option for SmartROC T35, designed to perform in the same hole range and carry on the legacy of the highly regarded COP 1840. With

Some studies also validate trust and risk assumptions using canonical games even when the context of the experiments is different from the social behavior or farm

International Journal of Scientific Research in Computer Science, Engineering and Information Technology CSEIT195626 | Received 15 Nov 2019 | Accepted 05 Dec 2019 | November December 2019