Hi,
I am not familiar with verilog code and now it is required for me to write a code for 2nd order IIR bandpass filter with cut off frequency 250Hz connecting modules of addee , multiplier and dff in verilog. A N-bit digital signal is an input to the 2nd order IIR lowpass filter. I would really appreciate any kind of help.
You'll start with setting up the z-domain transfer function and decide for a filter form.
An important parameter is the ratio of sampling frequency to BPF center frequency. It determines the required extra bit width of internal registers above output data length. In case of a standard 2nd order IIR structure, the bit width is growing with (fs/fc)^2.
Look up "biquad IIR". FPGA tools may have some building blocks (I know they have FIR blocks) for this. Biquad IIR is a very common building block. Cascade them in series to get higher order filters. You can find several tools online for generating Z zomain biquad coefficients from S domain coefficients. Or see the bilinear transform and implement it yourself:
@FVM I don't understand there to be a direct relationship between sampling frequency and bits. I see extra bits as optionally adding precision (particularly when there is a wide range between coefficients), but some rounding errors may be fine.
You see the relation when you look at the filter coefficient range for different fs/fc orders of magnitude and calculate how many extra bits are necessary to keep the filter resolution.
Maybe Delta14 can give some key paramers of his application. He's talking about a single cutoff frequency related to BPF which makes no sense.
I'm not aware of IIR IP from major FPGA vendors. Intel FIR compiler is free with recent Quartus versions.