# Connexions

You are here: Home » Content » FFT and Spectrum Analysis

### Recently Viewed

This feature requires Javascript to be enabled.

# FFT and Spectrum Analysis

Module by: Ricardo Radaelli-Sanchez. E-mail the author

Summary: This lab introduces FFT implementations on the 56002 through the construction of a real-time spectrum analyzer using the 56002EVM and an oscilloscope.

This lab introduces FFT implementations on the 56002 through the construction of a real-time spectrum analyzer using the 56002EVM and an oscilloscope.

## FFT Implementation

Read and understand the fft2.asm macro in Chapter 8 of El-Sharkawy's book. This algorithm automatically down-scales by a factor of two the outputs of all of the butterflies within the FFT to prevent loss of information due to overflow. The directory c:\ee609\lab6 contains the macros fft2.asm, sincos.asm, bitrev.asm and the associated test program fftex2.asm. Using the data in the book, confirm that the algorithm works as expected.

## Real-Time Spectrum Analyzer

Modify fftex2.asm to implement a real-time 512-point FFT which takes 512 points of the signal from the ADC as input and calculates the FFT of the 512-point signal. Build upon this real-time 512-point FFT and design a real-time spectrum analyzer by sending the power spectrum of the calculated FFT through the DAC in some useful fashion, (e.g., periodically outputting the power spectrum). Specifically:

1. Input a real time waveform and compute the FFT of the input data.
2. Compute the power spectrum P as follows: FFT2N2 FFT 2 N 2
3. Output one-sided power spectrum data as a time domain sequence through the DAC device for display on the oscilloscope.

Several considerations need to be taken on displaying the power spectrum on the scope.

• Trigger: For each power spectrum, one can output a strong pulse (e.g., two samples with +2 and -2 volts) for the purpose of scope synchronization. Alternatively, the second DAC channel can be used to send a separate trigger signal.
• Calibration: The frequency scale needs to be calculated based on the sampling frequency ( f s =48 kHz f s 48 kHz ).
• Display: Consider windowing your data before the FFT. What will this accomplish?
Implement the real-time power spectrum analyzer with your own ingenious modifications. Measure power spectra for signals (sine, triangle, square, random noise) between 50 Hz and 20 kHz. Report what you observe. Does the real-time spectrum analyzer behave as you expect? Discuss the limitations of the spectrum analyzer.

## Sample code

Figure 1
fftex2.asm


THIS NEED TO BE ADDED HERE

{\clearpage \footnotesize \verbatimtabinput[8]{asm/fftex2.asm}}


Figure 2
fft2.asm


THIS NEEDS TO BE ADDED HERE

{\clearpage \footnotesize \verbatimtabinput[8]{asm/fft2.asm}}


Figure 3
sincos.asm


THIS NEEDS TO BE ADDED HERE

{\clearpage \footnotesize \verbatimtabinput[8]{asm/sincos.asm}}


Figure 4
bitrev.asm


THIS NEEDS TO BE ADDED HERE

{\clearpage \footnotesize \verbatimtabinput[8]{asm/bitrev.asm}}



## Content actions

PDF | EPUB (?)

### What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

#### Definition of a lens

##### Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

##### What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

##### Who can create a lens?

Any individual member, a community, or a respected organization.

##### What are tags?

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks