Gaussian filter/fft2/ifft2
조회 수: 2 (최근 30일)
이전 댓글 표시
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.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!