Lab_Report(14)
Lab_Report(14)
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.
Screenshot:
2. Create 3D plots for the magnitude and phase spectra of the Laplace transform, with the real
and imaginary components of s as the axes.
Code:
% Define range for real and imaginary parts of s
sigma = linspace(-10, 10 , 10); % Real part of s
omega = linspace(-10, 10, 100); % Imaginary part of s
[Sigma, Omega] = meshgrid(sigma, omega); % Create meshgrid for 3D plot
% Define 'a' as a constant (for example, a = 1)
a = 1;
% Compute X(s) for each pair of sigma and omega
S = Sigma + 1i * Omega; % Complex frequency variable
X_s_numeric = 1 ./ (S + a); % Example Laplace transform: X(s) = 1 / (s + a)
% Compute magnitude and phase
magnitude = abs(X_s_numeric); % Magnitude of X(s)
phase = angle(X_s_numeric); % Phase of X(s)
% 3D plot for magnitude
figure;
surf(Sigma, Omega, magnitude);
title('Magnitude Spectrum of Laplace Transform');
xlabel('Real(s)');
ylabel('Imaginary(s)');
zlabel('Magnitude');
colorbar; % Optional: adds a color bar for the magnitude
% 3D plot for phase
figure;
surf(Sigma, Omega, phase);
title('Phase Spectrum of Laplace Transform');
xlabel('Real(s)');
ylabel('Imaginary(s)');
zlabel('Phase');
colorbar; % Optional: adds a color bar for the phase
Phase:
Magnitude:
3. Derive the Fourier transform by setting s= jω in the Laplace transform. Generate 2D plots
for the magnitude and phase spectra of the Fourier transform.
Code:
% Define range for the imaginary part of s (omega)
omega = linspace(-10, 10, 100); % Imaginary part of s
% Define 'a' as a constant (for example, a = 1)
a = 1;
% Define sigma as 0 (purely imaginary frequency)
sigma = 0;
% Compute X(s) for each omega (using s = i * omega)
S = sigma + 1i * omega; % Complex frequency variable s = i*omega
% Example Laplace transform: X(s) = 1 / (s + a)
X_s_numeric = 1 ./ (S + a);
% Compute magnitude and phase
magnitude = abs(X_s_numeric); % Magnitude of X(s)
phase = angle(X_s_numeric); % Phase of X(s)
% 2D plot for magnitude
figure;
plot(omega, magnitude);
title('Magnitude Spectrum of Fourier Transform');
xlabel('omega');
ylabel('Magnitude');
grid on;
% 2D plot for phase
figure;
plot(omega, phase);
title('Phase Spectrum of Fourier Transform');
xlabel('omega');
ylabel('Phase');
grid on;
Phase:
Magnitude:
figure;
plot(omega_vals, F_w_sq, 'LineWidth', 1.5);
xlabel('\omega (rad/s)');
ylabel('F(j\omega)');
title('Frequency-Domain Squared Magnitude Spectrum');
grid on;
Output:
Graphs:
Conclusion:
In this lab, we explored Parseval's Theorem, which asserts that the total energy of a signal is equal
in both the time and frequency domains. This principle is essential in signal processing, as it allows
for the analysis of signals in either domain without losing any information about their energy. We
also discussed the significance of Laplace and Fourier transforms, noting that the Fourier transform
is a special case of the Laplace transform. Through the verification of Parseval's theorem, we
confirmed the equivalence of energy calculations in the time and frequency domains for a chosen
signal.