<< Chapter < Page Chapter >> Page >
In this section, we will go over the C code we used for the DSK board and the options for the signal input in testing the algorithm.

Code description

Our final implementation for the DSP board is written in C, and consists of two major functions, the interrupt serviceroutine and the main function. The samples arrive and are put into a buffer for each microphone channel by the McBSP1receive interrupt routine. This function keeps track of how full the buffers are, and sets a flag when they are full. Themain function waits for the buffer full flag, and processes the contents of the buffers when the flag is set. Thealgorithm is the same as the signal integration method described in the Matlab Simulation section. The code keeps an average of the last 128 region codes selected, which is the value that is output on the DSPboard's LEDs.

Signal input options

For our signal input, we have two options:

  • Ideal Signal generated in Matlab
  • Real signal from the microphone array.
To thoroughly test this algorithm, we tried both options, starting with the ideal signal, since this would help us indebugging. Later, we tried using a real signal, generated from a computer across the room. Unfortunately, within thisoption lies the danger of acoustics; the answer the algorithm gives us will even depend on the number of people in the room!

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Audio localization. OpenStax CNX. Jun 06, 2011 Download for free at http://cnx.org/content/col10250/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Audio localization' conversation and receive update notifications?

Ask