Islamic University, Bangladesh
Department of
INFORMATION & COMMUNICATION TECHNOLOGY
Report On
Signal and System Laboratory
Course Code: ICT-2107
Submitted To: Submitted By:
Dr. Md. Zahidul Islam Name : Mongmycha Chak
Professor Roll : 2218017
Department of Information and Reg. no : 22001289
Communication Technology Session : 2022-23
Islamic University, Kushtia
INDEX
Number of Name of the experiment
experiments
1. Generation and classification of Signals (Ramp,
Square, and Sine)
2. Time shifting and scaling of signal.
3. Continuous and discrete time convolution.
4. Fourier series representation of periodic signal.
5. Fourier transformation of continuous- time signal.
6. Laplace transformation and system response.
7. Sampling theorem and aliasing.
8. Z-transformation and discrete- time system
analysis.
9. LIT system analysis using different equation.
10. Filter design and frequency response analysis.
Experiment 1: Generation and classification of Signals
(Ramp, Square, and Sine)
Objective
1. To generate and plot basic standard signals: Ramp signal, Square wave, and Sine
wave using MATLAB.
2. To study the characteristics and properties of these signals.
Theory
1. Ramp Signal
A signal that increases linearly with time, often used to test system responses.
Type: Deterministic (exactly defined by x(t)= t
Domain: Continuous-time
Nature: Non-periodic
Energy/Power: Infinite energy, infinite power (unbounded growth)
Even/Odd: Odd signal (symmetric about the origin with sign change.
2. Square Wave
A periodic signal alternating between two amplitude levels, used in digital and switching
circuits.
Type: Deterministic (can be expressed mathematically using square () function)
Domain: Continuous-time (used MATLAB code)
Nature: Periodic with period T= 1 (here f=5 Hz)
𝑓
Energy/Power: Infinite energy, finite average power (Periodic signals → power
signals)
Even/Odd: Neither strictly even nor odd (depends on phase shift)
3. Sine Wave
A fundamental periodic signal with smooth oscillations, used in communication and
system modeling.
Type: Deterministic
Domain: Continuous-time
Nature: Periodic with period T=1
𝑓
Energy/Power: Infinite energy, finite power (Periodic → power signal)
Even/Odd: Can be odd (sin(-t)= -sin(t))
Mathematical Expressions
1. Ramp Signal: x(t)= t, t ≥ 0
2. Square Wave: x(t)=square (2πf t)
3. Sine Wave: x(t)=sin (2πf t)
MATLAB Code
%Ramp signal
clc;
t1 = 0:0.1:10; ramp=t1;
subplot(3,1,1); plot(t1,ramp,'r','LineWidth', 2) % LineWidth set to 2 for bold line
title('Ramp signal'); xlabel('time'); ylabel('amplitude'); legend('ramp signal')
grid on
%square wave
t2 = 0:0.001:1; % time axis
f = 5; % frequency 5 Hz
y = square(2*pi*f*t2); % square wave
subplot(3,1,2); plot(t2, y, 'b','LineWidth', 2)
title('Square wave'); xlabel('time'); ylabel('amplitude'); legend('square wave')
grid on
% sine wave
t3 = 0:0.01:1;
f2=5;
y2=sin(2*pi*f2*t3);
subplot(3,1,3); plot(t3, y2, 'g','LineWidth', 2)
title('Sine wave'); xlabel('time'); ylabel('amplitude'); legend('sine wave')
grid on
Diagram
Procedure
1. Open MATLAB and create a new script file.
2. Define the time vectors for each signal.
3. Generate the Ramp signal using x(t)=t
4. Generate the Square wave using MATLAB function square(2*pi*f*t).
5. Generate the Sine wave using x(t)=sin(2πft)
6. Plot each signal in different subplots for comparison.
7. Run the script and observe the outputs.
Observations
Ramp signal increases linearly with time.
Square wave alternates between +1 and –1 at the set frequency (5 Hz).
Sine wave produces continuous oscillations with frequency 5 Hz.
Conclusion
The Ramp, Square, and Sine signals were successfully generated using MATLAB.
Each signal exhibits unique characteristics useful in signal processing and system
analysis.
Understanding these basic signals is essential for studying advanced signals and
systems.
Experiment 2: Time Shifting and Scaling of signal
Objective
1. To understand the concepts of time shifting and time scaling in signals.
2. To observe the effects of these operations on different types of signals (continuous
and discrete).
3. To analyze the mathematical representation of time-shifted and time-scaled signals.
Theory
In signal processing, signals can be modified in various ways without altering their basic
characteristics. Two fundamental operations are time shifting and time scaling:
1. Time Shifting
o Shifting a signal in time either to the right (delay) or to the left (advance).
o Delay means the signal occurs later, while advance means it occurs earlier.
2. Time Scaling
o Expands or compresses a signal in the time domain.
o Compression: Signal becomes faster (shorter in duration).
o Expansion: Signal becomes slower (longer in duration).
These operations are widely used in communication, control systems, and system analysis.
Mathematical Formulation
1. Time Shifting
Delay: x (t-t0)
Advance: x(t-t0)
2. Time Scaling
Compression (faster): x(at) , a > 1
Expansion (slower): x(at) , 0 < a < 1
MATLAB code
clc;
% Time Shifting
t = -5:0.1:5;
x = sin(t); % Original signal
x_right = sin(t - 3); % Right shift (delay by 3)
x_expe = sin(t + 3); % Left shift (advance by 3)
figure %used to solve figure window issue where graph doesn't show
subplot(211); plot(t, x, 'r','LineWidth', 1) ;
hold on
plot(t, x_right, 'b','LineWidth', 1); plot(t, x_expe, 'g','LineWidth', 1)
hold off
title('time shifting'); xlabel('time'); ylabel('amplitude');
legend('original signal','right shift','left shift')
grid on
% time scaling
t1=-5:0.1:5;
y=sin(t1); % Original signal
y_comp = sin(2*t1); % signal compression
y_expe = sin(.5*t1); % signal expension
subplot(212); plot(t1, y, 'r','LineWidth', 1);
hold on
plot(t1, y_comp, 'b','LineWidth', 1); plot(t1, y_expe, 'g','LineWidth', 1);
hold off
title('time scaling'); xlabel('time'); ylabel('amplitude')
legend('original signal','compression','expension');
grid on
Diagram
Procedure
1. Open MATLAB and create a new script file.
2. Define the time axis t within a range (e.g., -5 to 5).
3. Generate the original sine signal x(t)=sin(t).
4. For time shifting, create right-shifted (sin(t-3)) and left-shifted (sin(t+3)) versions.
5. Plot all signals on the same graph using plot () and add legends.
6. For time scaling, generate compressed (sin(2t)) and expanded (sin(0.5t)) versions.
7. Plot the original and scaled signals in another subplot.
8. Run the code and observe the plots.
Observations
The right-shifted signal appears delayed (moved to the right).
The left-shifted signal appears advanced (moved to the left).
The compressed signal oscillates more quickly (shorter period).
The expanded signal oscillates more slowly (longer period).
Amplitude of the signal remains unchanged during both operations.
Conclusion
Time shifting changes only the position of the signal on the time axis without altering
its shape or amplitude.
Time scaling changes the speed of oscillation of the signal: compression makes it
faster, expansion makes it slower.
These operations are fundamental in signal analysis, synchronization, and
communication systems.
Experiment 3: Continuous and Discrete-Time convolution
Objectives
1. To understand the concept of convolution in continuous and discrete-time systems.
2. To compute the convolution of two signals using MATLAB.
3. To analyze how an input signal and an impulse response combine to form the output
of a linear time-invariant (LTI) system.
Theory
Convolution is a fundamental mathematical operation in signal processing that expresses how
the shape of one signal is modified by another. It is widely used to determine the output of
Linear Time-Invariant (LTI) systems when the input and system impulse response are known.
It combines two signals to produce a third signal that expresses how the shape of one is
modified by the other .
Mathematical Formulation
1. Continuous-Time Convolution
Defined as: y(t)= (x ∗ h) (t)= ∫∞ 𝑥(τ). h(𝑡 − τ)dτ
−∞
It describes the response of a continuous-time LTI system.
2. Discrete-Time Convolution
Defined as: y[n]= (x ∗ h) [n]= ∑∞
𝑘=−∞ 𝑥[𝑘]. ℎ[𝑛 − 𝑘]
It describes the response of a discrete-time LTI system.
MATLAB code
clc;
% Continuous-Time Convolution (Numerical Approximation)
dt = 0.01; % small step for approximation
t = -5:dt:5; % time vector
x = (t>=0 & t<=2); % input: rectangular pulse between [0,2]
h = (t>=0 & t<=3); % impulse response: rectangular pulse between [0,3]
y = conv(x, h) * dt; % convolution (scaled by dt)
ty = (2*t(1)) : dt : (2*t(end)); % time axis for convolution result
figure;
subplot(2,2,1); plot(t, x, 'r','LineWidth',1.5);
grid on;
title('Input Signal x(t)'); xlabel('t'); ylabel('x(t)');
subplot(2,2,2);plot(t, h, 'b','LineWidth',1.5);
grid on;
title('Impulse Response h(t)'); xlabel('t'); ylabel('h(t)');
subplot(2,2,3); plot(ty, y, 'k','LineWidth',1.5); grid on;
title('Continuous-Time Convolution y(t)'); xlabel('t'); ylabel('y(t)')
% Discrete-Time Convolution
n = 0:5;
x = [1 2 1 0 0 0]; % input sequence
h = [1 1 1]; % impulse response
y = conv(x, h); % discrete convolution
ny = 0:(length(y)-1); % time index for output
subplot(2,2,4);
stem(ny, y, 'filled','LineWidth',1.5); grid on;
title('Discrete-Time Convolution y[n]');
xlabel('n'); ylabel('y[n]');
Diagram
Procedure
1. Define the input signal x and impulse response h.
2. For continuous convolution:
o Use a fine time vector.
o Numerically approximate convolution using MATLAB’s conv () with step
size scaling.
3. For discrete convolution:
o Define sequences x[n] and h[n].
o Compute convolution using MATLAB’s conv () function.
4. Plot input signals and their convolution result.
5. Observe the effect of convolution on signal shape and duration.
Observations
In continuous convolution, the output is obtained by the overlapping area of the input
signal and shifted impulse response.
In discrete convolution, the result is a finite-length sequence whose length is given by:
Ly=Lx + Lh − 1
Convolution modifies the shape of the signal depending on the impulse response.
Conclusion
Convolution is the core operation to find the output of LTI systems.
Continuous convolution involves integration, while discrete convolution involves
summation.
MATLAB’s conv() function simplifies discrete convolution and can approximate
continuous convolution.
This experiment demonstrates the relationship between input, system response, and
output in both continuous and discrete domains.
Experiment 4: Fourier Series Representation of Periodic
Signals
Objective
1. To study the Fourier series representation of periodic signals.
2. To compute and plot Fourier series coefficients for a given periodic waveform.
3. To understand how periodic signals can be expressed as a sum of sinusoids (sine and
cosine components).
Theory
The Fourier Series is a powerful mathematical tool that allows any periodic signal to be
represented as a weighted sum of sine and cosine functions (or equivalently complex
exponentials). Since sine and cosine are fundamental building blocks of signals, Fourier
series provides an intuitive way to analyze and synthesize periodic waveforms.
Fourier Series Representation:
If x(t) is a periodic signal with period T, then
x(t)=∑∞ . anej2πnt/T
𝑘=−∞
where:
2𝜋
o ω0 = 𝑇 , fundamental angular frequency
1
an= ∫ 𝑥(𝑡) e-jkω0t dt, Fourier coefficients
o
𝑇 𝑇
Mathematical Formulation
Series form: x(t)=∑n=−∞∞anejnω0t , ω0=2π/T.
Coefficient (numerical): an≈1/T trapz (t, x(t) e−jnω0t)
using a dense grid t ∈[t0,t0+T] (or any full period).
Reconstruction (finite):
xN(t)=∑n=−NN anejnω0t.
MATLAB code
clc;
% Parameters
T = 2*pi; % Period
w0 = 2*pi/T; % Fundamental angular frequency (here = 1 rad/s)
N = 10; % Number of harmonics on each side
t = linspace(-T, T, 2000); % Time vector spanning two periods
n_vals = -N:N; % Harmonic indices
% --- Signal 1: x(t) = sin(t) ---
x1 = sin(t);
% Fourier coefficients a_n (numerical integration over one period window)
a1 = zeros(1, numel(n_vals));
for k = 1:numel(n_vals)
n = n_vals(k);
integrand = x1 .* exp(-1j*n*w0*t);
a1(k) = (1/T) * trapz(t, integrand);
end
% Reconstruction from -N..N
x1_recon = zeros(size(t));
for k = 1:numel(n_vals)
n = n_vals(k);
x1_recon = x1_recon + a1(k) * exp(1j*n*w0*t);
end
% Plots
figure;
subplot(211)
plot(t, x1, 'b', 'LineWidth', 1.5); hold on;
plot(t, real(x1_recon), 'r--', 'LineWidth', 1.5);
legend('Original sin(t)', 'FS Approximation');
xlabel('t'); ylabel('x(t)'); title('Fourier Series (Complex) for sin(t)'); grid on;
% --- Signal 2: x(t) = cos(t) ---
x2 = cos(t);
a2 = zeros(1, numel(n_vals));
for k = 1:numel(n_vals)
n = n_vals(k);
integrand = x2 .* exp(-1j*n*w0*t);
a2(k) = (1/T) * trapz(t, integrand);
end
x2_recon = zeros(size(t));
for k = 1:numel(n_vals)
n = n_vals(k);
x2_recon = x2_recon + a2(k) * exp(1j*n*w0*t);
end
subplot(212)
plot(t, x2, 'b', 'LineWidth', 1.5); hold on;
plot(t, real(x2_recon), 'r--', 'LineWidth', 1.5);
legend('Original cos(t)', 'FS Approximation');
xlabel('t'); ylabel('x(t)'); title('Fourier Series (Complex) for cos(t)'); grid on;
Diagram
Procedure
1. Set the period T=2π so ω0=1 rad/s; choose a truncation order N.
2. Build a dense time grid covering at least one full period (here, two periods improve
numerical stability).
3. Define x(t) (first sin t, then cos t).
4. For each harmonic n∈[−N,N], numerically evaluate an≈1Ttrapz(t,x(t)e−jnω0t).
5.Reconstruct xN(t)=∑n=−NN anejnω0t
6. Plot original vs reconstruction
7. Repeat for different N to observe convergence behavior.
Observations
As the number of harmonics N increases, the Fourier series approximation becomes
closer to the original signal.
For both sin t and cos t, the only significant coefficients appear at n=±1, matching the
analytical results; .
The reconstructed xN(t)overlaps the original signal extremely well even for modest N
(e.g., N≥1 already exact for these test signals).
Increasing N beyond the nonzero harmonics does not change the reconstruction, but
can slightly reduce numerical ripple.
Using a denser time grid improves the accuracy of the numerically estimated
coefficients.
Conclusion
The complex-exponential Fourier Series compactly represents periodic signals as
sums of harmonics at integer multiples of ω 0.
Numerical coefficient estimation using trapz accurately recovers the expected a±1 and
zeros elsewhere for sin t and cos t.
Reconstruction from a finite number of harmonics matches the original signals,
illustrating convergence and the spectral sparsity of pure tones.
This framework directly supports frequency-domain analysis and LTI system
response prediction.
Experiment 5: Fourier Transformation of Continuous-Time
Signals
Objective
1. To compute the Fourier Transform of a continuous-time signal using numerical
integration in MATLAB.
2. To analyze the time-domain and frequency-domain representation of the signal.
3. To verify the duality between the signal in time domain and its spectrum in frequency
domain.
Theory
The Fourier Transform (FT) is a fundamental mathematical tool used to analyze the
frequency content of continuous-time signals. It converts a time-domain signal x(t) into its
frequency-domain representation X(f).
Relevant signal/system type: Continuous-time aperiodic signals.
Operation performed: Compute FT using numerical approximation of the integral.
Expected result: The time-domain exponential decaying signal produces a smooth
frequency-domain spectrum.
The Fourier Transform is defined as: X(f)=∫∞ x(𝑡) e−j2πftdt
−∞
Where:
x(t) = time-domain signal
X(f)= frequency-domain representation
f = frequency variable
For the example signal x(t)=e−∣t∣, the analytical Fourier transform is known as:
X(f)= 2 , approximating this integral numerically using MATLAB trapezoidal
1+(2π𝑓)^2
integration (trapz).
Mathematical Formulation
1. Continuous-Time Fourier Transform (CTFT):
X(ω)=∫∞ 𝑥(𝑡)e−j2πft dt
−∞
2. Discretized numerical approximation:
X(f)≈∑ x(tn)e−j2πftnΔt
MATLAB Code
% Fourier Transform using Numerical Integration
clc; clear; close all;
% Time specifications
Fs = 1000; % Sampling frequency
dt = 1/Fs; % Time step
t = -10:dt:10; % Time vector (from -1s to 1s)
% Define signal x(t)
x = exp(-abs(t)); % Example signal: e^(-|t|)
% Frequency specifications
f = -100:1:100; % Frequency range
X = zeros(size(f)); % Initialize Fourier Transform
% Numerical integration for each frequency
for k = 1:length(f)
X(k) = trapz(t, x .* exp(-1j*2*pi*f(k)*t));
end
% Plot time-domain signal
figure;
subplot(2,1,1); plot(t, x, 'b','LineWidth',1.5);
xlabel('Time (s)'); ylabel('x(t)');
title('Time Domain Signal');
grid on;
% Plot frequency spectrum
subplot(2,1,2); plot(f, abs(X), 'r','LineWidth',1.5);
xlabel('Frequency (Hz)'); ylabel('|X(f)|');
title('Fourier Transform (Numerical Integration)');
grid on;
Diagram
Procedure
1. Define the time-domain signal x(t)=e−∣t∣.
2. Choose a finite time range (−10 ≤ t ≤10) and sampling frequency.
3. Define a range of frequencies f for which the transform is to be computed.
4. Implement the Fourier Transform integral numerically using the trapezoidal rule:
−j2πft
X(f)≈∑x(t)e Δt
5. Plot the original signal in time domain.
6. Plot the computed Fourier spectrum in frequency domain.
7. Compare numerical results with the known analytical spectrum.
Observations
−t
The input signal x(t)=e ∣ ∣ is a decaying exponential symmetric about t=0.
The computed Fourier Transform ∣X(f)∣ shows a smooth, bell-shaped spectrum,
centered at f=0.
Higher frequency components are attenuated, confirming that the exponential decay
signal is primarily low-frequency in nature.
The numerical integration result closely matches the expected analytical form:
X(f)=2/1+(2πf)^2
Conclusion
Fourier Transform provides a method to analyze signals in the frequency domain.
The numerical integration method using MATLAB successfully approximates the
Fourier spectrum.
For x(t)=e−∣t∣ , the spectrum is low-pass in nature, as expected.
This experiment verifies the theoretical Fourier Transform through practical
MATLAB computation.
Experiment 6: Laplace Transformation and System Response
Objective
1. To compute the Laplace Transform of a given continuous-time signal.
2. To analyze the system response in the Laplace domain.
3. To obtain the time-domain output by performing the Inverse Laplace Transform using
MATLAB.
Theory
The Laplace Transform is a powerful mathematical tool that converts a time-domain signal
x(t)x(t)x(t) into the complex frequency domain X(s). It is widely used for analyzing linear
time-invariant (LTI) continuous-time systems, especially when differential equations are
involved.
Laplace Transform Definition: X(s)=∫ ∞ 𝑥(𝑡)e−st dt
0
System Relationship in Laplace Domain: Y(s)=H(s)⋅X(s)
Where:
X(s) = Laplace Transform of input
H(s) = System Transfer Function
Y(s) = Laplace Transform of output
The Inverse Laplace Transform returns the system response in the time domain:
y(t)=L−1{Y(s)}
Mathematical Formulation
1. Input signal: x(t)=e−2t, t≥0
Laplace Transform: X(s)=1 / s+2
2. System transfer function: H(s)=1 / s+3
3. Output in s-domain: Y(s)=H(s)⋅X(s)=1 / (s+2)(s+3)
4. System response in time domain (Inverse Laplace): y(t)=e−2t−e−3t , t ≥0
MATLAB Code
% Define Time Vector
t = 0:0.01:10; % Time vector
% Input Signal
x = exp(-2*t); % Example: exponential signal
% Laplace Transform using symbolic toolbox
syms s t_sym
x_sym = exp(-2*t_sym);
X_s = laplace(x_sym, t_sym, s);
disp('Laplace Transform X(s) = ');
disp(X_s);
% Define System (LTI system)
% Example: H(s) = 1/(s+3)
H_s = 1/(s+3);
% System Response in s-domain
Y_s = H_s * X_s;
% Inverse Laplace Transform to get time response
y_t_sym = ilaplace(Y_s, s, t_sym);
y_t = double(subs(y_t_sym, t_sym, t));
% Plot Input and Output Signals
figure;
plot(t, x, 'b','LineWidth',1.5); grid on;
xlabel('Time (s)'); ylabel('x(t)');
title('Input Signal x(t)');
figure;
plot(t, y_t, 'r','LineWidth',1.5); grid on;
xlabel('Time (s)'); ylabel('y(t)');
title('System Response y(t) using Laplace Transform');
% Display Results
disp('System Response y(t) = ');
disp(y_t_sym);
Diagram
Procedure
1. Define the input signal x(t)
2. Compute its Laplace Transform X(s) using MATLAB’s symbolic toolbox.
3. Define the system transfer function H(s)
4. Multiply X(s) and H(s) to obtain the system output in Laplace domain Y(s).
5. Apply Inverse Laplace Transform to find y(t).
6. Substitute time values and plot both input and output signals.
7. Compare the input and system response to verify expected behavior.
Observations
The input x(t)=e−2t decays exponentially with time.
The Laplace transform was found as X(s)=1 / s+2.
For system H(s)=1 / s+3, the output in Laplace domain is: Y(s)=H(s)⋅X(s)=1 /
(s+2)(s+3)
The time-domain response after inverse Laplace is: y(t)=e−2t−e−3t , t ≥0
The plot confirms that the output signal has a slower initial decay, influenced by both
exponential terms.
Conclusion
Laplace Transform provides a systematic method to analyze continuous-time systems
in the s-domain.
The convolution of input and system impulse response in time domain is simplified to
multiplication in Laplace domain.
The inverse Laplace transform successfully retrieved the time-domain response.
This experiment shows how Laplace Transform is useful for solving differential
equations, control systems, and signal analysis.
Experiment 7: Sampling Theorem and Aliasing
Objective
1. To understand and demonstrate the Sampling Theorem.
2. To observe the effect of sampling at different frequencies.
3. To illustrate aliasing when the Nyquist criterion is not satisfied.
Theory
The Sampling Theorem (Nyquist–Shannon Theorem) states that:
A continuous-time signal x(t) band-limited to maximum frequency fmax can be
perfectly reconstructed from its samples if the sampling frequency fs satisfies:
fs ≥ 2fmax . where 2fmax is called the Nyquist rate.
If fs < 2fmax, then aliasing occurs. Aliasing is the distortion that happens when
different frequency components of the signal become indistinguishable after
sampling.
In practice, aliasing can be prevented using anti-aliasing filters before sampling.
fs >2fsignal: samples align correctly with the original waveform. Other hand
fs<2fsigna: the sampled signal does not represent the original signal, showing
aliasing.
Mathematical Formulation
The sampled signal is expressed as: 𝑛=−∞ 𝑥(𝑛𝑇𝑠) δ(t−nTs)
xs(t)=∑∞
Where:
Ts=1 / fs is the sampling interval.
x(nTs) are the discrete samples of x(t).
MATLAB Code
% Sampling Theorem Demonstration with Two Sampling Rates (0 to 2 sec)
clc;
% Original continuous-time signal
fsignal = 5; % Signal frequency (Hz)
t = 0:0.001:2; % Time vector from 0 to 2 sec
x = sin(2*pi*fsignal*t); % Original signal
% --- First Sampling (higher fs, Nyquist satisfied) ---
fs1 = 12; % Sampling frequency 1
Ts1 = 1/fs1;
n1 = 0:Ts1:2;
x_n1 = sin(2*pi*fsignal*n1);
% --- Second Sampling (lower fs, aliasing likely) ---
fs2 = 8; % Sampling frequency 2
Ts2 = 1/fs2;
n2 = 0:Ts2:2;
x_n2 = sin(2*pi*fsignal*n2);
figure;
% Original signal
plot(t, x, 'k--', 'LineWidth', 1); hold on;
% First sampling (Nyquist satisfied)
stem(n1, x_n1, 'b', 'filled', 'LineWidth', 1.2);
% Second sampling (Aliasing case)
stem(n2, x_n2, 'r', 'filled', 'LineWidth', 1.2);
% Formatting
title('Sampling Theorem Demonstration with Two Sampling Rates');
xlabel('Time (s)'); ylabel('Amplitude');
legend('Original Signal','Sampled Signal (fs=12 Hz)','Sampled Signal (fs=8 Hz)');
axis([0 2 -1.2 1.2]); % Extended axis from 0 to 2 sec
grid on;
Diagram
Procedure
1. Define the continuous-time sinusoidal signal x(t)=sin(2πfs t)). (fs=f signal)
2. Sample the signal with fs=12 Hz (greater than Nyquist rate).
3. Sample the signal with fs=8 Hz (less than Nyquist rate).
4. Plot the original signal and overlay sampled signals.
5. Compare both cases to analyze aliasing.
Observations
The original continuous signal is a 5 Hz sinusoid.
For sampling at 12 Hz (fs>2fsignal):
o The sampled points align properly with the original waveform.
o Nyquist criterion satisfied → No aliasing.
For sampling at 8 Hz (fs<2fsignal):
o The samples misrepresent the original waveform.
o Aliasing occurred → the reconstructed signal would have the wrong
frequency.
Conclusion
The experiment verified the Sampling Theorem.
Proper reconstruction of a signal requires the sampling frequency to be at least twice
the maximum signal frequency.
If the sampling rate is below Nyquist, aliasing occurs, leading to distortion.
This experiment shows why choosing correct sampling frequency is critical in digital
signal processing.
Experiment 8: Z-transformation and discrete-time system
analysis
Objective
1. To understand the concept of the Z-transform for discrete-time signals.
2. To determine the impulse response of a system from its transfer function H(z).
3. To compute the output of an LTI system using convolution in the time domain,
equivalent to multiplication in the Z-domain.
4. To analyze the relationship between the input, impulse response, and output of an LTI
system.
Theory
The Z-transform is a mathematical tool used to represent discrete-time signals in the complex frequency
domain. It is defined as: X(z)=∑n=−∞∞x[n]z^-n
Where:
x[n] = discrete-time sequence
z=re^(jω) = complex variable
For LTI systems, the transfer function is given by: H(z)=Y(z) / X(z)
The impulse response h[n] of the system is obtained by applying an impulse input δ[n]. The output
response can be obtained either by:
1. Z-domain multiplication: Y(z)=H(z) . X(z)
2. Time-domain convolution: y[n] = (x∗h)[n] = ∑k=−∞∞x[k]h[n−k]
Mathematical Formulation
For the system: H(z)=1 / 1−0.5z^−1
Impulse response: h[n] = (0.5)^n . u[n]
Input (unit step): x[n]=u[n]
Output: y[n]=x[n]∗h[n]
MATLAB Code
clc;
% 1. Define the system in terms of Z-domain coefficients
% Example: H(z) = 1 / (1 - 0.5*z^-1)
num = [1]; % Numerator coefficients
den = [1, -0.5]; % Denominator coefficients
% 2. Define the input signal
% Example: a unit step, x[n] = u[n]
n_input = 0:20;
x = ones(1, length(n_input));
% 3. Find the system's impulse response in the time domain
% This is the time-domain equivalent of the transfer function H(z)
[h, n_h] = impz(num, den, 21);
% 4. Find the system's response by convolving the input with the impulse response
% This is the time-domain equivalent of Y(z) = X(z) * H(z)
y = conv(x, h);
n_y = 0:length(y)-1;
% 5. Plot the signals
figure;
subplot(3, 1, 1);
stem(n_input, x, 'b', 'filled', 'LineWidth', 1.5);
xlabel('n'); ylabel('x[n]');
title('Input Signal: Unit Step');
grid on;
subplot(3, 1, 2);
stem(n_h, h, 'r', 'filled', 'LineWidth', 1.5);
xlabel('n'); ylabel('h[n]');
title('System Impulse Response');
grid on;
subplot(3, 1, 3);
stem(n_y, y, 'k', 'filled', 'LineWidth', 1.5);
xlabel('n'); ylabel('y[n]');
title('Output Signal: Convolution of x[n] and h[n]');
grid on;
Diagram
Procedure
1. Define the system transfer function H(z) using numerator and denominator
coefficients.
2. Generate the input signal (unit step x[n]).
3. Compute the system impulse response h[n] using MATLAB impz().
4. Find the output by convolving x[n] and h[n] using conv().
5. Plot the input, impulse response, and output.
Observations
The impulse response was found as h[n]=(0.5)^n . u[n] , which decays exponentially.
The output signal y[n] was obtained by convolution of the unit step with h[n].
The response shows a cumulative effect where the step input excites the system’s
natural response.
The system is causal and stable, since the pole at z=0.5 lies inside the unit circle.
Conclusion
The Z-transform provides a powerful tool for analyzing discrete-time LTI systems.
The impulse response characterizes the system completely.
The convolution operation in the time domain confirmed the multiplication rule in the
Z-domain.
The experiment verified that the system is stable, causal, and behaves as expected.
Experiment 9: LTI system analysis using difference equation
Objective
1. To analyze the response of an LTI (Linear Time-Invariant) system defined by a
difference equation.
2. To compute the impulse response of the system using MATLAB.
3. To verify system behavior (stability and response type) from its difference equation.
Theory
In discrete-time systems, the behavior of an LTI system can be described by a linear
constant-coefficient difference equation of the form:
y[n]=-a1y[n−1]-a2y[n−2]+b0x[n]+b1x[n−1]+…
x[n]= input signal
y[n] = output signal
ai,bi = constant coefficients
For analysis:
The impulse response h[n] is obtained when input x[n]=δ[n].
Using the Z-transform, the system transfer function is:
H(z)=Y(z) / X(z)=Denominator / Numerator
Example System: y[n]=0.6 y[n−1]+x[n]
Here, the system has feedback, making it an IIR (Infinite Impulse Response) system.
The pole at z=0.6 lies inside the unit circle → system is stable.
Mathematical Formulation
For difference equation: y[n]=0.6y[n−1]+x[n]
Impulse input: x[n]=δ[n] ⇒ y[n]=h[n]
So, the impulse response: h[n]=(0.6)^n, n≥0
MATLAB Code
% LTI System using Difference Equation
% Example: y[n] = 0.6*y[n-1] + x[n]
clc; clear; close all;
num = [1]; % x[n] coefficient (numerator)
den = [1 -0.6]; % y[n-1] coefficient (denominator)
n = 0:20;
% Impulse input
x = [1 zeros(1,20)];
% System response
y = filter(num, den, x);
% Plot impulse response
figure;
stem(n, y, 'filled');
xlabel('n'); ylabel('y[n]');
title('Impulse Response of LTI System');
grid on;
Diagram
Procedure
1. Define the difference equation: y[n]=0.6y[n−1]+x[n].
2. Represent the system using numerator and denominator coefficients in MATLAB.
3. Apply an impulse input (x[n]=δ[n]).
4. Use MATLAB filter() to compute the system response.
5. Plot and analyze the impulse response.
Observations
The impulse response obtained is: h[n]=(0.6)^n , n≥0
The response decays exponentially as n increases.
Since the pole at z=0.6 lies inside the unit circle, the system is causal and stable.
The MATLAB simulation matches the theoretical result.
Conclusion
The impulse response of the system was successfully computed using the difference
equation.
The system is an IIR system due to feedback in the difference equation.
The response decays exponentially, confirming system stability.
This experiment shows how difference equations provide an efficient way to represent
and analyze discrete-time LTI systems.
Experiment 10: Filter design and frequency response
analysis
Objective
1. To design a discrete-time filter using its impulse response.
2. To compute the frequency response of the filter using the Discrete-Time Fourier
Transform (DTFT).
3. To analyze both magnitude and phase responses of the filter.
Theory
A discrete-time filter is characterized by its impulse response h[n]. The frequency response of
the filter provides insight into how the filter modifies the amplitude and phase of different
frequency components of an input signal.
The DTFT (Discrete-Time Fourier Transform) of an impulse response is defined as:
H(ejω)=∑𝑁−1
𝑛=0 ℎ[𝑛] e
−jωn
, −π≤ω≤π
Where:
h[n]= impulse response of the system
H(e^jω) = frequency response (complex)
∣H(e^jω)∣ = magnitude response
∠H(e^jω) = phase response
Mathematical Formulation
1. DTFT of Impulse Response: H(ejω)=∑𝑁−1
𝑛=0 ℎ[𝑛] e
−jωn
,
2. Magnitude Response: ∣H(e^jω)∣ =√(𝑅𝑒{𝐻(𝑒𝑗𝜔)})2 + (𝐼𝑚{𝐻(𝑒𝑗𝜔)})^2
where Re{H(e^jω)} and Im{H(e^jω)} are the real and imaginary parts of H(e^jω)
3. (𝑒𝑗𝜔)}
Phase Response: ∠H(ejω)=tan^-1 . 𝐼𝑚{𝐻
Re{H(ejω)}
MATLAB Code
% Experiment 10: Filter Design and Frequency Response Analysis
clc; clear; close all;
% Define impulse response h[n]
h = [1 2 3 4]; % Example impulse response (can be changed as needed)
% Frequency range (from -pi to pi)
omega = linspace(-pi, pi, 500);
% Compute DTFT: H(e^j?) = ? h[n] e^(-j?n)
H = zeros(size(omega));
for n = 1:length(h)
H = H + h(n) * exp(-1j * omega * (n-1)); % (n-1) because MATLAB index starts at 1 end
% Plot Magnitude and Phase Response
figure;
% Magnitude Response
subplot(2,1,1);
plot(omega, abs(H), 'LineWidth', 1.5);
xlabel('\omega (rad/sample)');
ylabel('|H(e^{j\omega})|');
title('Magnitude Response');
grid on;
% Phase Response
subplot(2,1,2);
plot(omega, angle(H), 'LineWidth', 1.5);
xlabel('\omega (rad/sample)');
ylabel('?H(e^{j\omega}) (rad)');
title('Phase Response');
grid on;
Diagram
Procedure
1. Define the impulse response h[n] of the system.
2. Define the frequency range from -π to +π
3. Compute the DTFT by evaluating : H(ejω)=∑𝑁−1 𝑛=0 ℎ[𝑛] e
−jωn
,
4. Plot the magnitude and phase response.
5. Analyze the characteristics of the filter.
Observations
The filter response was computed for impulse response h=[1,2,3,4].
The magnitude response shows how the filter amplifies certain frequencies more than
others.
The phase response indicates the phase delay introduced by the filter.
The system acts as a finite impulse response (FIR) filter since it has a finite h[n].
Conclusion
The frequency response of a discrete-time filter was successfully analyzed.
The DTFT method provides direct insight into the filter’s gain and phase shift at
different frequencies.
The experiment confirms that the filter is a FIR filter, and its frequency characteristics
are fully determined by h[n].