Lab 14 Open Ended Lab
Lab 14 Open Ended Lab
Here, x(t) is the signal in the time domain, and X(jω) is its Fourier transform.
For a discrete-time signal x[n]and its Discrete-Time Fourier Transform (DTFT) X(ejω), Parseval's
theorem is expressed as:
The theorem demonstrates that the total energy of a signal remains constant, regardless of whether
it is measured in the time or frequency domain.
This principle is widely used in signal processing to analyze the energy content of signals, optimize
systems, and verify computations involving Fourier transforms.
syms t s
x = heaviside(t)*exp(-t);
h = heaviside(t)*exp(-2*t);
X = laplace(x,s);
H = laplace(h,s);
sigma = linspace(-5,5,100);
omega = linspace(-10,10,100);
figure
surf(Sigma, Omega, Magnitude);
xlabel('Real Axis(Sigma)');
ylabel('Imaginary Axis(omega)');
zlabel('Magnitude |X|');
title('3D plot of the Magnitude Spectrum of X(s)');
colormap spring
figure
surf(Sigma, Omega, phase);
xlabel('Real Axis(Sigma)');
ylabel('Imaginary Axis(omega)');
zlabel('Phase <X');
title('3D plot of the Phase Spectrum of X(s)');
colormap jet
x = heaviside(t)*exp(-t);
x = cos(t);
x = cos(t-20);
I compared both graphs to see if time shift in time domain only affected phase
x = sin(t);
x = sin(t)*exp(-4*t);
x = sin(t)*cos(t)*heaviside(t);
x = sinc(t);
x = sinc(t)*cos(t);
Task 2: Verification of Parseval's Theorem
The goal of this task is to prove Parseval's theorem for a chosen signal and demonstrate the
equivalence of its energy in the time and frequency domains.
Instructions:
1. Compute the energy of the signal in both the time and frequency domains to verify
Parseval's theorem.
2. Display plots of the signal for better understanding and visualization.
signal = cos(2*pi*f*t);
N = length(signal);
frequency = fft(signal);
magnitude = abs(frequency);
frequencies = (0:N-1)*(fs/N);
subplot(2, 1, 2);
plot(frequencies, magnitude);
title('Signal in Frequency Domain');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
grid on;
signal = sin(2*pi*f*t);
signal = exp(-4*t).*heaviside(t);
signal = sin(4*t).*exp(-4*t).*heaviside(t);
signal = sin(100*t).*exp(-1*t).*heaviside(t);