SlideShare a Scribd company logo
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
Experiment no. 7
OBJECT:-
Impulse response and Step response of a given system
a. Write a MATLAB program to find the impulse response and step response of a
system form its difference equation.
b. Compute and plot the response of a given system to a given input.
SOFTWARE USED: MATLAB 2020b
PROCEDURE: -
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and run the program
• For the output see command window Figure window
THEORY: Impulse Response
The impulse response of a system is its output when subjected to an impulse
input (a Dirac delta function, δ(t)). Mathematically, for a linear time-invariant (LTI)
system, the impulse response h(n) can be found from its difference equation. The
impulse response provides comprehensive insight into the system's dynamics.
.
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
Step Response
The step response of a system is its output when subjected to a step input
(a Heaviside step function, u(t)). The step response can be obtained by
integrating the impulse response or directly using the difference equation.
It provides valuable information about the stability and transient
characteristics of the system.
PROGRAM:
% MATLAB code to find impulse and step response from a difference equation
%Ritesh Agrawal_2208410300045
% Define the coefficients of the difference equation
a = [1 -0.5]; % Coefficients of y[n]
b = [1 -1]; % Coefficients of x[n]
% Define the length of the response
N = 50; % Length of the response
% Generate the impulse input
impulse_input = [1; zeros(N-1, 1)];
% Compute the impulse response
impulse_response = filter(b, a, impulse_input);
% Generate the step input
step_input = ones(N, 1);
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
% Compute the step response
step_response = filter(b, a, step_input);
% Plot the impulse response
figure;
stem(0:N-1, impulse_response, 'filled');
title('Impulse Response');
xlabel('n');
ylabel('h[n]');
grid on;
% Plot the step response
figure;
stem(0:N-1, step_response, 'filled');
title('Step Response');
xlabel('n');
ylabel('s[n]');
grid on;
% MATLAB code to compute and plot the response of a system to a given input
PROGRAM:
%Ritesh Agrawal_2208410300045
% Define the coefficients of the difference equation
a = [1 -0.5]; % Coefficients of y[n]
b = [1 -1]; % Coefficients of x[n]
% Define the input signal
N = 100; % Length of the input signal
t = (0:N-1)'; % Time vector
input_signal = sin(2*pi*0.05*t); % Example input signal: a sinusoid
% Compute the response of the system to the input signal
output_signal = filter(b, a, input_signal);
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
% Plot the input signal
figure;
plot(t, input_signal);
title('Input Signal');
xlabel('n');
ylabel('x[n]');
grid on;
% Plot the response of the system
figure;
plot(t, output_signal);
title('Response of the System to the Input Signal');
xlabel('n'); ylabel('y[n]'); grid on;
RESULT:-
Results have been seen on the command window.
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
PRECAUTIONS:-
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in
proper format.
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
Experiment No.8
OBJECT:- Pole-zero diagram and bode diagram
a. Write a MATLAB program to find pole-zero diagram, bode diagram of a given
system from the given system function.
b. Write a MATLAB program to find, bode diagram of a given system from the
given system function.
SOFTWARE USED: MATLAB 2020b
PROCEDURE: -
• Open MATLAB
• Open new M-file
• Type the program
• Save in current directory
• Compile and run the program
• For the output see command window Figure window
THEORY:
Pole-Zero Analysis In the context of LTI systems, poles and zeros are the roots of
the characteristic equations derived from the system's transfer function. The
transfer function H(z)) of a discrete-time system can be expressed as:
Zeros: The values of z that make the numerator H(z)= 0.
Poles: The values of z that make the denominator H(z)= 0.
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
The location of poles and zeros in the complex plane directly influences the
system's stability and response characteristics. Poles inside the unit circle indicate
stability, while poles outside indicate instability.
A Bode diagram consists of two plots:
1. Magnitude Plot: Shows the gain of the system ∣H(jω) ∣ versus frequency (in
logarithmic scale).
2. Phase Plot: Shows the phase angle ∠H(jω) versus frequency (in logarithmic
scale)
. Bode diagrams help in understanding the frequency response of the system,
including bandwidth, resonant frequencies, and stability margins.
Pole-zero analysis and Bode diagrams are invaluable tools for understanding the
behavior and stability of LTI systems. Poles and zeros provide a direct method for
assessing system stability, while Bode diagrams offer a comprehensive view of the
system's frequency response. MATLAB simplifies these analyses through built-in
functions, enabling detailed investigation and visualization of system
characteristics. The example program Bode Diagram
demonstrates how to perform these analyses, providing a foundation for further
exploration of different systems and their responses.
PROGRAM
% Ritesh Agrawal_2208410300045
% MATLAB code to find and plot pole-zero diagram and Bode diagram
% Define the coefficients of the transfer function
% Example: H(z) = (z - 0.5) / (z^2 - 1.3z + 0.42)
numerator = [1 -0.5]; % Coefficients of the numerator
denominator = [1 -1.3 0.42]; % Coefficients of the denominator
% Create a transfer function model
sys = tf(numerator, denominator, -1); % -1 indicates discrete-time transfer
function
% Plot the pole-zero diagram
figure;
pzmap(sys);
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
title('Pole-Zero Diagram');
grid on;
% Plot the Bode diagram
figure;
bode(sys);
title('Bode Diagram');
grid on;
PROGRAM
%Ritesh Agrawal_220310300045
% MATLAB code to find and plot Bode diagram
% Define the coefficients of the transfer function
% Example: H(z) = (z - 0.5) / (z^2 - 1.3z + 0.42)
numerator = [1 -0.5]; % Coefficients of the numerator
denominator = [1 -1.3 0.42]; % Coefficients of the denominator
% Create a transfer function model
sys = tf(numerator, denominator, -1); % -1 indicates discrete-time transfer
function
% Plot the Bode diagram
figure;
bode(sys);
title('Bode Diagram');
grid on;
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
PRECAUTIONS:-
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in
proper format.
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
EXPERIMENT – 9
OBJECT: -
Frequency response of a system
Write a MATLAB program to plot magnitude and phase response of a given
system.
SOFTWARE USED: MATLAB R2024a
THEORY: -
Transfer Function
The transfer function H(s) or H(jω)of a continuous-time LTI system, or H(z) of a
discrete time LTI system, represents the system's response to sinusoidal inputs at
various frequencies. It is usually expressed as:
Magnitude Response
The magnitude response of a system, denoted as ∣H(jω)∣, shows how the
amplitude of different frequency components of the input signal is modified by
the system. It is obtained by taking the absolute value of the transfer function:
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
Phase Response
The phase response of a system, denoted as ∠H(jω), shows how the phase of
different frequency components of the input signal is shifted by the system. It is
obtained by taking the argument (or angle) of the transfer function:
PROGRAM:
%Ritesh Agrawal_220310300045
% MATLAB code to plot magnitude and phase response of a given
system
% Define the coefficients of the transfer function
% Example: H(z) = (z - 0.5) / (z^2 - 1.3z + 0.42)
numerator = [1 -0.5]; % Coefficients of the numerator
denominator = [1 -1.3 0.42]; % Coefficients of the denominator
% Define the number of frequency points
N = 1024;
% Compute the frequency response
[H, W] = freqz(numerator, denominator, N, 'whole');
% Plot the magnitude response
figure;
subplot(2, 1, 1);
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
plot(W/pi, abs(H));
title('Magnitude Response');
xlabel('Normalized Frequency (timespi rad/sample)');
ylabel('Magnitude');
grid on;
% Plot the phase response
subplot(2, 1, 2);
plot(W/pi, angle(H));
title('Phase Response');
xlabel('Normalized Frequency (timespi rad/sample)');
ylabel('Phase (radians)');
grid on;
Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd
Roll No- 2208410300045
RESULTS: Results have been seen on the command window.
PRECAUTIONS:-
1) Program must be written carefully to avoid errors.
2) Programs can never be saved as standard function name.
3) Functions in MATLAB are case sensitive so commands must be written in
proper format.

