2015-10-21 10:42 PM
Hello,
Sorry for my poor english first. I tried to run few project packaged in peripheral driver provided by ST. It was audio playback and recording. My intention is monitoring raw PCM data after PDM processing. Here spi interrupt handlervoid AUDIO_REC_SPI_IRQHANDLER(void)
{
u16 volume;
u16 app;
/* Check if data are available in SPI Data register */
if (SPI_GetITStatus(SPI2, SPI_I2S_IT_RXNE) != RESET)
{
app = SPI_I2S_ReceiveData(SPI2);
InternalBuffer[InternalBufferSize++] = HTONS(app);
/* Check to prevent overflow condition */
if (InternalBufferSize >= INTERNAL_BUFF_SIZE)
{
InternalBufferSize = 0;
volume = 50;
PDM_Filter_64_LSB((uint8_t *)InternalBuffer, (uint16_t *)pAudioRecBuf, volume , (PDMFilter_InitStruct *)&Filter);
Data_Status = 1;
}
}
}
And i placed my code after data_status = 1
for(i=0;i<buffer_size;i++)
pcm_index[i]=*(pAudioRecbuf + i)
And then send serially pcm_index to pc. Is it right way to get the pcm output data? I implemented this, and then look raw data and build to wav file in matlab. I got just like noise, anything i did i always get noise like. So please tell me right way to do this
Thanks so much
#audio-playback-and-recording
2015-10-23 12:08 AM
little disappointing there is no answer my question, maybe it`s so noob topic :( .I got the code worked and i found there was issue in serial terminal. Since i changed that, i can saw the data dan plot it with matlab. Thanks for any appreciate before