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’)



What a great resource!
Pretty nice post. I just stumbled upon your blog and wanted to say that I have really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!
Great info, thank you for making this available on your blog.
Hi,Superb blogging dude! i am Tired of using RSS feeds and do you use twitter?so i can follow you there:D.
PS:Do you considered putting video to this web site to keep the readers more enjoyed?I think it works., Maricruz Jarnesky
Genial fill someone in on and this mail helped me alot in my college assignement. Thanks you for your information.