Technical discussions about Freescale (Motorola) DSPs (including the DSP56000, DSP56300, DSP56600, 56800 DSPs).
|
Hello, I am new to the group as well as to the Motorola DSP56858EVM. I am trying to implement a simple IIR filter, but it is not working properly (i.e. the cutoff frequency is not where it is supposed to be). If someone could help I would very much appreciate it and hope to repay the favor in the future. Here are the specifics. Lowpass IIR, second order, Fc = 200 Hz. Coefficients from Matlab: b0=8192, b1=16384, b2=8192, a0=32767, a1=- 32768, a2=26241 relevant code: //initializations const Frac16 LP_io_filter[5] = {26241, -16384, 8192, 16384, 8192}; UInt16 nbiq=1, block_size=16; dfr16_tIirStruct *pIIR_lp; int i = 0; //processing //input is read from codec void process(Frac16 *input_buffer, Frac16 *output_buffer) { if(i==0) { this++; pIIR_lp = dfr16IIRCreate ((Frac16 *)&LP_io_filter[0],nbiq); } dfr16IIR (pIIR_lp, input_buffer, output_buffer, block_size); } //output is written to codec I know it isn't working properly because I injected white noise into the codec and viewed the output spectrum with Cool Edit Pro to see that Fc appeared to be around 1000 Hz. I've been struggling with this isssue for a few days now and could really use a hand. Thank you! Rob |
|
|
|
Hi Rob, I would suggest you to go to http://e-www.motorola.com/cgi-bin/faq.cgi and write "IIR" in the Search box. Then you can downnload a project example of how to implement IIR filters for the 56858EVM. It also allows you to use Matlab to generate data that can be read using SDK´s File I/O. Best regards, Fabio Estevam -----Original Message----- From: rwolfbrandt [mailto:] Sent: terça-feira, 29 de outubro de 2002 19:54 To: Subject: [motoroladsp] IIR filter usage with DSP56858EVM Hello, I am new to the group as well as to the Motorola DSP56858EVM. I am trying to implement a simple IIR filter, but it is not working properly (i.e. the cutoff frequency is not where it is supposed to be). If someone could help I would very much appreciate it and hope to repay the favor in the future. Here are the specifics. Lowpass IIR, second order, Fc = 200 Hz. Coefficients from Matlab: b0=8192, b1=16384, b2=8192, a0=32767, a1=- 32768, a2=26241 relevant code: //initializations const Frac16 LP_io_filter[5] = {26241, -16384, 8192, 16384, 8192}; UInt16 nbiq=1, block_size=16; dfr16_tIirStruct *pIIR_lp; int i = 0; //processing //input is read from codec void process(Frac16 *input_buffer, Frac16 *output_buffer) { if(i==0) { this++; pIIR_lp = dfr16IIRCreate ((Frac16 *)&LP_io_filter[0],nbiq); } dfr16IIR (pIIR_lp, input_buffer, output_buffer, block_size); } //output is written to codec I know it isn't working properly because I injected white noise into the codec and viewed the output spectrum with Cool Edit Pro to see that Fc appeared to be around 1000 Hz. I've been struggling with this isssue for a few days now and could really use a hand. Thank you! Rob _____________________________________ /groups.php3 |
|
Hi Rob, This can also help you. In this project (...EmbeddedSDK\src\dsp56824evm\nos\applications\nbfilter) data is received by codec, IIR filtered and then sent back to codec. Hope this helps. Best regards, Fabio Estevam -----Original Message----- From: rwolfbrandt [mailto:] Sent: terça-feira, 29 de outubro de 2002 19:54 To: Subject: [motoroladsp] IIR filter usage with DSP56858EVM Hello, I am new to the group as well as to the Motorola DSP56858EVM. I am trying to implement a simple IIR filter, but it is not working properly (i.e. the cutoff frequency is not where it is supposed to be). If someone could help I would very much appreciate it and hope to repay the favor in the future. Here are the specifics. Lowpass IIR, second order, Fc = 200 Hz. Coefficients from Matlab: b0=8192, b1=16384, b2=8192, a0=32767, a1=- 32768, a2=26241 relevant code: //initializations const Frac16 LP_io_filter[5] = {26241, -16384, 8192, 16384, 8192}; UInt16 nbiq=1, block_size=16; dfr16_tIirStruct *pIIR_lp; int i = 0; //processing //input is read from codec void process(Frac16 *input_buffer, Frac16 *output_buffer) { if(i==0) { this++; pIIR_lp = dfr16IIRCreate ((Frac16 *)&LP_io_filter[0],nbiq); } dfr16IIR (pIIR_lp, input_buffer, output_buffer, block_size); } //output is written to codec I know it isn't working properly because I injected white noise into the codec and viewed the output spectrum with Cool Edit Pro to see that Fc appeared to be around 1000 Hz. I've been struggling with this isssue for a few days now and could really use a hand. Thank you! Rob _____________________________________ /groups.php3 | |||
|