Understanding the Image output in Frequency Domain

Click For Summary
SUMMARY

This discussion focuses on understanding the frequency representation of images using the Fast Fourier Transform (FFT) in MATLAB. The user seeks clarity on how to interpret the FFT output for images, similar to how frequencies are easily identified in sine waves. The provided MATLAB code demonstrates the FFT process for both a sine wave and a simple binary image. The user specifically requests a detailed example to elucidate the frequency components present in the image FFT output.

PREREQUISITES
  • Understanding of Fast Fourier Transform (FFT) and its applications in signal processing.
  • Familiarity with MATLAB programming, specifically using the fft and fft2 functions.
  • Basic knowledge of frequency domain analysis and how it relates to time domain signals.
  • Concept of image representation in discrete formats and how pixel values correspond to frequency components.
NEXT STEPS
  • Study the MATLAB fft2 function for 2D Fourier transforms in image processing.
  • Learn about frequency domain filtering techniques to manipulate image frequencies.
  • Explore the concept of frequency components in images using practical examples and visualizations.
  • Investigate the relationship between spatial frequency and image features in the context of image analysis.
USEFUL FOR

This discussion is beneficial for image processing engineers, data scientists, and anyone interested in understanding the frequency domain representation of images using FFT in MATLAB.

XuFyaN
Messages
49
Reaction score
0
I need help understanding how frequencies are distributed when taking the FFT of an Image and how can i determine those frequencies, I really need a detailed and easy tutorial with practical example to understand it.

When we take the FFT of a Sine/Cos wave we can easily see its frequencies in FFT, here is my example i added comments in detail to understand,

Code:
%Matlab Code,
 
f=1e3;   %Frequency of Wave -> 1KHz
A=4;    %Amplitude
Fs = 1e6;  %Sampling Frequency
Ts = 1/Fs;   %Sampling Rate
t = 10/f;       %Time period of 10 Oscillation
n = 0:Ts:t;  %Generating Samples
% (1/f)/T = 1000 %Length for 1 Oscillation after Sampling
% So Length of the Signal for 10 Oscillations is 10,000
x=A*sin(2*pi*f*n);
subplot(2,1 ,1);
plot(n,x);
% 100,000/10,000 = 100Hz <- First point = 100Hz
% 2nd Point = 200Hz
% 3rd Point = 300Hz
% 4th Point = 400Hz
% .
% .
% 10th Point = 1KHz <- Original Signal Frequency
subplot(2,1 ,2);
F=fft(x);
plot(2*abs(F)./(t/Ts));
xlim ([0 100])    % 0 = 100 , 1 = 200...10=1000...100 = 10,000
set(gca, 'XTickLabel', ((get(gca,'XTick')))*100)
xlabel ('Frequency in Hz')

and here is the output image,
untitled.jpg


See how easily I can see the frequency of actual signal in Frequency domain, this is because i knew that the original frequency was 1KHz.

but in case of Images, what are the frequencies ?

here is the simple code,

Code:
image = [0 0 0 0 1 1 1 1]
The above discrete signal has 8 points so N = 8 How can i determine the frequencies and amplitude of this signal ? just like i did above for Sine wave

If i take its FFT and display it ,


Code:
f = fft2(image) 
imshow(fftshift(f)); % plotting

Untitled.png


it is nothing but 3-colors the middle one is white. (as expected)
I've no idea what does that output mean , how could i understand what are the frequencies in the image from this output ?

Can somebody explain me just one example of image FFT and how to determine the frequency etc like i did above in case of Sine wave?
 
Last edited:
Engineering news on Phys.org
your output image isn't showing


Dave
 

Similar threads

Replies
18
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
7
Views
4K
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 68 ·
3
Replies
68
Views
6K
  • · Replies 46 ·
2
Replies
46
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K