I am trying to implement several filters in Matlab for Fourier domain filtering. They are the cosine, Shepp-Logan, and Hann/Hamming window filters. These filters are defined as multiplying the ramp filter by the cosine function, sinc function, and Hann/Hamming windows respectively.(adsbygoogle = window.adsbygoogle || []).push({});

This is how the responses of these filters should look like:

However, this is what I am getting:

I have defined the filters exactly as they are defined in this Matlab function, with a parameter ##d## that stretches the filters:

For instance, if I change it to ##d=0.3##, the Hann/Hamming filters start to look correct. And at ##d=0.65##, the cosine filter looks more correct:Code (Text):w=linspace(0, 1, 181).'; % Frequency axis

d=0.33;

Hr = abs(w); % Ramp filter

H=Hr.* cos(w/(d)); % Cosine filter

H(H<0) = 0;

H=Hr.* (sin(w/d)./(w/d)); % Shepp-Logan filter

H(H<0) = 0;

H=Hr.* (1+cos(w./d)) / 2; % Hann filter

H(H<0) = 0;

H=Hr.* (.54 + .46 * cos(w/d)); % Hamming filter

H(H<0) = 0;

So, what is the justification for using the parameter ##d##? And is there an algorithm for calculating it accurately for each filter?

Any explanation would be greatly appreciated.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Frequency domain filtering in Matlab

Tags:

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads - Frequency domain filtering | Date |
---|---|

Comsol frequency domain | Dec 15, 2013 |

What's negative frequency in analysis of s domain and w domain | Feb 13, 2013 |

Magnitude in frequency domain of Fourier Transform situation | Nov 14, 2012 |

Understanding the Image output in Frequency Domain | Sep 28, 2012 |

Filter DC offset - apply High-pass filter (in time-domain or frequency domain?) | Nov 19, 2011 |

**Physics Forums - The Fusion of Science and Community**