DSPRelated.com
Forums

Help on filtering block of audio samples by C6713 DSK

Started by charles wimbel October 19, 2007
Hi All,

Based on the dsk_app example of the C6713, I am trying to do some multirate signal processing on the audio signals.

I use the Int32 type audio samples that the example provides.

I also have my filter coefficients as Int16.

Here is my filter code:

blksize is the numner of samples in the block of input samples.
taps is the number of taps in my filter
data is the input
coeffs is the impulse response.
void cfir(Int32 *data, Int16 *coeffs, Int32 *results, Int16 taps, Int16 blksize)
{
Int16 i,j;
long int temp1,temp2;
for (i = 0; i < blksize; i+=2)
{
temp1 = 0;
temp2 = 0;
for (j = 0; j < taps; j++)
{
temp1 += data[i+j] * coeffs[j];
temp2 += data[i+j+1] * coeffs[j];
}
results[i] = (temp1 >> 15);
results[i+1] = (temp2 >> 15);
}
}
The output audio is destorted.
I wonder if my filter code is wrong.
Can someone help me verify this?

I use a fixed input and impulse to generate the output in MATLAB.
I use the conv command.
The results I get from MATLAB are deifferent from what I get from the DSK.
I check the data inside DSK using watch window.
Why?
My audio signal is not too distorted.
It is ok but not perfect.
I do not no what to suspect.

Any comment or help is highly welcome.

Thanks in advance