0

i have equation like for example A(W) = isin(2pi*w) in frequency domain (it can be anything)

that have arbitrary amplitude and phase response.

i usually make symmetric structure in real part and asymmetric in imagine part and i do ifft to get real coefficient

is it right?

when i get filter coefficient like this. the zeropadding and DFT have gibb's Phenomenon

what is best method to get fir filter

gg h
  • 101
  • 5

1 Answers1

1

Creating filters from the inverse DFT (ifft) is the "Frequency Sampling" method of filter design. Although this is a very intuitive approach once we learn that the coefficients of an FIR filter is the impulse response of the filter, and the Fourier Transform of an impulse response is the frequency response. However such an approach suffers from time domain aliasing (when the ideal impulse response needed exceeds the total memory of the filter; the total number of coefficients). The frequency response (which is a continuous function in frequency) will notably be EXACT to the target magnitude and phase in the frequency domain at all the bin centers of the corresponding DFT, but the time domain aliasing results in an increase in error from the target frequency response for all the frequencies in between the bin centers, and thus will have increased passband ripple and decreased rejection compared to other approaches to filter design.

The Frequency Sampling method of filter design is applicable for applications when our interest is in specific frequencies (such as OFDM) but for any other application where we want a continuous frequency response the results are inferior to other filter design methods such as the optimized algorithms known as Parks-McClellan (equi-ripple) and Least Squares. The Parks-McLellan algorithm which minimizes peak error can be implemented with the MATLAB function firpm and Octave/Python scipy.signal function remez. The Least Squares algorithm which minimizes rms error can be implemented with the firls command in those same tools.

Windowing the samples of an ideal impulse response (as determined from the continuous time Inverse Fourier Transform of a target frequency response; for example a brick-wall filter response would have a Sinc function as the impulse response) can also be very effective, and for this I recommend the Kaiser window as detailed in these other posts:

High Dynamic Range FIR Filters

FIR Filter Design: Window vs Parks McClellan and Least Squares

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135
  • Thank you. i have one question. if i get symmetric frequency response(frequency sampling method) and i do signal processing in frequency domain. i don't need to consider the causal or non-causal?? – gg h Feb 07 '22 at 03:28
  • 1
    @ggh it will always be causal in implementation: if you do it in the frequency domain, you will need to buffer the data in order to take the fft or inverse fft. So if you question is if you need to actually add the linear phase shift in the frequency domain, the answer is no, you can implement it as a zero-phase filter. If you take the ifft to determine the time domain impulse response, using ifftshift() will move the dominant tap to the center of the array (causal). You already received answers to your question on that posted elsewhere- if you are still confused you should comment there. – Dan Boschen Feb 07 '22 at 05:02
  • ah.....you mean in real time. even if i have zero phase filter in frequency domain, to multiply i have to collect M block(block fft size) and that is mean delay right?. – gg h Feb 07 '22 at 05:09
  • yes that is correct. – Dan Boschen Feb 07 '22 at 06:19
  • Thank you so much – gg h Feb 07 '22 at 06:30
  • Could you answer my new question please? https://dsp.stackexchange.com/questions/81424/non-causal-cascade-filtering-process-in-frequency-domain – gg h Feb 08 '22 at 07:46