1D Gaussian Filter using FFT
7 次查看(过去 30 天)
显示 更早的评论
Hi I am trying to filter data(not periodic) represented by tanh profile.
My steps are -
signal: tanh (x)
ffts = fft(signal)
g = 1D Gaussian Filter normalised by its area
fftg = FFT(g)
fs = ffts.*fftg
s = real(ifft(fs))
But this is not giving the correct output.
What am I doing wrong?
Thanks in advance
SM
0 个评论
回答(3 个)
phani
2011-5-18
dear SM i can suggest you one one of the possible way. the convolution in the time domain is same as the multiplication in the frequency domain. so design a filter using fdatool and obtain the coefficients and do convolution of your signal and the filter coefficients. and compare the ffts of both i.e. FFT without filtering and FFT with filtering. i think that may work.
Honglei Chen
2011-5-18
Hi SM,
From the code you posted here, my suspect is that you did not use enough points in your FFT to remove the aliasing. Note that ifft of product of fft is, in theory, the circular convolution so you have to use enough points to make it the same as linear convolution. Can you try to use 2*numel(g)-1 as number of FFT points in your snippet and see if it resolves the issue? The 'same' option in CONV merely returns the central part of the linear convolution, which is not the same as the circular convolution.
HTH,
Honglei
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Design 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!