Implement IIR Filter on FPGA

hi people,

I'm designing filter system called IIR filter on the FPGA kit, but it doesn't work when I implement on FPGA. When i iput the signals, the output results seem to not get any thing. I do not know whether my source code is wrong or another reason. The FPGA kit operate normally with other sources which i loaded in the past.

Can anyone give me some advices to test what parts in my project do not work or give me some idea to test anything. I am in the mess. I hope everyone can show me.

I am looking forward hearing from people soon,

Reply to
Gordon Freeman
Loading thread data ...

Simulate your design.

Watch the values change in the accumulators as you add and subtract the input values.

Reply to
John_H

Hi everyone! Thank you for your reply! I used ModelSim to simulate. The result is the same when I canculate by calculator. But when I implement on FPGA, it don't work too. I design IIR filter with 10 orders. I use Matlab to generate coefficients for filter (b(k) and a(k)). For coefficient "b", I multiply with 2^14 and multiply with 2^5 for coefficent "a". After that I round them. These coefficients stored in LUT. I use SDA for filter. Because I think IIR filter include tow FIR filter. One filter with coefficient "b" and one with coefficient "a". Is it right?

Reply to
Gordon Freeman

Check your synthesis log to make sure your design did not get 'optimized' away. If you forgot some control signals somewhere, it is possible that synthesis deduced that some of your design had static elements, removed them to optimize, then deduced that everything else is now unconnected and removed that as well.

BTW, also make sure your VHDL agrees with your board's reset polarity.

Reply to
Daniel S.

Hi. Thank you for your reply. I design it by myself and RTL coding in Verilog and I implement it on Xilinx FPGA (XC3S400). I use Matlab to generate coefficients. And this is the code:

% All frequency values are in Hz. Fs = 48000; % Sampling Frequency

N = 10; % Order Fpass1 = 3000; % First Passband Frequency Fpass2 = 6000; % Second Passband Frequency Apass = 1; % Passband Ripple (dB) Astop = 80; % Stopband Attenuation (dB)

% Construct an FDESIGN object and call its ELLIP method. h = fdesign.bandpass('N,Fp1,Fp2,Ast1,Ap,Ast2', N, Fpass1, Fpass2, ... Astop, Apass, Astop, Fs); Hd = ellip(h);

% Get the transfer function values. [b, a] = tf(Hd);

The result:

a(k) =

-8.0088

30.2376

-70.5488

112.3786

-127.5439

104.4117

-60.9016 24.2544

-5.9702 0.6931

b(k) = 0.0004 -0.0019 0.0040 -0.0050 0.0036 0.0000 -0.0036 0.0050 -0.0040 0.0019 -0.0004

After that:

round(a(k)*2^5)=

32

-256

968

-2258

3596

-4081

3341

-1949

776

-191

22

round(b(k)*2^14)=

7

-31

65

-82

59 0

-59

82

-65

31

-7

The filter output result will be divide by 2^5 * 2^14.

And filter structure is Direct Form I and this is biquads.

I think it run into overflow errors, too. But I don't know how can I modify it.

Can you help me, please?

Reply to
Gordon Freeman

If it is a cascade of five 2nd-order filters, as you suggest, then start by implementing a SINGLE biquad. Simply change N from 10 to 2 to generate an optimal coefficient set for a 2nd order filter.

Once you have a single biquad working, then you can start to cascade them. I'd go 4th order, then 10th order if you have enough information about what's gone wrong here.

- Brian

Reply to
Brian Drummond

A 10th order filter is very prone to overflows because some sections will have a high Q factor. You said you simulated the design; try to do that again with a maximum amplitude input signal and see what happens.

It is probably better to create several 4th order filters and cascade these. However, this may deteriorate the filtering result.

--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
Reply to
Nico Coesel

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.