More Related Content

PDF
Signal _system _EXP_.eriment _E_0.7.0.pdf
PDF
Control Systems Engineering_MATLAB Experiments.pdf
PDF
Control Systems Engineering_MATLAB Experiments.pdf
PDF
PID Tuning using Ziegler Nicholas - MATLAB Approach
PDF
BS LAB Manual (1).pdf
PDF
Digital control for power electronic Conversters
PDF
Frequency Response with MATLAB Examples.pdf
Signal _system _EXP_.eriment _E_0.7.0.pdf
Control Systems Engineering_MATLAB Experiments.pdf
Control Systems Engineering_MATLAB Experiments.pdf
PID Tuning using Ziegler Nicholas - MATLAB Approach
BS LAB Manual (1).pdf
Digital control for power electronic Conversters
Frequency Response with MATLAB Examples.pdf

Similar to Signal _system_ experiment _lab_1.0. pdf (20)

PDF
Control system Lab record
PDF
Quiz
DOCX
Ece 415 control systems, fall 2021 computer project 1
DOCX
signal and system
PPTX
Convolution using Scilab
PDF
Applications of MATLAB in Control Part II.pdf
PPTX
Lecture 07+08_1st & 2nd Order Control Systems (1).pptx
PDF
04_AJMS_453_22_compressed.pdf
PPTX
STEP RESPONSE OF FIRST ORDER SYSTEM PART 1.pptx
PDF
Dsp lab manual
PDF
matlab_simulink_for_control082p.pdf
PPT
5_2019_01_12!09_25_57_AM.ppt
PPTX
3 analysis.gtm
PPTX
Summer training matlab
DOCX
Lab 3
PPTX
Control system with matlab Time response analysis, Frequency response analysi...
PDF
digital control sfrrffttys 24-25 (1).pdf
PDF
control system Lab 01-introduction to transfer functions
PPTX
03 dynamic.system.
Control system Lab record
Quiz
Ece 415 control systems, fall 2021 computer project 1
signal and system
Convolution using Scilab
Applications of MATLAB in Control Part II.pdf
Lecture 07+08_1st & 2nd Order Control Systems (1).pptx
04_AJMS_453_22_compressed.pdf
STEP RESPONSE OF FIRST ORDER SYSTEM PART 1.pptx
Dsp lab manual
matlab_simulink_for_control082p.pdf
5_2019_01_12!09_25_57_AM.ppt
3 analysis.gtm
Summer training matlab
Lab 3
Control system with matlab Time response analysis, Frequency response analysi...
digital control sfrrffttys 24-25 (1).pdf
control system Lab 01-introduction to transfer functions
03 dynamic.system.
Ad

