scalar IIR filter problem

Hi ,

I'm working on application on sharc dsp cores sc484 to modulate an audio  signal received by adc then to send it via dac using AD1938 I used the exemple asrc_playback . So I genrate correctly on DAC  the modulate signal. Now I have problem when I trying to implement a scalar FIR or IIR high pass filter using the library filter.h . below you find the boot code of the modulation+filtre processing:

for(i=0; i<AUDIO_BUFFER_SIZE;i++)
short IN_Fix_Data[AUDIO_BUFFER_SIZE]; 
IN_Fix_Data[i] = *pSrc++;

IN_Float_Data[i] = (float)IN_Fix_Data[i];

OUT_Float_Data[i] = 1.0 * IN_Float_Data[i];

sdb_output[i] = (0.5+((0.4)* OUT_Float_Data[i])) * tab_96[i]; //modulation
//y[i] = fir(sdb_output[i], taps_coef, state, SAMPLEFILTER_TAP_NUM);//  fir  filter
y[i] = iir(sdb_output[i], taps_coef_a,taps_coef, state, SAMPLEFILTER_TAP_NUM);

*pDst++ =y[i];



return (0u);

The problem that I'dont have the expected signal on the DAC after filter. Do you have any idea about this problem is it related to the coeficient that I'm using ?

how to generate the coeficients a and b for filter IIR function?


Could you help me please? it is urgently.



  • Hello,

    I understand that you are not able to get the correct signal on DAC after filtering. You mentioned, "Do you have any idea about this problem is it related to the coefficient that I'm using ?". Can you let us know how you are generating the filter coefficients. Are you using any filter coefficient generating tool like MATLAB or GNU Octave?

    Were you able to get it working without any modulation? Note that the filter coefficients(a and b) for IIR and FIR filter has to be provided in a specific sequence to these library functions failing to which the output will not be correct.

    I would suggest you to refer DSP runtime library reference to know more about these API's. You can navigate as below.

    CCES->Help->Help Contents->CrossCore® Embedded Studio 2.8.0 > SHARC® Development Tools Documentation > C/C++ Library Manual for SHARC® Processors > DSP Run-Time Library > DSP Run-Time Library Reference

    Apart from this, I am attaching a simple IIR filter(scalar version) code. Hope this can be incorporated into your project.

    BTW, did you get any chance to look at the ADSP-SC58x/218x Audio Talkthrough Example code for EZ-kit available in the below link. This is a C bare metal code where SHARC1 core configures the ADC/DAC receives data from ADC over sport and copies them to DAC buffers to be played by DAC.

    Best Regards,