This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Code Composer 3.3 Graph, Real Time Refresh, and Sampling Help



Hello.

I am using the OMAP L137 with Code Composer 3.3. I am generating code using Simulink Embedded Coder for an active noise cancellation project.

At this point all I am trying to do is view the digital input to my system after A/D conversion of an audio signal picked up by an electret microphone. The procedure is as follows:

1. I generate a sine wave of some frequency (say 200 Hz) using MATLAB and blast it out of speakers connected to the computer.

2. The microphone picks up the audio signal, is amplified, and then fed into the audio input of the OMAP. I verify the analog signal recorded by the mic is a 200 Hz sine wave using an oscilloscope.

3. I am sampling at 8 kHz. I am using sample by sample processing but am also using a separate buffer of 512 samples for the sole purpose of storing the input values. I view the time / frequency plot of my input signal and it is a sine wave but of a HIGHER frequency. Why is that?

Here are the graphs:

The axis of the time plot is in seconds. The period of a 200 Hz sine wave is 0.005 s, so the time graph is clearly wrong. The frequency plot indicates a tone at about 593 Hz, nearly 3 times the actual value of the sine wave frequency. I have tested this with other frequencies, and the graphs are consistently wrong by this factor of around 3.

I have read on some posts that may be related including topics about:

-Bypassing the minimum real time refresh of 100 ms

-How graphs can look wrong because of skipped values because Code Composer cannot update fast enough

So my main concerns are:

Why is the digital signal showing a higher frequency?

Am I able to record every data input value that occurs after each sampling time? What I am saying is, after every (1/8000) seconds, can I view the digitized sample at that time?

When I step through one iteration in my code, and the A/D value updates, is that the value corresponding to the next sample after (1/8000) seconds or is it corresponding to an update every 100ms (the limitation on the real time refresh)?

Thank you for any help you can provide.