Energy Spectral Density and its Implementation in Matlab

Introduction:

ESD shows energy distribution in frequency spectrum. Its units are jouls/hz. Total Energy of signal is area under ESD of signal. This relation is provided by Parseval’s Theorem, which relates energy in time domain to the energy in frequency domain.

That is:

Where |X(f)|2 is energy spectral density of waveform x(t).

Task:

Read an image (gray colored) and sketch the energy spectral density (ESD) of one of its rows and multiple rows.

Implementation in Matlab:

Reading and displaying the image:

img = imread(‘cameraman.tif’);

figure, imshow(img), title (‘The Gray coloured image Taken’)

img = double(img);

Selecting row 3 from the image matrix:

x = img(3,:);

Since energy spectral density is given by: ESD = |X(f)|^2, therefore, finding the Fourier transform and then taking square of its magnitude response:

X = abs(fftshift(fft(x)));

ESD = X.*X;

Plotting the ESD:

w = -pi:2*pi/(N-1):pi;

figure, plot(w,ESD), title(‘ESD of the selected row’),  xlabel(‘Normalized frequency’)

Now, for multiple rows, selecting row 2 and 3:

x2 = img(2:3,:);

Finding the ESD and plotting it:

X2 = abs(fftshift(fft(x2)));

ESD2 = X2.*X2;

figure, plot(ESD2), title(‘ESD of the selected (multiple) rows’)

Results:

5 Responses to “Energy Spectral Density and its Implementation in Matlab”

Leave a Reply

September 2010
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
27282930  
Archives
Blogroll