Tool/software: TI-RTOS
Hi, I used the PDM example in TI-RTOS for CC2650, I want to test how far the mic can sense so I basically test the sound signal's amplitude the mic picks up. I have the following questions:
1). Does pPCMsamples[i] store the raw PCM sound data?
2). I use the following code to test the sound signal amplitude
for (i = 0; i < numOfSamples; i++){
audioAverage=pPCMsamples[i]/numOfSamples;
audioSum=audioSum+audioAverage;
}
which is quiet simple, this block of code is within the function SA_envelopeDetector. I test the sound signal's amplitude by returning the var 'audioSum'.
Am I doing right?
3). What is now confusing me is that in a quiet environment, the audio amplitude can be large while in the noisy environment this amplitude is small. I got this experiment result by setting up breakpoints at the function SA_envelopeDetector, and debug to see the result( I do not have UART hardware)like following,
current= SA_envelopeDetector((int16_t *)bufferRequest.buffer->pBuffer, AUDIO_BUF_UNCOMPRESSED_SIZE);
I observe tha change of variable current to see the amplitude of the sound signal.
I don't know if this is right for debugging an app based on RTOS?