amplitude of passband frequencies in FIR bandpass filter

Started by 5 years ago9 replieslatest reply 5 years ago407 views

Hi all

I wanted to generate broadband noise of specific amplitude for my simulations. To do so, i generated a random noise using MATLAB randn command and then design FIR filter using fir1 command to get filter coefficients against desired pass band frequencies and then apply filter on random noise using these coefficients. To check whether i got the desired band limited noise, i applied FFT on filtered data and the output was band limited according to desired specifications.

However, on more requirement is that pass band frequencies should have certain amplitude level, say x dB. I am lost how to do it?. Is there any way to design filter coefficients such that i got desired x dB levels in filtered output i.e. how to control amplitude levels of frequencies in pass band?

Thanks

[ - ]

Amplitude level in dB is only relevant as ratio to stop band. This is purely related to filter performance irrespective of any scaling (within reason). If you mean controlling gain of filter then you need to scale it and this depends whether it is low pass, high pass or band pass. Doing fft on filtered output could be misleading due to fft scaling itself which in turn is related to fft size.

[ - ]

Absolute amplitude matters if there's some nonlinear process -- even if it's "just digital" like truncation or saturation.

But if the OP is assessing purely linear phenomenon, then yes, the absolute amplitude doesn't matter.

[ - ]

Yes amplitude does matter but the op is about how to control filter scaling.

The best way and since they do offline fft is to do fft of input and fft of output then get power ratio of output to input and scale filter by square root of power ratio.

This applies to any filter(low pass or high pass or bandpass). The best input is just an impulse or random noise. Practically better input may be the expected input in the application as this may be used to tailor the gain specifically for the system.

[ - ]

Are you trying to scale the different pass band frequencies differently (1), or just normalize the pass band gain for all frequencies (2)?

If the answer is (2), the solution is quite easy, just multiply the data by a normalizing factor, either before or after the filter (quantization concerns for fixed point processing tends to dictate after). Alternatively you can multiply all of the filter coefficients by the normalizing factor, instead of the data.

If the answer is (1), then you need to be able to pass your frequency/gain pairs into the filter design tool, and then the resulting filter coefficients should be optimized for your custom response. Matlab has several options for this.

Regards, Tim

[ - ]

Thanks Tim for reply. I am working on it

[ - ]

Naumankalia-

Are you saying you need multiple passbands, each with different amplitude ?  If so that would be arbitrary frequency response FIR filter design.  You can do a search on the Parks-McClellan design method.  I'm pretty sure MATLAB supports that.

-Jeff

[ - ]

Thanks

[ - ]
Hi naumankalia. Perhaps the material at the following link will be of some use to you:

https://www.dsprelated.com/showcode/263.php
[ - ]