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.
Tool/software: TI-RTOS
Hi experts,
I want to use MCASP_Audio example to perform the FFT on RX samples. So in processing part I copy samples from the buffer to array 'x'.
memcpy((void*)(px),(void *)((uint8_t *)appBuf_ptr_rx->buf),rx_frame_size);
Then I can see that always 4 samples both from left and right channels are the same, for example:
0x8006A478: 0150C35E 017CD506 0150C35E 017CD506 0150C35E 017CD506 0150C35E
so the graf looks like (4 left and 4 right samples are on the same level always):
So I don't really can get FFT without harmonic distortion for pure sin. Do you have any suggestions?
Hi, thanks for your replay.
This is the case: I generate sine wave on my PC and want to analyze it on DSP with FFT.
I generated pure sine wave but AIC codec provided with the same value samples 4 times in a row. So, in example, when my sampling frequency is 44kHz and generated sine wave is 44 / 8 = app. 5 kHz I can see only two levels of samples: high and low - it looks like square signal. So 3 other samples are gone somewhere.
(Here is some envelope present because I generated not exactly fs/8 Hz)
Could You explain why those 4 samples are the same? (both for left and right channel - so we see 8 of them) or what I'm doing wrong?
As I understanded, in biquad example processing is done like there is continuity in derived samples.
And also when I copy it back to TX it sounds like it is sine wave. So I don't really understand that.
Ok, so it took my 2 weeks to find a problem. I'm a little tardy a guess.
There is a bug in pdk_am57xx_1_0_13 I think?
It's In Aic31 Bios Codec Driver. Initialization of sampling rate doesn't work. I can recall that I thought at first that the example that sound quality was bad (so now I know that it was low sample rate).
On beagleboard-x15 codec has to be in slave mode and mcasp on master because of connections (only one rx).
Function "AIC31SampleRateConfig()" is never called because it's under if-check in Init function (aic31.c file):
if (ICodec_OpMode_MASTER == instHandle->acOpMode) { AIC31SampleRateConfig(instHandle->acBaseAddress, AIC31_MODE_BOTH, acChanConfig->samplingRate); }
So when this driver operates in slave mode AIC3104 codec works with default sampling rate which is 4 times slower (for default 44100 KHz config) because "Q divder" is not initilized.
To repair that I had to add else statement and also change one line for SLAVE configuration (in SampleRAteConfig func):
//CodecRegWrite(baseAddr, AIC31_P0_REG8, 0xD0); //MASTER CodecRegWrite(baseAddr, AIC31_P0_REG8, 0x00); // SLAVE