Gaussian filter/fft2/ifft2

7 Ansichten (letzte 30 Tage)
priya
priya am 13 Jul. 2011
Kommentiert: Batuhan Aydin am 10 Mai 2021
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 Kommentar
Batuhan Aydin
Batuhan Aydin am 10 Mai 2021
Can I see your code all of them?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by