Discrete Fast Fourier Transform in MATLAB

조회 수: 3 (최근 30일)
Ash H
Ash H 2014년 8월 28일
편집: Andy L 2014년 8월 28일
I'm having difficulties to implement and answer for below question. If someone could help/guide me that would be much appreciated.
· multiply the image by (-1)^(x+y); · compute the DFT using "fft2"; · take the complex conjugate of the transform; · compute the inverse DFT; · multiply the real part of the result by (-1)^(x+y); · write the resulting matrix to an image file. · compare the result image by using "subplot" function.
I have managed to find answers for some, but not sure how to proceed or whether below is correct?
close all clear all X=imread('.\img02.jpg','jpg'); figure; imshow(X);axis equal;axis off; [m,n]=size(X); for i = 1:m; for j = 1:n; f1(i,j) =double(X(i,j)) * (-1)^(i+j); end; end; F=fft2(double(f1)); S=abs(F); S2=log(1+abs(S)); figure; imshow(S3); axis equal;axis off;
  댓글 수: 1
Andy L
Andy L 2014년 8월 28일
편집: Andy L 2014년 8월 28일
(-1)^(x+y);
...are x & y meant to be the coordinates, or the values at those coordinates? Also you say
imshow(S3)
but i haven't seen S3 defined anywhere in your code. Is the code complete or is this a typo? It is good practice to display matlab code properly (use a new line and double space indent). This makes it easier to read in general.
Finally with images it would be useful to have it attached.

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by