Discrete Fast Fourier Transform in MATLAB

3 Ansichten (letzte 30 Tage)
Ash H
Ash H am 28 Aug. 2014
Bearbeitet: Andy L am 28 Aug. 2014
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 Kommentar
Andy L
Andy L am 28 Aug. 2014
Bearbeitet: Andy L am 28 Aug. 2014
(-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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by