<< Chapter < Page Chapter >> Page >

At the heart of the hardware interaction is the auto-buffering serial port. In the auto-buffering serial mode, the TI-C54xprocessor is able to do processing uninterrupted while samples are transferred to/from a buffer of length BlockLen 64 samples. 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 one BlockLen , 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 auto-buffering buffer fills.Unfortunately, the DSP is not fast enough to accomplish this task.

We now provide an explanation of the shell C program lab4main.c listed in Appendix A . The lab4main.c file contains the function interrupt void irq and a main program. The main program is an infinite loop over blocks of N 1024 samples. Note that while the DSP is executing instructions in this loop, interrupts occur every BlockLen samples. Inside the infinite loop, you will insert code to do the operations whichfollow. Although each of these operations may be performed in C or assembly, we suggest you follow the guidelinessuggested.

  • Transfer inputs and outputs (C)
  • Apply a Hamming Window (C/assembly)
  • Bit-reverse the input (C and assembly)
  • Apply an N -point FFT (C and assembly)
  • Compute the magnitude-squared spectrum (C/assembly)
  • Include a trigger pulse (C/assembly)

The function WaitAudio is an assembly function in the core code which handles the CODEC interrupts. An interrupt from the CODECoccurs every BlockLen samples. The SetAudioInterrupt(irq) call in the main program tells the core code to jump to the irq function when an interrupt occurs. In the irq function, BlockLen samples of the A/D input in Rcvptr (channel 1) are written to a length N inputs buffer, and BlockLen of the output samples in the outputs buffer are written to the D/A output via Xmitptr on channel 2. In C, pointers may be used as array names so that Xmitptr[0] is the first word pointed to by Xmitptr . As in the assembly core, the input samples are not inconsecutive order. The right and left inputs are offset from Rcvptr respectively by 4 i and 4 i 2 , i 0 , …, BlockLen 1 . The six output channels are accessed consecutively as offsetsfrom Xmitptr . On channel 1 of the output, the input is echoed out. You are to fill the buffer outputs with the windowed magnitude-squared FFT values by performing the operationslisted above.

In the main code, the while(!input_full); loop waits for N samples to collect in the inputs buffer. Next, the N inputs and outputs must be transferred. You are to write this portion of code. This portion of code is tobe done first, within BlockLen sample times; otherwise the first BlockLen of samples of output would not be available on time. Once this loop isfinished, the lengthy processing of the FFT can continue. During this processing, the DSP is interrupted every BlockLen samples to transfer samples. Once this processing is over, the infinite loop returns to while(!input_full); to wait for N samples to finish collecting.

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). OpenStax CNX. Sep 27, 2006 Download for free at http://cnx.org/content/col10236/1.14
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)' conversation and receive update notifications?

Ask