Gaussian filter/fft2/ifft2
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a 2D array for u. A sample for values in the array u is -6.032379971105743e-06 Now i applied 2dimensional FFT on 'u' by using fft2(u). Sample of the FFT of u is as 4.968406643055152e+04 + 0.000000000000000e+00i Now i applied a 2D Gaussian filter on the 2 dimensional FFT of u. Now I converted back using ifft2 command. The value i got is 4.387184236191695e-07 + 2.599341068120482e-10i
my question is would ifft2 give a complex number as answer?
Here is my code : in one file : function G=gaussFilter2(segma,kSize)
x=-(kSize/2):(1+1/kSize):(kSize/2);
y=-(kSize/2):(1+1/kSize):(kSize/2);
G=(1/(sqrt(2*pi)*segma))*exp(-(x.^2+y.^2)/(2*segma^2))
in another file:
uf = fft2(u);
G1=gaussFilter2(segma);
filter_u=conv2(uf,G1,'same');
after_filter_u = ifft2(filter_u);
Please let me know if I am doing wrong.
1 commentaire
Réponses (0)
Voir également
Catégories
En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!