Our final implementation for the DSP board is written in C, and consists of two major functions, the interrupt service routine and the main function. The samples arrive and are put into a buffer for each microphone channel by the McBSP1 receive interrupt routine. This function keeps track of how full the buffers are, and sets a flag when they are full. The main function waits for the buffer full flag, and processes the contents of the buffers when the flag is set. The algorithm 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 DSP board's LEDs.




