Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
20 views

Lab 14 Open Ended Lab

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Lab 14 Open Ended Lab

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Department of Electrical Engineering

Faculty Member:_Munadi Sial________ Dated: _27th December 2024_

Section:________C____________________ Semester: ____5th ____

EE-232 : Signals and Systems


Lab 13 : Open Ended Lab

PLO5 –CLO3 PLO5-CLO3 PLO8-CLO4 PLO9-CLO5


Name Reg. No Viva / Quiz / Analysis of Modern Tool Ethics and Individual
Lab data in Usage Safety and Team
Performance Lab Work
Report

5 Marks 5 Marks 5 Marks 5 Marks 5 Marks


Ali Masood Khan 410507

Muhammad Ibrahim 403522

Abdullah Khan 411082


Objective of the Lab
The objective of this lab is to deepen students' understanding of fundamental concepts in signal
processing by exploring the Laplace and Fourier transforms, as well as Parseval's theorem.
Through computational analysis and visualization, students will:
1. Investigate how the Laplace and Fourier transforms represent signals in the frequency
domain.
2. Analyze the relationship between the Laplace and Fourier transforms and their respective
applications in signal processing.
3. Demonstrate Parseval's theorem to validate energy conservation between the time and
frequency domains.
4. Gain hands-on experience with plotting and interpreting the magnitude and phase spectra
in both 3D and 2D representations.
Open-Ended Lab:
This lab is open-ended, allowing students to select and analyze any signal of their choice,
encouraging creativity and personalized exploration. Students can experiment with different signal
parameters and observe their impact on the Laplace and Fourier transforms, as well as their spectra.
The flexibility to create custom 2D and 3D visualizations fosters independent thinking and
problem-solving. By applying theoretical concepts to real-world signals, students can deepen their
understanding of signal processing and tailor the lab experience to their interests.
Lab Instructions
✓ This lab activity comprises of three parts: Lab Exercises, and Post-Lab Viva session.
✓ The reports are to be submitted on LMS.
✓ The students should perform and demonstrate each lab task separately for step-wise
evaluation
✓ Only those tasks that completed during the allocated lab time will be credited to the
students. Students are however encouraged to practice on their own in spare time for
enhancing their skills.
Lab Report Instructions
All questions should be answered precisely to get maximum credit. Lab report must ensure
following items:
✓ Lab objectives
✓ MATLAB codes
✓ Results (graphs/tables) duly commented and discussed
✓ Conclusion
Introduction to Parseval's Theorem
Parseval's Theorem is a fundamental result in signal processing and Fourier analysis, which
establishes the equivalence of a signal's energy in the time domain and its energy in the frequency
domain. It provides a way to analyze and compare signals across these two domains, offering
critical insights into their properties.
Mathematically, for a continuous-time signal x(t), Parseval's Theorem states:

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.

Significance of Laplace and Fourier Transforms


The Laplace transform is a powerful tool for analyzing linear time-invariant (LTI) systems and
transient behaviors in engineering and science. By extending the time-domain signal into the
complex plane, it enables the study of systems with initial conditions, exponential growth or decay,
and stability properties. The Laplace transform is particularly useful in control systems, circuit
analysis, and differential equation solving.
The Fourier transform, on the other hand, is primarily used for frequency-domain analysis of
signals and systems. It decomposes a signal into its constituent frequency components, providing
insights into steady-state behaviors and spectral properties. This makes it a fundamental tool in
fields like signal processing, communications, and spectral analysis.
Relation Between Laplace and Fourier Transforms
The Fourier transform can be seen as a special case of the Laplace transform. In the Laplace
domain, the complex variable is s=σ+ jω, where σ represents the real part and ω the angular
frequency. When σ=0, the Laplace transform reduces to the Fourier transform, making s=jω. This
means the Fourier transform analyzes signals along the imaginary axis in the complex plane,
focusing solely on the frequency-domain representation. The broader framework of the Laplace
transform allows for handling signals that grow or decay exponentially, which the Fourier
transform cannot address directly.

Task 1: Analysis of Laplace and Fourier Transforms


The objective of this task is to compute and analyze the Laplace and Fourier transforms of a chosen
signal. You will study how the signal's parameters influence its frequency spectra, investigate the
connection between the Laplace and Fourier transforms, and visualize the resulting magnitude and
phase spectra in both 3D and 2D plots.
Instructions:
1. Compute the Laplace transform X(s) of the selected signal.
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.
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.

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

[Sigma, Omega] = meshgrid(sigma, omega);


s = Sigma+1j.*Omega;
%laplace is symbolic in matlab, this replaces 's' w/ numerical values
X = subs(X,s);
X_s = double(X);
Magnitude = abs(X_s);
phase = angle(X_s);

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

% Define the signal


fs = 1000;
t = -1:1/fs:1;
f = 5;
signal = cos(2*pi*f*t);
energy_time = sum(abs(signal).^2) * (1/fs);

N = length(signal);
frequency = fft(signal);
magnitude = abs(frequency);

energy_frequency = sum((magnitude.^2) / N);

disp(['Energy in time domain: ', num2str(energy_time)]);


disp(['Energy in frequency domain: ', num2str(energy_frequency)]);
figure;
subplot(2, 1, 1);
plot(t, signal);
title('Signal in Time Domain');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;

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

You might also like