<< Chapter < Page Chapter >> Page >
This is a processor exercise in which students implement a spectrum analyzer using mixed C and assembly code. Students are to acquire a block of 1024 samples, apply a Hamming window, compute a length-1024 Discrete Fourier Transform using provided Fast Fourier Transform code, and display the magnitude-squared spectrum on an oscilloscope. Students will also compile and explore a reference implementation of an autocorrelation-based power spectral density (PSD) estimator. This implementation estimates the PSD of an IIR-filtered pseudo-noise generator.

Implementation

As this is your first experience with the C environment, you will have the option to add most of the required code in C or assembly.A C skeleton will provide access to input samples, output samples, and interrupt handling code. You will add code to transfer theinputs and outputs (in blocks at a time), apply a hamming window, compute the magnitude-squared spectrum, and include a trigger pulse.After the hamming window is created, either an assembly or C module that bit reverses the input and performs an FFT calculation is called.

As your spectrum analyzer works on a block of samples at a time, you will need to use interrupts to pause your processingwhile samples are transferred from/to the CODEC (A/D and D/A) buffer. Fortunately, the interrupt handling routines havebeen written for you in a C shell program available at v:\ece420\55x\lab4\main.c . For this lab, you will be working with the code available at v:\ece420\55x\lab4 .

Interrupt basics

Interrupts are an essential part of the operation of any microprocessor. They are particularly important in embeddedapplications where DSPs are often used. Hardware interrupts provide a way for interacting with external devices whilethe processor executes code. For example, in a key entry system, a key press would generate a hardware interrupt.The system code would then jump to a specified location in program memory where a routine could process the key input.Interrupts provide an alternative to polling. Instead of checking for key presses at a predetermined rate (requires aclock), the system could be busy executing other code. On the TI-C55x DSP, interrupts provide a convenient way totransfer blocks of data to/from the CODEC in a timely fashion.

Interrupt handling

The main.c , dma.c , and lab4.c code are intended to make your interaction with the hardware much simpler. These files handle the the buffering of data using interrupts from the CODEC (A/D and D/A) and the USB port. Here, wewill describe the important aspects of the code necessary to complete the assignment.

In the first few labs, data was processed on a sample-by-sample basis, so no buffering was necesary. However, the spectrum analyzer to be implemented in this lab works over a block of N 1024 samples. If it were possible to compute a 1024-point FFT in the sample time of onesample, then no additional interrupt handling routines would be necessary. Samples could be collected ina 1024-length buffer and a 1024-point FFT could be computed uninterrupted while the buffer fills.Unfortunately, the DSP is not fast enough to accomplish this task.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Digital signal processing laboratory (ece 420 55x). OpenStax CNX. Jan 18, 2010 Download for free at http://cnx.org/content/col10397/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital signal processing laboratory (ece 420 55x)' conversation and receive update notifications?

Ask