IIR Filter with SDK doesn't work properly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IIR Filter with SDK doesn't work properly

1,824 Views
Lapo
Contributor I

Dear to all forum,
I have a some problems with implentation of an IIR filter via SDK DSP library. 
I started a new project with these :

1) Motorola  MC56F8357EVM board
2) CodeWarrior 5.5.1v
3) Processor expert v 2.93 for Motorola 56800 family.

So I generated a simple sinusoid at 50Hz with 8000 Hz of sample frequency and then I filtered it but sometime the filter doesn't not work well.

I extract the following IIR filter from help docs of processor expert.

/* The order of coefficients : a2,a1/2,b0,b1,b2 for each biquad

   Note that |b0|,|b1| and |b2| ahould all be lesser than 1.

   Test Case Filter Specifications:
   Type: Chebychev2
   Order: 4
   Passband edge: 1000Hz
   StopBand Edge: 2000Hz
   Maximum Ripple in PassBand: 1db
   Attenuation in Stopband : 30db
   Sampling Frequnecy: 8000Hz

const Frac16 IIR_Coef_F1[] =
{
FRAC16(-0.1310),     /* a2*/
FRAC16(0.27805),     /* a1/2*/
FRAC16(0.1808),      /* b0*/
FRAC16(0.2133),      /* b1*/
FRAC16(0.1808) ,     /* b2*/

FRAC16(-0.6107),     /* a2*/
FRAC16(0.4944),      /* a1/2*/
FRAC16(0.3892),      /* b0*/
FRAC16(-0.1566),     /* b1*/
FRAC16(0.3892)       /* b2*/
};

The first problem is: How I can generated these coefficient? I tried with QEDESign Lite sw but the results  doesn't macth? Why?

The second problem is when I set the sinusoid amplitude to 1 value. Infact the filter output is something strange not so close to be considered a sinuosid.

 Are there some problem with use of Frac16?  Some saturation problem are possible?
This problem disappear if I set the amplitude sin to 0.5 or less.

The third problem is the following. When I generated a sinusoid outide the passband filter (for example 1500Hz) the output isn't close to zero value. So the filter doesn' t kill the sin.

I attached the entire project  generated vith processor expert. It is in zip  format

Thank in advance for any help you will give to me!
Please It's very urgent.

Sw Eng
Francesco Chirico
Mer Mec Spa

 

Test_Esempio_IIR_CodeW.zip

Message Edited by t.dowe on 2009-10-15 05:41 PM
Labels (1)
Tags (1)
0 Kudos
1 Reply

257 Views
trytohelp
NXP Employee
NXP Employee
Hi,
 
You're using an old version.
The DSC V8.2 is availale.
On this version there is the Processor Expert 2.98.03 for Freescale 56800/E.
Can I suggest you to check with this version ?
 
See below details to download it:
Freescale 56800/E Digital Signal Controllers Version 8.2
You can download this version on our web site via the link:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=CWS-568-CX#
The Special edition license is installed by default.
If you need another version of the license please contact your local distributor.
You can have several versions installed on the same PC.
There is only one restriction: install them on separate folder.
If you're using an old version, please backup your project before to try it with this new version.
If you will meet some compatibility issue you could back to the older version without problem.
Regards
Pascal
0 Kudos