Need top design low pass filter using Fourier transform and Hamming window

5 views (last 30 days)
Dear All,
I'm trying to design a low pass filter using Fourier transform and Hamming window, it's the first time for me to design a filter, so I just follow what I found in some Matlab pages, but I don't know whether I'm doing right or not. Can any one please just check my simple code and tell if I need to add or remove some steps in the code?
Also I have couple of question please, when I took the Fourier transform to the data I get complex number, so should I took the absolute of fft or real part of fft then pass the filter to the new data? my second question, when I evaluate the filter using the tool (fvtool(hd1)) or fvtool(Hd1,'Fs',8000) how the Fs value will affect the filtered data?
Thanks in advance Sherien
Fc = .3; % cutoff frequency N = 30; %order Hf = fdesign.lowpass('N,Fc',N,Fc); Hd1 = design(Hf,'window','window',@hamming,'systemobject',true); Y = fft(xw); %fourier transform of data P = real(Y); % take the real paer of the fourier transform py = step(Hd1,P); % apply the filter to the transformed data C_py = ifft(py); %inverse fourier transform of the data N_py=abs(C_py); %taking the real part of the inverse fourier figure;subplot(3,1,1), plot(xw); % original signal subplot(3,1,2), plot(abs(P)); % fft subplot(3,1,3), plot(N_py); % ifft

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!