Fourier transform image and a plot of the Fourier coefficients as a function of time.
Mostra commenti meno recenti
I have create 3 figures; the original image (y), the Fourier transform image (y1), and a plot of the Fourier coefficients as a function of time for cos(2*pi*t) where t=-10:.01:10;
here is my code and my questions:
t=-10:0.1:10;
figure(1)
a=cos(2*pi*t);
a1=repmat(a, 201, 1); %since here we had a as 1x201 and we wanted to create 201x201 we used repmat(a, 201, 1). here 1(rows) times 201 gives 201(rows) but we already had 201 columns so multiplied that by only 1 to get 201.
imshow(a1, []) %this shows the origional 201x201 image I created of cos(2*pi*t). had to create this before taking Ft but why?
a2=fft2(a1); %takes the ft
figure(2)
a3=fftshift(a2); %shows image where the harmonics in the center of the image of the Ft
imshow(a3,[]);
figure(3)
plot(t,abs(a3(101,:))); %this shows the plot of fourier coff
why do I have to use abs of a3 or my fftshift(a2)?
Why do I have to use a3(101,:) again to get a good picture? 

Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Image Transforms in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!