Recently uploaded (20)

PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
communication and presentation skills 01
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
introduction to high performance computing
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PPT
Total quality management ppt for engineering students
PPTX
Current and future trends in Computer Vision.pptx
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
Soil Improvement Techniques Note - Rabbi
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
communication and presentation skills 01
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
R24 SURVEYING LAB MANUAL for civil enggi
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
introduction to high performance computing
Nature of X-rays, X- Ray Equipment, Fluoroscopy
Total quality management ppt for engineering students
Current and future trends in Computer Vision.pptx
Categorization of Factors Affecting Classification Algorithms Selection
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Visual Aids for Exploratory Data Analysis.pdf
Soil Improvement Techniques Note - Rabbi
Ad

Signal _system_ experiment _lab_1.0. pdf

  • 1. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 Experiment no. 7 OBJECT:- Impulse response and Step response of a given system a. Write a MATLAB program to find the impulse response and step response of a system form its difference equation. b. Compute and plot the response of a given system to a given input. SOFTWARE USED: MATLAB 2020b PROCEDURE: - • Open MATLAB • Open new M-file • Type the program • Save in current directory • Compile and run the program • For the output see command window Figure window THEORY: Impulse Response The impulse response of a system is its output when subjected to an impulse input (a Dirac delta function, δ(t)). Mathematically, for a linear time-invariant (LTI) system, the impulse response h(n) can be found from its difference equation. The impulse response provides comprehensive insight into the system's dynamics. .
  • 2. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 Step Response The step response of a system is its output when subjected to a step input (a Heaviside step function, u(t)). The step response can be obtained by integrating the impulse response or directly using the difference equation. It provides valuable information about the stability and transient characteristics of the system. PROGRAM: % MATLAB code to find impulse and step response from a difference equation %Ritesh Agrawal_2208410300045 % Define the coefficients of the difference equation a = [1 -0.5]; % Coefficients of y[n] b = [1 -1]; % Coefficients of x[n] % Define the length of the response N = 50; % Length of the response % Generate the impulse input impulse_input = [1; zeros(N-1, 1)]; % Compute the impulse response impulse_response = filter(b, a, impulse_input); % Generate the step input step_input = ones(N, 1);
  • 3. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 % Compute the step response step_response = filter(b, a, step_input); % Plot the impulse response figure; stem(0:N-1, impulse_response, 'filled'); title('Impulse Response'); xlabel('n'); ylabel('h[n]'); grid on; % Plot the step response figure; stem(0:N-1, step_response, 'filled'); title('Step Response'); xlabel('n'); ylabel('s[n]'); grid on; % MATLAB code to compute and plot the response of a system to a given input PROGRAM: %Ritesh Agrawal_2208410300045 % Define the coefficients of the difference equation a = [1 -0.5]; % Coefficients of y[n] b = [1 -1]; % Coefficients of x[n] % Define the input signal N = 100; % Length of the input signal t = (0:N-1)'; % Time vector input_signal = sin(2*pi*0.05*t); % Example input signal: a sinusoid % Compute the response of the system to the input signal output_signal = filter(b, a, input_signal);
  • 4. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 % Plot the input signal figure; plot(t, input_signal); title('Input Signal'); xlabel('n'); ylabel('x[n]'); grid on; % Plot the response of the system figure; plot(t, output_signal); title('Response of the System to the Input Signal'); xlabel('n'); ylabel('y[n]'); grid on; RESULT:- Results have been seen on the command window.
  • 5. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045
  • 6. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 PRECAUTIONS:- 1) Program must be written carefully to avoid errors. 2) Programs can never be saved as standard function name. 3) Functions in MATLAB are case sensitive so commands must be written in proper format.
  • 7. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 Experiment No.8 OBJECT:- Pole-zero diagram and bode diagram a. Write a MATLAB program to find pole-zero diagram, bode diagram of a given system from the given system function. b. Write a MATLAB program to find, bode diagram of a given system from the given system function. SOFTWARE USED: MATLAB 2020b PROCEDURE: - • Open MATLAB • Open new M-file • Type the program • Save in current directory • Compile and run the program • For the output see command window Figure window THEORY: Pole-Zero Analysis In the context of LTI systems, poles and zeros are the roots of the characteristic equations derived from the system's transfer function. The transfer function H(z)) of a discrete-time system can be expressed as: Zeros: The values of z that make the numerator H(z)= 0. Poles: The values of z that make the denominator H(z)= 0.
  • 8. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 The location of poles and zeros in the complex plane directly influences the system's stability and response characteristics. Poles inside the unit circle indicate stability, while poles outside indicate instability. A Bode diagram consists of two plots: 1. Magnitude Plot: Shows the gain of the system ∣H(jω) ∣ versus frequency (in logarithmic scale). 2. Phase Plot: Shows the phase angle ∠H(jω) versus frequency (in logarithmic scale) . Bode diagrams help in understanding the frequency response of the system, including bandwidth, resonant frequencies, and stability margins. Pole-zero analysis and Bode diagrams are invaluable tools for understanding the behavior and stability of LTI systems. Poles and zeros provide a direct method for assessing system stability, while Bode diagrams offer a comprehensive view of the system's frequency response. MATLAB simplifies these analyses through built-in functions, enabling detailed investigation and visualization of system characteristics. The example program Bode Diagram demonstrates how to perform these analyses, providing a foundation for further exploration of different systems and their responses. PROGRAM % Ritesh Agrawal_2208410300045 % MATLAB code to find and plot pole-zero diagram and Bode diagram % Define the coefficients of the transfer function % Example: H(z) = (z - 0.5) / (z^2 - 1.3z + 0.42) numerator = [1 -0.5]; % Coefficients of the numerator denominator = [1 -1.3 0.42]; % Coefficients of the denominator % Create a transfer function model sys = tf(numerator, denominator, -1); % -1 indicates discrete-time transfer function % Plot the pole-zero diagram figure; pzmap(sys);
  • 9. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 title('Pole-Zero Diagram'); grid on; % Plot the Bode diagram figure; bode(sys); title('Bode Diagram'); grid on; PROGRAM %Ritesh Agrawal_220310300045 % MATLAB code to find and plot Bode diagram % Define the coefficients of the transfer function % Example: H(z) = (z - 0.5) / (z^2 - 1.3z + 0.42) numerator = [1 -0.5]; % Coefficients of the numerator denominator = [1 -1.3 0.42]; % Coefficients of the denominator % Create a transfer function model sys = tf(numerator, denominator, -1); % -1 indicates discrete-time transfer function % Plot the Bode diagram figure; bode(sys); title('Bode Diagram'); grid on;
  • 10. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 PRECAUTIONS:- 1) Program must be written carefully to avoid errors. 2) Programs can never be saved as standard function name. 3) Functions in MATLAB are case sensitive so commands must be written in proper format.
  • 11. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 EXPERIMENT – 9 OBJECT: - Frequency response of a system Write a MATLAB program to plot magnitude and phase response of a given system. SOFTWARE USED: MATLAB R2024a THEORY: - Transfer Function The transfer function H(s) or H(jω)of a continuous-time LTI system, or H(z) of a discrete time LTI system, represents the system's response to sinusoidal inputs at various frequencies. It is usually expressed as: Magnitude Response The magnitude response of a system, denoted as ∣H(jω)∣, shows how the amplitude of different frequency components of the input signal is modified by the system. It is obtained by taking the absolute value of the transfer function:
  • 12. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 Phase Response The phase response of a system, denoted as ∠H(jω), shows how the phase of different frequency components of the input signal is shifted by the system. It is obtained by taking the argument (or angle) of the transfer function: PROGRAM: %Ritesh Agrawal_220310300045 % MATLAB code to plot magnitude and phase response of a given system % Define the coefficients of the transfer function % Example: H(z) = (z - 0.5) / (z^2 - 1.3z + 0.42) numerator = [1 -0.5]; % Coefficients of the numerator denominator = [1 -1.3 0.42]; % Coefficients of the denominator % Define the number of frequency points N = 1024; % Compute the frequency response [H, W] = freqz(numerator, denominator, N, 'whole'); % Plot the magnitude response figure; subplot(2, 1, 1);
  • 13. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 plot(W/pi, abs(H)); title('Magnitude Response'); xlabel('Normalized Frequency (timespi rad/sample)'); ylabel('Magnitude'); grid on; % Plot the phase response subplot(2, 1, 2); plot(W/pi, angle(H)); title('Phase Response'); xlabel('Normalized Frequency (timespi rad/sample)'); ylabel('Phase (radians)'); grid on;
  • 14. Name-Ritesh Agrawal Branch- Electronics Engineering Year- 2nd Roll No- 2208410300045 RESULTS: Results have been seen on the command window. PRECAUTIONS:- 1) Program must be written carefully to avoid errors. 2) Programs can never be saved as standard function name. 3) Functions in MATLAB are case sensitive so commands must be written in proper format.