1D Gaussian Filter using FFT
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (3)
phani
il 18 Mag 2011
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
il 18 Mag 2011
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 Commenti
Vedere anche
Categorie
Scopri di più su Filter Design in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!