The second type of filters after IIR filters are FIR filters(Finite Impulse Response i.e. h[n] has finite length). The inherent advantage these filters possess is stability. After passing Ap,As,fp and fs in the code, it automatically calculates the filter order and the window type used. All window functions namely Rectangular,Bartlett,Hanning,Hamming and Blackman were analyzed. The window type is obtained from the attenuation in stopband(As). Here, inverse-DTFT of the ideal filter design is done to obtain desired h[n],after which it is multiplied with the suitable window function to obtain the final output. For sharper frequency transitions from pass band to stop band, ripples are obtained in the frequency response. h[n] obtained is symmetric.
Informative content.
ReplyDeleteCheck out MATLAB's documentation on FIR Window functions.
Deletewell explained
ReplyDeleteRefer to TI's documentation for implementation.
Deletewhich is best windowing method?
ReplyDeleteIt depends upon the application as well as the characteristics you want in your filter that has to be designed.
DeleteThe windowing method depends on your input paramters.
DeleteIf you closely observe the frequency spectrum, the side lobes are more. These side lobes are not advisable. Based on this criterion you should select your filter.
I had implemented a digital FIR filter using Hamming Window for ECG analysis. But the side lobes were more. Hence stopband attenuation was non-uniform.
For practical application avoid sharper transition band as int increase the side lobes.
Which window has least errors?
ReplyDeleteErrors depend on the practical application. Blackman filter,for example has highest stopband attenuation. Hence, there are least chances of errors. However, if the transition band width is reduced , more side lobes are observed. Hence , window functions should be selected after observing the frequency spectrums.
Deletewhich method is better?
ReplyDeleteWhile comparing Windowing and FSM methods , FSM is preferred. FSM involves DFT which has discrete frequency computations compared to IDTFT in windowing method.
DeleteFIR requires more storage than IIR Filters
ReplyDeleteFloating point computation is another issue.
DeleteBlackman window function has the highest attenuation out of the ones mentioned in the blog
ReplyDeleteBlckman window's passband is flat and that is a disadvantage.
Deleteblackman window gives the highest attenuation in stopband.
ReplyDeleteTrue. It's not the best for all applications though.
DeleteAll window functions have to be analyzed for obtaining the best output
ReplyDeleteYes. Comparative analysis of stopband attenuation is necessary.
Delete