BS LAB Recent
BS LAB Recent
Id:23011MB605
2024-25
DATE OF
S.NO NAME OF THE EXPERIMENT PAGE.NO REMARK
EXPERIMENT
BASIC OPERATIONS ON
1. 03-08 21-08-2024
MATRICES
SCALING OPERATIONS ON
6. 35-39 18-09-2024
SIGNALS AND SEQUENCES
VERIFICATION OF SAMPLING
10. 53-56 02-10-2024
THEOREM
VERIFICATION OF GIBBS
11. 57-59 02-10-2024
PHENOMENON
BS LAB 1 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
VERIFICATION OF LINEARITY OF
13. 65-68 09-10-2024
A SYSTEM
AUTOCORRELATION &
14. 69-71 16-10-2024
CROSSCORRELATION OF SIGNAL
GENERATION OF GAUSSIAN
15. NOISE AND EXTRACTING 72-74 23-10-2024
ITS PARAMETERS
FOURIER TRANSFORM OF
SIGNAL AND PLOTTING
18. 85-93 13-11-2024
MAGNITUDE AND PHASE
RESPONSE
LAPLACE TRANSFORM OF
19. SIGNAL AND PLOTTING 94-99 10-02-2022
ZERO’S & POLES
Z – TRANSFORM OF SIGNAL
20. AND PLOTTING LOCATION OF 100-105 16-02-2022
ZERO’S & POLES
BS LAB 2 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
Number of Programs: 1
Aim:
To perform the basic operations on matrices and to get the output.
Software Required:
MATLAB.
Theory:
MATLAB treats all variables as matrices. Vectors are special forms of matrices and contain
only one row or one column. Whereas scalars are special forms of matrices and contain only
one row and one column. A matrix with one row is called row vector and a matrix with single
column is called column vector.
Some of convenient matrix building functions are as follows:
⮚ A+B:Performs Addition of Matrices.
⮚ A-B: Performs Subtraction of Matrices.
⮚ A*B: Performs Multiplication of Matrices.
⮚ A/B: Performs Division of Matrices.
⮚ A.*B: Performs Element Wise Multiplication of Matrices.
⮚ A./B: Performs Element Wise Division of Matrices.
⮚ cat(x,A,B):Performs Concatination of Matrices(x is the Dimension of matrices).
⮚ Selection:Selects a sub matrix or row or column of a matrix.
⮚ Deletion: Delets a sub matrix or row or column of a matrix.
⮚ length(A):Gives length of a Matrix.
⮚ size(A): Gives size of a Matrix.
⮚ rank(A): Gives rank of a Matrix.
⮚ det(A): Gives Determinant of a Matrix.
⮚ eig(A): Gives Eigen values of a Matrix.
⮚ trace(A): Gives trace of a Matrix.
⮚ diag(A): Gives diagonal elements of a Matrix.
⮚ inv(A): Gives Inverse of a Matrix.
⮚ transpose(A): Gives transpose of a Matrix.
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
BS LAB 3 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
Program:
clc;
clear all;
close all;
A=[ 1 , 2 , 3 ; 4 , 5 , 6 ; 7 , 8 , 9]
B=[ 3 , 2 , 1 ; 6 , 5 , 4 ; 9 , 8 , 7]
m_sum=A+B
m_diff=A-B
m_mul=A*B
m_div=A/B
m_mulE=A.*B
m_divE=A./B
m_len=length(A)
m_siz=size(A)
m_rnk=rank(A)
m_det=det(A)
m_eig=eig(A)
m_trc=trace(A)
m_dgm=diag(A)
m_dg1=diag(A,1)
m_dg2=diag(A,2)
m_inv=inv(A)
m_trp=transpose(A)
m_cat_1=cat(1,A,B)
m_cat_2=cat(2,A,B)
m_del_1=A(:,:,1)
m_del_r=A(2,:)
m_del_c=A(:,3)
m_sel_1=A(1:2 , 2:3)
m_sel_r=A(2,:)
m_sel_c=A(:,3)
Output:
A=
1 2 3
4 5 6
7 8 9
B=
BS LAB 4 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
3 2 1
6 5 4
9 8 7
m_sum =
4 4 4
10 10 10
16 16 16
m_diff =
-2 0 2
-2 0 2
-2 0 2
m_mul =
42 36 30
96 81 66
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =
2.312965e-18.
m_div =
m_mulE =
3 4 3
24 25 24
63 64 63
m_divE =
BS LAB 5 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
m_len =
m_siz =
3 3
m_rnk =
m_det =
-9.5162e-16
m_eig =
16.1168
-1.1168
-0.0000
m_trc =
15
m_dgm =
m_dg1 =
m_dg2 =
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =
2.202823e-18.
BS LAB 6 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
m_inv =
1.0e+16 *
m_trp =
1 4 7
2 5 8
3 6 9
m_cat_1 =
1 2 3
4 5 6
7 8 9
3 2 1
6 5 4
9 8 7
m_cat_2 =
1 2 3 3 2 1
4 5 6 6 5 4
7 8 9 9 8 7
m_del_1 =
1 2 3
4 5 6
7 8 9
m_del_r =
BS LAB 7 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
4 5 6
m_del_c =
m_sel_1 =
2 3
5 6
m_sel_r =
4 5 6
m_sel_c =
Result:
Hence the basic operations on matrices have been performed.
BS LAB 8 ECE-CEH-JNTUH
Std.Id:23011MB605
2024-25
Number of Programs: 9
Aim:
To generate different types of signals by using MATLAB inbuilt functions and to observe the
output.
Software Required:
MATLAB.
Theory:
Functions that are frequently used or that can take more time to execute are often implemented as
executable files. These functions are called built-ins.
Unlike MATLAB program file functions, you cannot see the source code for built-ins. Although
most built-in functions do have a program file associated with them, this file is there mainly to
supply the help documentation for the function.
Functions that are frequently used or that can take more time to execute are often implemented as
executable files. These functions are called built-ins.
Unlike MATLAB program file functions, you cannot see the source code for built-ins. Although
most built-in functions do have a program file associated with them, this file is there mainly to
supply the help documentation for the function.
If the amplitude of the signal is defined at every instant of time then it is called
continuous time signal. If the amplitude of the signal is defined at only at some instants
of
time then it is called discrete time signal. If the signal repeats itself at regular intervals then it
is called periodic signal. Otherwise they are called aperiodic signals.
Ramp signal: The ramp function is a unitary real function, easily computable as the mean of
the independent variable and its absolute value.This function is applied in engineering. The
name ramp function is derived from the appearance of its graph.
r(t)= t
Unit impulse signal: One of the more useful functions in the study of linear systems is the
"unit impulse function."An ideal impulse function is a function that is zero everywhere but at
the origin, where it isinfinitely high. However, the area of the impulse is finite
Y(t)= 1 when t=0
= 0 other wise
Unit step signal: The unit step function and the impulse function are considered to be
fundamental functions in engineering, and it is strongly recommended that the reader
becomes very familiar with both of these functions.
BS LAB 9 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
u(t)= 0 if t < 0
=1 if t > 0
=1/2 if t=0
Sinc signal: There is a particular form that appears so frequently in communications
engineering, that we give it its own name. This function is called the "Sinc function”.
The Sinc function is defined in the following manner:
Sinc(x) =1 if x=0
Sinc(x)=(sin(pi*x))/(pi*x) else
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
Output-1:
BS LAB 10 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-2:
Output-3:
BS LAB 11 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-4:
BS LAB 12 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-5:
Output-6:
BS LAB 13 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-7:
Output-8:
BS LAB 14 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
grid on;
Output-9:
Result:
Hence the different types of signals by using MATLAB inbuilt functions are generated and
output is observed.
BS LAB 15 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:8
Aim:
To generate different types of signals by using Loops and Conditional Statements and to
observe the output.
Software Required:
MATLAB.
Theory:
Loops and Conditional Statements
Control flow and branching using keywords, such as if, for, and while.
switch, case,
Conditional Statements
To determine which block of code to execute at run time, use if or switch conditional statements.
BS LAB 16 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
Output-1:
BS LAB 17 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-2:
BS LAB 18 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
clear all;
t=2:0.01:10;
for i=1:1:length(t)
if(t(i)<4)
y(i)=0;
else if(t(i)<6)
y(i)=1;
else if(t(i)<8)
y(i)=0;
else
y(i)=1;
end
end
end
end
plot(t,y);
axis([0,12,-2,3]);
title('Square Wave using
Loops'); xlabel('time');
ylabel('amplitude');
grid on;
Output-3:
BS LAB 19 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
plot(t,y);
axis([-2,10,-3,3]);
title('Triangular Wave using Loops');
xlabel('time');
Output-4:
Output-5:
BS LAB 20 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-6:
BS LAB 21 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
plot(t,y);
title('Sinc Signal using Loops');
xlabel('time');
ylabel('amplitude');
grid on;
Output-7:
Output-8:
BS LAB 22 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the different types of signals by using Loops and Conditional statements are generated
and output is observed.
BS LAB 23 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:8
Aim:
To generate different types of signals by using Time Basis and to observe the output.
Software Required:
MATLAB.
Theory:
If the amplitude of the signal is defined at every instant of time then it is called
continuous time signal. If the amplitude of the signal is defined at only at some instants
of
time then it is called discrete time signal. If the signal repeats itself at regular intervals then it
is called periodic signal. Otherwise they are called aperiodic signals.
EX: ramp,Impulse,unit step, sinc- Aperiodic signals
square,sawtooth,triangular sinusoidal – periodic signals.
Ramp sinal: The ramp function is a unitary real function, easily computable as the mean of
the independent variable and its absolute value.This function is applied in engineering. The
name ramp function is derived from the appearance of its graph.
r(t)= t when t>=0
= 0 else
Unit impulse signal: One of the more useful functions in the study of linear systems is the
"unit impulse function."An ideal impulse function is a function that is zero everywhere but at
the origin, where it isinfinitely high. However, the area of the impulse is finite
Y(t)= 1 when t=0
= 0 other wise
Unit step signal: The unit step function and the impulse function are considered to be
fundamental functions in engineering, and it is strongly recommended that the reader
becomes very familiar with both of these functions.
u(t)= 0 if t < 0
= 1 if t > 0
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
BS LAB 24 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-1:
BS LAB 25 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
ylabel('amplitude');
grid on;
Output-2:
Output-3:
BS LAB 26 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
y=t.*(t>=0&t<2)+(-t+4).*(t>=2&t<6)+(t-8).*(t>=6&t<8);
plot(t,y);
axis([-2,10,-3,3]);
title('Triangular Wave using Time Basis');
xlabel('time');
ylabel('amplitude');
grid on;
Output-4:
Output-5:
BS LAB 27 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-6:
BS LAB 28 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-8:
Result:
Hence the different types of signals by using Loops and Conditional statements are generated
and output is observed.
BS LAB 29 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:2
Aim:
To perform the basic arithmetic operations like addition, subtraction,multiplication,division on
two signals and observe the obtained results.
Software Required:
MATLAB.
Theory:
A signal, comprises of a set of information expressed as a function of any number of independent variables,
that can be given as an input to a system, or derived as output from the system, to realize its true practical
∴ being well acquainted with some basic signal operations may come really handy to enhance the
utility. The signal we derive out of a complex system might not always be in the form we want,
Addition
Subtraction
Multiplication
division
Addition:
Addition can be carried out using the ‘ + ‘ symbol and plotting will give you the result.
Subtraction:
With the same program code as of addition replacing arithmetic operator ‘ – ‘ we can perform
subtraction in signals.
Multiplication:
BS LAB 30 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Division:
By using ' / ' operator we can perform division of signals.
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
BS LAB 31 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
y3=y1+y2;
subplot(2,3,3);
plot(t,y3);
title('y3');
xlabel('time');
ylabel('(y1+y2) values');
axis([-1,9,-2,8]);
grid on;
y4=y1-y2;
subplot(2,3,4);
plot(t,y4);
title('y4');
xlabel('time');
ylabel('(y1-y2) values');
axis([-1,9,-4,6]);
grid on;
y5=y1.*y2;
subplot(2,3,5);
plot(t,y5);
title('y5');
xlabel('time');
ylabel('(y1.*y2) values');
axis([-1,9,-2,10]);
grid on;
y6=y1./y2;
subplot(2,3,6);
plot(t,y6);
xlabel('time');
ylabel('(y1./y2) values');
axis([-1,9,-2,6]);
grid on;
Output-1:
BS LAB 32 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
clc;
clear all;
close all;
t=0:0.01:6;
y1=(-2.*t+6).*(t>0 & t<1)+(2.*t+2).*(t>=1 & t<2)+2.*(t>=2 & t<4)+
(-2.*t+14).*(t>=4 & t<5)+(2*t-6).*(t>=5 & t<6);
subplot(2,3,1);
plot(t,y1);
title('y1');
xlabel('time');
ylabel('y1 values');
axis([-2,8,-2,8]);
grid on;
y2=2.*(t>0 & t<2)+1.*(t>=2 & t<4)+2*(t>=4 & t<6);
subplot(2,3,2);
plot(t,y2);
title('y2');
xlabel('time');
ylabel('y2 values');
axis([-2,8,-2,4]);
grid on;
y3=y1+y2;
subplot(2,3,3);
plot(t,y3);
title('y3');
xlabel('time');
ylabel('(y1+y2) values');
axis([-2,8,-2,10]);
grid on;
y4=y1-y2;
subplot(2,3,4);
plot(t,y4);
title('y4');
xlabel('time');
ylabel('(y1-y2) values');
axis([-2,8,-2,6]);
grid on;
y5=y1.*y2;
subplot(2,3,5);
plot(t,y5);
title('y5');
xlabel('time');
ylabel('(y1.*y2) values');
axis([-2,8,-2,14]);
grid on;
y6=y1./y2;
subplot(2,3,6);
plot(t,y6);
xlabel('time');
ylabel('(y1./y2) values');
axis([-2,8,0,6]);
grid on;
BS LAB 33 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-2:
Result:
Hence the basic arithmetic operations like addition, subtraction,multiplication,division are
performed on two signals and obtained results are observed
BS LAB 34 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:2
Aim:
To perform the scaling operations like time scaling,amplitude scaling on signal and observe the
obtained results.
Software Required:
MATLAB.
Theory:
Time Scaling
So the y-axis being same, the x- axis magnitude decreases or increases according to the sign of the
constant (whether positive or negative). Therefore, scaling can also be divided into two categories
as discussed below.
Time Compression
Whenever alpha is greater than zero, the signal’s amplitude gets divided by alpha whereas the value
of the Y-axis remains the same. This is known as Time Compression.
Time Expansion
When the time is divided by the constant alpha, the Y-axis magnitude of the signal get multiplied
alpha times, keeping X-axis magnitude as it is. Therefore, this is called Time expansion type signal.
Amplitude Scaling
Multiplication of a constant with the amplitude of the signal causes amplitude scaling. Depending
upon the sign of the constant, it may be either amplitude scaling or attenuation
Amplitude Compression
Amplitude Expansion
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
BS LAB 35 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
BS LAB 36 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
axis([-2,26,-2,18]);
grid on;
y6=2*(t>0 & t<1)+(2*t).*(t>=1 & t<2)+2*(t>=2 & t<3);
subplot(3,3,6);
plot(t,y6);
title('y6');
xlabel('time');
ylabel('y6 values');
axis([-2,26,-2,18]);
grid on;
y7=2*(t>0 & t<4)+(t/2).*(t>=4 & t<8)+2*(t>=8 & t<12);
subplot(3,3,7);
plot(t,y7);
title('y7');
xlabel('time');
ylabel('y7 values');
axis([-2,26,-2,18]);
grid on;
y8=2*(t>0 & t<0.5)+(4*t).*(t>=0.5 & t<1)+2*(t>=1 & t<1.5);
subplot(3,3,8);
plot(t,y8);
title('y8');
xlabel('time');
ylabel('y8 values');
axis([-2,26,-2,18]);
grid on;
y9=2*(t>0 & t<8)+(t/4).*(t>=8 & t<16)+2*(t>=16 & t<24);
subplot(3,3,9);
plot(t,y9);
xlabel('time');
ylabel('y9 values');
title('y9');
axis([-2,26,-2,18]);
grid on;
Output-1:
BS LAB 37 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
BS LAB 38 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
plot(t,y7);
title('y7');
xlabel('time');
ylabel('y7 values');
axis([-10,10,-2,6]);
grid on;
y8=sin(pi*t*4)./(pi*t*4);
subplot(3,3,8);
plot(t,y8);
title('y8');
xlabel('time');
ylabel('y8 values');
axis([-10,10,-2,6]);
grid on;
y9=sin(pi*(t/4))./(pi*(t/4));
subplot(3,3,9);
plot(t,y9);
xlabel('time');
ylabel('y9 values');
title('y9');
axis([-10,10,-2,6]);
grid on;
Output-2:
Result:
Hence the the scaling operations like time scaling,amplitude scaling are performed on signal
and obtained results are observed.
BS LAB 39 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:4
Aim:
To perform the shifting in x-axis,shifting in y-axis,folding of signals and observe the obtained
results.
Software Required:
MATLAB.
Theory:
1. Time Shifting
Suppose that we have a signal x(t) and we define a new signal by adding/subtracting a finite time
value to/from it. We now have a new signal, y(t). The mathematical expression for this would be x(t
+t0).
Graphically, this kind of signal operation results in a positive or negative “shift” of the signal along
its time axis. However, note that while doing so, none of its characteristics are altered. This means
that the time-shifting operation results in the change of just the positioning of the signal without
affecting its amplitude or span.
Case 1 (t0 > 0)
When K is greater than zero, the shifting of the signal takes place towards "left" in the time domain.
Therefore, this type of shifting is known as Left Shifting of the signal.
Case 2 (t0 < 0)
When K is less than zero the shifting of signal takes place towards right in the time domain.
Therefore, this type of shifting is known as Right shifting.
2. Amplitude Shifting
Suppose that we have a signal x(t) and we define a new signal by adding/subtracting a finite
time value to/from it. We now have a new signal, y(t). The mathematical expression for this
would be x(t)+K
Graphically, this kind of signal operation results in a positive or negative “shift” of the signal along
its amplitude axis. However, note that while doing so, none of its characteristics are altered. This
means that the amplitude-shifting operation results in the change of just the amplitude of the signal
without affecting its position.
Case 1 (K > 0)
When K is greater than zero, the shifting of signal takes place towards up in the x-axis. Therefore,
this type of shifting is known as upward shifting.
Case 2 (K < 0)
When K is less than zero shifting of signal takes place towards downward in the X- axis.
Therefore, it is called downward shifting of the signal.
3. Folding of Signals
Folding along y-axis
BS LAB 40 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Suppose that we have a signal x(t) and we define a new signal by adding/subtracting a finite
time value to/from it. We now have a new signal, y(t). The mathematical expression for this
would be k*x(t) (k=-1)
Folding along x-axis
Suppose that we have a signal x(t) and we define a new signal by adding/subtracting a finite
time value to/from it. We now have a new signal, y(t). The mathematical expression for this
would be x(k*t) (k=-1)
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
Program-1:Shifting of Signal-1:
clc;
clear all;
close all;
t=0:0.01:4;
y1=((0.5).*t).*(t>0 & t<=2)+((-0.5).*(t-4)).*(t>2 & t<=4);
subplot(2,3,1);
plot(t,y1);
title('y1');
xlabel('time');
ylabel('y1 values');
axis([-3,6,-2,4]);
grid on;
y2=y1+2;
subplot(2,3,2);
plot(t,y2);
title('y2');
xlabel('time');
ylabel('y2 values');
axis([-3,6,-2,4]);
grid on;
y3=y1-2;
subplot(2,3,3);
plot(t,y3);
title('y3');
xlabel('time');
ylabel('y3 values');
axis([-3,6,-2,4]);
grid on;
BS LAB 41 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
subplot(2,3,5);
plot(t-2,y1);
title('y4');
xlabel('time');
ylabel('y4 values');
axis([-3,6,-2,4]);
grid on;
subplot(2,3,6);
plot(t+2,y1);
xlabel('time');
ylabel('y5 values');
title('y5');
axis([-3,6,-2,4]);
grid on;
Output-1:
Program-2:Shifting of Signal-2:
clc;
clear all;
close all;
t=-1:0.01:1;
y1=1.*(t>-1 & t<1);
subplot(2,3,1);
plot(t,y1);
title('y1');
xlabel('time');
ylabel('y1 values');
axis([-4,4,-2,4]);
grid on;
y2=y1+2;
subplot(2,3,2);
plot(t,y2);
title('y2');
xlabel('time');
ylabel('y2 values');
axis([-4,4,-2,4]);
grid on;
y3=y2-2;
BS LAB 42 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
subplot(2,3,3);
plot(t,y3);
title('y3');
xlabel('time');
ylabel('y3 values');
axis([-4,4,-2,4]);
grid on;
subplot(2,3,5);
plot(t-2,y1);
title('y4');
xlabel('time');
ylabel('y4 values');
axis([-4,4,-2,4]);
grid on;
subplot(2,3,6);
plot(t+2,y1);
xlabel('time');
ylabel('y5 values');
title('y5');
axis([-4,4,-2,4]);
grid on;
Output-2:
Program-3:Folding of Signal-3:
clc;
clear all;
close all;
t=0:0.01:(2*pi);
y1=sin(t);
subplot(2,2,1);
plot(t,y1);
title('y1');
xlabel('time');
ylabel('y1 values');
axis([-2,9,-2,2]);
grid on;
y2=fliplr(y1);
subplot(2,2,2);
BS LAB 43 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
plot(t,y2);
title('y2');
xlabel('time');
ylabel('y2 values');
axis([-2,9,-2,2]);
grid on;
Output-3:
Program-4:Folding of Signal-4:
clc;
clear all;
close all;
t=-2:0.001:2;
y1=1.*(t>-2 & t<=-1)+2.*(t>-1 & t<=0)+(-2).*(t>0 & t<=1)+(-1).*(t>1 & t<2);
subplot(2,1,1);
plot(t,y1);
title('y1');
xlabel('time');
ylabel('y1 values');
axis([-3,3,-3,3]);
grid on;
y2=fliplr(y1);
subplot(2,1,2);
plot(t,y2);
title('y2');
xlabel('time');
ylabel('y2 values');
axis([-3,3,-3,3]);
grid on;
Output-4:
BS LAB 44 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the shifting in x-axis,shifting in y-axis,folding of signals is done and obtained results
are observed.
BS LAB 45 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:1
Aim:
To find the real and imaginary parts of a complex signal.
Software Required:
MATLAB.
Theory:
A complex analog signalx(t) is formed by the signal pair{xR(t),xI(t)}, where
both xR(t) and xI(t) are the ordinary real signals. The relationship between these
signals is given by:
x(t) =xR(t) +jxI(t) wherej=√−1.
A complex discrete (or digital) signal x(n) is defined in a similar manner:
x(n) =xR(n) +jxI(n)
A complex number x can be represented by its real and imaginary parts xR and xI, or
by its magnitude and phase a and θ, respectively.
The relationshipbetween these values is given below:
Complex signals are defined both in continuous time and discrete time:
x(t) =a(t) exp(jθa(t)) and
x(n) =a(n) exp(jθ(n))
where
a(t) =(x2R(t) +x2I(t)).^(0.5) and
a(n) =(x2R(n) +x2I(n)).^(0.5)
θ(t) = arctan(xI(t)/xR(t)) and
θ(n) = arctan(xI(n)/xR(n))
xR(t) =a(t) cos(θ(t)) and
xR(n) =a(n) cos(θ(n))
xI(t) =a(t) sin(θ(t)) and
xI(n) =a(n) sin(θ(n))
The magnitudes a(t) and a(n) are also known as envelopes of x(t) and x(n)
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
BS LAB 46 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output:
BS LAB 47 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the real and imaginary parts of a complex signal are found.
BS LAB 48 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:2
Aim:
To find the Even and Odd Components of signal.
Software Required:
MATLAB.
Theory:
One of characteristics of signal is symmetry that may be useful for signal analysis. Even signals are
symmetric around vertical axis, and Odd signals are symmetric about origin.
Even Signal:
Odd Signal:
An odd signal must be 0 at t=0, in other words, odd signal passes the origin.
Using the definition of even and odd signal, any signal may be decomposed into a sum of its even
part, xe(t), and its odd part, xo(t), as follows:
xe(t)=1/2{x(t)+x(-t)}
xo(t)=1/2{x(t)-x(-t)}
x(t)=xe(t)+xo(t)
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
BS LAB 49 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-1:
BS LAB 50 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
BS LAB 51 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-2:
Result:
Hence the Even and Odd Components of signal are found.
BS LAB 52 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:1
Aim:
To verify the sampling theorm for over sampling,critical sampling,under sampling cases and to
observe the output waveforms.
Software Required:
MATLAB.
Theory:
The Sampling Theorem
The sampling theorem specifies the minimum-sampling rate at which a continuous-time signal
needs to be uniformly sampled so that the original signal can be completely recovered or
reconstructed by these samples alone. This is usually referred to as Shannon's sampling theorem in
the literature.
If a continuous time signal contains no frequency components higher than W hz, then it can be
completely determined by uniform samples taken at a rate fs samples per second where
fs>=2W
Undersampling
When a bandpass signal is sampled slower than its Nyquist rate, the samples are indistinguishable
from samples of a low-frequency alias of the high-frequency signal. That is often done purposefully
in such a way that the lowest-frequency alias satisfies the Nyquist criterion, because the bandpass
signal is still uniquely represented and recoverable. Such undersampling is also known as bandpass
sampling, harmonic sampling, IF sampling, and direct IF to digital conversion.[22]
Oversampling
BS LAB 53 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Critical Sampling
fs=2W
A bandlimited signal can be reconstructed exactly if it is sampled at a rate atleast twice the
maximum frequency component in it." Figure 1 shows a signal g(t) that is bandlimited.
BS LAB 54 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Figure 5: Recovery of signal by filtering with a fiter of width 2wm Aliasing ws < 2wm.
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
BS LAB 55 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
fso=10*fm;
nu=0:1/fsu:tp;
nc=0:1/fsc:tp;
no=0:1/fso:tp;
xu=cos(2*pi*fm*nu);
xc=cos(2*pi*fm*nc);
xo=cos(2*pi*fm*no);
subplot(3,1,1);plot(t,xa,'b',nu,xu,'r*-');title('under sampling');
subplot(3,1,2);plot(t,xa,'b',nc,xc,'r*-');title('critical sampling');
subplot(3,1,3);plot(t,xa,'b',no,xo,'r*-');title('over sampling');
Input:
enter the analog signal freq:50;
Output:
Result:
Hence the sampling theorm is verified for over sampling,critical sampling,under sampling
cases and output waveforms are observed.
BS LAB 56 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:1
Aim:
To verify the Gibbs Phenomenon at 4 different number of Harmonics of a signal and to observe
the output waveforms.
Software Required:
MATLAB.
Theory:
Gibbs Phenomenon:
The Gibbs phenomenon, the Fourier series of a piecewise continuously differentiable
periodic function behaves at a jump discontinuity.The n the approximated function shows
amounts of ripples at the points of discontinuity. This is known as the Gibbs Phenomina .
partial sum of the Fourier series has large oscillations near the jump, which might increase
the maximum of the partial sum above that of the function itself. The overshoot does not die
out as the frequency increases, but approaches a finite limit
The Gibbs phenomenon involves both the fact that Fourier sums overshoot at a jump
discontinuity, and that this overshoot does not die out as the frequency increases.
Gibbs Phenomenon is used to convert the sine wave in to square wave by adding the
number of harmonics to the sine wave using fourier series. if you give the highest number of
harmonics (32 or 64) the output graphs show how gradually the sine converts in to square wave.
From a signal processing point of view, the Gibbs phenomenon is the step response of a low-pass
filter, and the oscillations are called ringing or ringing artifacts. Truncating the Fourier transform of
a signal on the real line, or the Fourier series of a periodic signal (equivalently, a signal on the
circle) corresponds to filtering out the higher frequencies by an ideal (brick-wall) low-pass/high-cut
filter. This can be represented as convolution of the original signal with the impulse response of the
filter (also known as the kernel), which is the sinc function. Thus the Gibbs phenomenon can be
seen as the result of convolving a Heaviside step function (if periodicity is not required) or a square
wave (if periodic) with a sinc function: the oscillations in the sinc function cause the ripples in the
output.
Formula:
Gibbs phenomenon:
∞
BS LAB 58 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
Output :
BS LAB 59 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the Gibbs Phenomenon is verified at 4 different number of Harmonics of a signal and
the output waveforms are observed.
BS LAB 51 ECE-CEH-JNTUH
0
2021-22 Std.Id:20011A0403
Number of Programs:3
Aim:
To perform the convolution of two signals and to observe the obtained output waveforms.
Software Required:
MATLAB.
Theory:
Convolution
Convolution is the basic concept in signal processing that states an input signal can be combined
with the system's function to find the output signal. It is the integral of the product of two
waveforms after one has reversed and shifted; the symbol for convolution is
Consider two waveforms f and g. By calculating the convolution, we determine how much a
reversed function g must be shifted along the x-axis to become identical to function f. The
convolution function essentially reverses and slides function g along the axis, and calculates the
integral of their (f and the reversed and shifted g) product for each possible amount of sliding.
When the functions match, the value of (f*g) is maximized. This occurs because when positive
areas (peaks) or negative areas (troughs) are multiplied, they contribute to the integral.
BS LAB 60 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Calculations:
Convolution of Square and a Triangular Signal:
The given signals x(t) and h(t) can be mathematically expressed as :
X(t)={𝑡 𝑓𝑜𝑟 0 ≤ 𝑡 ≤ 2 4 − 𝑡 𝑓𝑜𝑟 2 ≤ 𝑡 ≤ 4
h(t)=2 for 0≤ 𝑡 ≤ 2
for t<0
x(𝜏)ℎ(𝑡 − 𝜏) = 0
∞
y(t) =ƒ 𝑥(𝜏)ℎ(𝑡 − 𝜏)𝑑=0
–
∞
for 0<t<2
now, x(𝜏) = 𝜏
and h(t- 𝜏)=2 (for 0<t<2)
t
y(t) ℎ (𝑡 − 𝜏)𝑑
𝑥()ℎ
= ƒ0
t
=ƒ0 (𝜏)(2) 𝑑
𝜏2
=2[t ]0
2
For 2≤ 𝑡 ≤
4 t
2 𝑥(𝜏)ℎ(𝑡 − 𝜏)𝑑𝜏+ ƒ 𝑥(𝜏)ℎ(𝑡 − 𝜏)𝑑
2
Y(t) = ƒt–2 t
2
=ƒt–2
2
𝜏(2) 𝑑 + ƒ2 (4 − 𝜏)(2) 𝑑
𝜏 2 t
=2[ ]t–2+ƒ2 (8 − 2𝜏) 𝑑
2
=-2𝑡2 + 12𝑡 + 12
For 4≤ 𝑡 ≤
6
4 ℎ (𝑡 − 𝜏)𝑑
𝑥()ℎ
Y(t) =ƒt–2
4
=ƒ 2(4 − 𝜏)𝑑
t–
2 (8𝑑𝑡 − 2𝑑)
4
=ƒ
t–
2
=𝑡2 − 12𝑡 + 36
For𝑡 ≥6
Y(t) =0
BS LAB 61 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Y(t)={0 𝑓𝑜𝑟 𝑡 < 0 𝑡2 𝑓𝑜𝑟 0 ≤ 𝑡 ≤ 2 − 2𝑡2 + 12𝑡 − 12 𝑓𝑜𝑟 2 ≤
𝑡 ≤ 4 𝑡2 + 12𝑡 − 36 𝑓𝑜𝑟 4 ≤ 𝑡 ≤ 6 0 𝑓𝑜𝑟 𝑡 > 6
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
BS LAB 62 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-1:
BS LAB 63 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
clc;
clear all;
close all;
t1s=0; t1e=4;
t2s=0; t2e=5;
step_val=0.1;
t1=t1s:step_val:t1e;
x1=double((t1>=0)&(t1<4));
t2=t2s:step_val:t2e;
x2=double((t2/2).*(t2>=0&t2<2)+((-t2/2)+2).*(t2>=2&t2<4));
t3=t1s+t2s:step_val:t2e+t1e;
x=conv(x1,x2);
subplot(3,1,1);plot(t1,x1);title('first signal');grid on;axis([t1s+t2s-1,t1e+t2e+1,min(x1)-
1,max(x1)+1]);
subplot(3,1,2);plot(t2,x2);title('second signal');grid on;axis([t1s+t2s-1,t1e+t2e+1,min(x2)-
1,max(x2)+1]);
subplot(3,1,3);plot(t3,x);title('conv signal');grid on;axis([t1s+t2s-1,t1e+t2e+1,min(x)-1,max(x)+1]);
Output-2:
BS LAB 64 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
x=conv(x1,x2);
subplot(3,1,1);plot(t1,x1);title('first signal');grid on;axis([t1s+t2s-1,t1e+t2e+1,min(x1)-
1,max(x1)+1]);
subplot(3,1,2);plot(t2,x2);title('second signal');grid on;axis([t1s+t2s-1,t1e+t2e+1,min(x2)-
1,max(x2)+1]);
subplot(3,1,3);plot(t3,x);title('conv signal');grid on;axis([t1s+t2s-1,t1e+t2e+1,min(x)-1,max(x)+1]);
Output-3:
Result:
Hence the convolution of two signals is performed and the obtained output waveforms are
observed.
BS LAB 65 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:3
Aim:
To verify whether the given system is a Linear or a Non-Linear System.
Software Required:
MATLAB.
Theory:
Linear or Non-linear Systems (Linearity Property):
A linear system is a system which follows the superposition principle. Let us consider a system
having its response as ‘T’, input as x(n) and it produces output y(n). This is shown in figure below:
Let us consider two inputs. Input x1(n) produces output y1(n) and input x2(n) produces output
y2(n). Now consider two arbitrary constants a1 and a2. Then simply multiply these constants with
input x1(n) and x2(n) respectively. Thus a1x1(n) produces output a1y1(n) and a2x2(n) produces
output a2y2(n).
Theorem for linearity of the system:
A system is said to be linear if the combined response of a1x1(n) and a2x2(n) is equal to the
addition of the individual responses.
That means,
T[a1 x1(n) + a2 x2(n)] = a1 T[x1(n)] + a2 T[x2(n)].....................1)
The above theorem is also known as superposition theorem.
Important Characteristic:
Linear system has one important characteristic: If the input to the system is zero then it produces
zero output. If the given system produces some output (non-zero) at zero input then the system is
said to be Non-linear system. If this condition is satisfied then apply the superposition theorem to
determine whether the given system is linear or not?
For continuous time system:
Similar to the discrete time system a continuous time system is said to be linear if it follows the
superposition theorem.
Let us consider two systems as follows:
y1(t) = f[x1(t)]
And y2(t) = f[x2(t)]
Here y1(t) and y2(t) are the responses of the system and x1(t) and x2(t) are the excitations. Then the
system is said to be linear if it satisfies the following expression:
f[a1 x1(t) + a2 x2(t)] = a1 y1(t) + a2 y2(t).....................1)
Where a1 and a2 are constants.
A system is said to be non-linear system if does not satisfies the above expression. Communication
channels and filters are examples of linear systems.
How to determine whether the given system is Linear or not?
To determine whether the given system is Linear or not, we have to follow the following steps:
Step 1: Apply zero input and check the output. If the output is zero then the system is linear. If this
step is satisfied then follow the remaining steps.
Step 2: Apply individual inputs to the system and determine corresponding outputs. Then add all
outputs. Denote this addition by y’(n). This is the R.H.S. of the 1st equation.
Step 3: Combine all inputs. Apply it to the system and find out y”(n). This is L.H.S. of equation (1).
Step 4: if y’(n) = y”(n) then the system is linear otherwise it is non-linear system.
BS LAB 66 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
BS LAB 67 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output:
enter samples of sequence x1[2 2 2]
length of output is
2 2 2
5 5 5
BS LAB 68 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
1 2 3
9 27 54 45 27
9 27 54 45 27
system is linear
2 2 2
5 5 5
1 2 3
9 9 9
33 33 33
Result:
Hence the Linearity of System is verified.
BS LAB 69 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:1
Aim:
To observe the output waveforms of AutoCorrelated signal and CrossCorrelated Signals
Software Required:
MATLAB.
Theory:
Autocorrelation:
Autocorrelation, also known as serial correlation, is the correlation of a signal with a delayed copy
of itself as a function of delay. Informally, it is the similarity between observations as a function of
the time lag between them. The analysis of autocorrelation is a mathematical tool for finding
repeating patterns, such as the presence of a periodic signal obscured by noise, or identifying the
missing fundamental frequency in a signal implied by its harmonic frequencies. It is often used in
signal processing for analyzing functions or series of values, such as time domain signals.
Different fields of study define autocorrelation differently, and not all of these definitions are
equivalent. In some fields, the term is used interchangeably with autocovariance.
The correlation of a signal with itself is itsautocorrelation:
w(t) =u(t)⊗u(t) =∫∞−∞u∗(τ−t)u(τ)dτ
Cross-correlation
In signal processing, cross-correlation is a measure of similarity of two series as a function of the
displacement of one relative to the other. This is also known as a sliding dot product or sliding
inner-product. It is commonly used for searching a long signal for a shorter, known feature. It has
applications in pattern recognition, single particle analysis, electron tomography, averaging,
cryptanalysis, and neurophysiology. The cross-correlation is similar in nature to the convolution of
two functions. In an autocorrelation, which is the cross-correlation of a signal with itself, there
will always be a peak at a lag of zero, and its size will be the signal energy.
w(t) =u(t)⊗v(t),∫∞−∞u∗(τ)v(τ+t)dτ=∫∞−∞u∗(τ−t)v(τ)dτ
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
BS LAB 61 ECE-CEH-JNTUH
0
2021-22 Std.Id:20011A0403
Output:
BS LAB 70 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the output waveforms of AutoCorrelated signal and CrossCorrelated Signals are
observed.
.
BS LAB 71 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:1
Aim:
To generate the gaussian noise and to study about its pdf,mean,variance,skewness,kurtosis
parameters and to observe the output signals.
Software Required:
MATLAB.
Theory:
Gaussian noise is statistical noise that has a probability density function (abbreviated
pdf) of the normal distribution (also known as Gaussian distribution). In other words, the
valuestha the noise can take on are Gaussian-distributed. It is most commonly used as
additive white noise to yield additive white Gaussian noise (AWGN).Gaussian noise is
properly defined as the noise with a Gaussian amplitude distribution. says nothing of the
correlation of the noise in time or of the spectral density of the noise. Labeling Gaussian
noise as 'white' describes the correlation of the noise. It is necessary to use the term "white
Gaussian noise" to be correct. Gaussian noise is sometimes misunderstood to be white
Gaussian noise, but this is not the case.
Formula:
Gaussian Noise,
—(x—μ)2
1
𝑓x(𝑥) = 2πσ
𝑒 2σ2
where 𝜇= mean
𝜎 = 𝑆𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝐷𝑒𝑣𝑖𝑎𝑡𝑖𝑜𝑛
𝜎2 = 𝑣𝑎𝑟𝑖𝑎𝑛𝑐𝑒
MATLAB command:
P = normpdf(x,yMu,ysigma)
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
BS LAB 72 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
Output:
BS LAB 73 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the the gaussian noise is generated and its pdf,mean,variance,skewness,kurtosis
parameters are studied and output signals are observed.
BS LAB 74 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:1
Aim:
To observe the Unit Impulse,Unit Step and Sine Wave response waveforms of a given LTI
system
Software Required:
MATLAB.
Theory:
A discrete time system performs an operation on an input signal based on predefined criteria
to produce a modified output signal. The input signal x(n) is the system excitation, and y(n) is
the system response. The transform operation is shown as,
If the input to the system is unit impulse i.e. x(n) = δ(n) then the output of the system is
known as impulse response denoted by h(n) where,
h(n) = T[δ(n)]
we know that any arbitrary sequence x(n) can be represented as a weighted sum of discrete
impulses. Now the system response is given by,
Y[n]=T[x(n)] - 𝑥 (𝑘 )𝛿 (𝑛 − 𝑘 )]
k=–∞
T[∑∞
b0+b1z—1+⋯bn1z(n—1)+bnz—n
H(z)=1+a1z—1+a1z—1+⋯an1z(n—1)+anz—n
Procedure:
⮚ Switch on the system with MATLAB tool.
BS LAB 75 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
BS LAB 76 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Program : Unit Impulse,Unit Step and Sine Wave response waveforms of a given LTI system
clc;
clear all;
close all;
b=[1];
a=[1,-1,.9];
zplane(b,a);
n=0:3:100;
t=0:0.1:2*pi;
x1=(n==0);
x2=(n>0);
x3=sin(t);
y1=filter(b,a,x1);
y2=filter(b,a,x2);
y3=filter(b,a,x3);
figure;
subplot(3,1,1);stem(n,y1);
xlabel('n');ylabel('y1');title('impulse response');
subplot(3,1,2);stem(n,y2);
xlabel('n');ylabel('y2');title('step response');
subplot(3,1,3);stem(t,y3);
xlabel('t');ylabel('y3');title('sin response');
Output :
BS LAB 77 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the Unit Impulse,Unit Step and Sine Wave response waveforms of a given LTI system
are observed.
BS LAB 78 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:3
Aim:
To find the energy and power of a signal and to classify the signal as power signal,energy
signal,neither energy nor power signal.
Software Required:
MATLAB.
Theory:
Consider a resistor of R ohms with the current passing through it is i (t), then the voltage across the
resistor is V (t) = i (t)*R. The instantaneous power dissipated in the resistor is
P = V2(t)/R in terms of voltage signal,
P = i2(t)*R in terms of current signal.
To remove the dependence of resistance and ease the analysis it is customary in signal analysis to
work with one ohm resistor for which both reduce to same form P = V 2(t) = i2(t). Hence the
instantaneous power associated with signal f(t) is defined as P = |f(t)|2.
T
Total energy of a signal f(t) is defined as E = ƒ 𝑥(𝑡)2 𝑑𝑡 as T tends to infinity.
–T
1
Average power is defined as P == T
2T ƒ– 𝑥(𝑡)2𝑑𝑡 as T tends to infinity.
T
Energy Signal:
A signal f(t) is an energy signal if its total energy if finite and non zero. The average power
associated with a energy signal is zero.
Power Signal:
A signal f (t) is a power signal if its average power if finite and non zero. The energy associated
with a power signal is infinite.
Signals which have infinite power and infinite energy are classified neither as energy signals or
power signals
BS LAB 79 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Formulae:
T
Energy=ƒ
–T 𝑥(𝑡)2 𝑑𝑡
Power= 1 T
2T ƒ– 𝑥(𝑡)2𝑑𝑡
T
Calculations:
T 1–cos (t)
= –T 2 𝑑𝑡
ƒ
1 sin2(t) T
= 2 [𝑡 − 2 ] –T
1 sin2(T) sin2(T)
= 2 [𝑇 − 2 + 𝑇− 2 ]
= 1 [2𝑇 − 𝑠𝑖𝑛2(𝑇)]
2
= 1 [∞ − ∞]
2
=∞
2
Power=A
2 for sinusoidal signals
1
=2
∞
= –∞ 𝑒–2tdt
ƒ
∞
=ƒ0 𝑒–2tdt
∞
e—2t
= –2 0
1
=2
Power= 1 T
2T ƒ– 𝑥(𝑡)2𝑑𝑡
T
BS LAB 71 ECE-CEH-JNTUH
0
2021-22 Std.Id:20011A0403
T 1
=
ƒ 𝑒–2t𝑑𝑡
2T 0
BS LAB 71 ECE-CEH-JNTUH
1
2021-22 Std.Id:20011A0403
∞
1 e—2t
=2T –2 0
=0
T
Energy=ƒ 𝑥(𝑡)2 𝑑𝑡
–T
=∞
𝑒–2tdt
ƒ
–∞
–2t ∞
=[𝑒 ]–∞
=–1
2
[𝑒–∞ − 𝑒∞]
=∞
Power= 1 ƒT
2T –T 𝑥(𝑡)2𝑑𝑡
1 T
= ƒ–T –2t
2T
𝑒 dt
1 —2t
= [e ]T
2T –2 –T
1
=4T [𝑒–2t − 𝑒2t]
=∞
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
BS LAB 80 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
ezplot(t,f,[-pi,pi]);grid on;
e=limit(int(f.^2,-t,t),t,inf);
p=limit(int(f.^2,-t,t)./(t*2),t,inf);
disp('energy of signal=');
disp(e);
disp('power of signal=');
disp(p);
if(p==0)
disp('given signal is energy signal');
title([char(f) ,'is energy signal']);
elseif(e==inf&p~=inf)
disp('given signal is power signal');
title([char(f) ,'is power signal']);
elseif(p==inf&e==inf)
disp('given signal is neither energy nor power signal');
title([char(f) ,'is neither energy nor power signal']);
end
power of signal=
1/2
Output-1(ii):
BS LAB 81 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
clc;
clear all;
close all;
syms t;
f=exp(-t)*heaviside(t);
ezplot(t,f,[-1,1])
e=limit(int(f.^2,-t,t),t,inf);
p=limit(int(f.^2,-t,t)/(2*t),t,inf);
disp('energy of signal=');
disp(e);
disp('power of signal=');
disp(p);
if(p==0)
disp('given signal is energy signal');
title([char(f),'is energy signal']);
elseif(e==inf&p~=inf)
disp('given signal is power signal');
title([char(f),'is power signal']);
elseif(p==0)
disp('given signal is neither energy nor power signal');
title([char(f),'is neither energy nor power signal']);
end
power of signal=
0
given signal is energy signal
Output-2(ii):
BS LAB 82 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
clc;
clear all;
close all;
syms t;
f=exp(t);
ezplot(t,f,[-1,1])
e=limit(int(f.^2,-t,t),t,inf);
p=limit(int(f.^2,-t,t)./(2*t),t,inf);
disp('energy of signal=');
disp(e);
disp('power of signal=');
disp(p);
if(p==0)
disp('given signal is energy signal');
title([char(f),'is energy signal']);grid on;
elseif(e==inf&p~=inf)
disp('given signal is power signal');
title([char(f),'is power signal']);grid on;
elseif(p==inf&e==inf)
disp('given signal is neither energy nor power signal');
title([char(f),'is neither energy nor power signal']);grid on;
end
power of signal=
Inf
Output-3(ii):
BS LAB 83 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the the energy and power of a signal are found and signal is classified as power
signal,energy signal,neither energy nor power signal.
BS LAB 84 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:3
Aim:
To find the Fourier Transform of a Signal and to Observe the Waveforms of its Magnitude and
Phase Responses.
Software Required:
MATLAB.
Theory:
The Fourier transform (FT) decomposes a function of time (a signal) into its
constituent frequencies. This is similar to the way a musical chord can be expressed in terms of the
volumes and frequencies of its constituent notes. The term Fourier transform refers to both the
frequency domain representation and the mathematical operation that associates the frequency
domain representation to a function of time.The Fourier transform of a function of time is itself a
complex-valued function of frequency, whose magnitude (modulus) represents the amount of that
frequency present in the original function, and whose argument is the phase offset of the basic
sinusoid in that frequency. The Fourier transform is not limited to functions of time, but the domain
of the original function is commonly referred to as the time domain.There is also an inverse Fourier
transform that mathematically synthesizes the original function from its frequency domain
representation. Linear operations performed in one domain (time or frequency) hae corresponding
operations in the other domain, which are sometimes easier to perform. The operation of
differentiation in the time domain corresponds to multiplication by the frequency, [remark 1] so
some differential equations are easier to analyze in the frequency domain. Also, convolution in the
time domain corresponds to ordinary multiplication in the frequency domain (see Convolution
theorem). After performing the desired operations, transformation of the result can be made back to
the time domain. Harmonic analysis is the systematic study of the relationship between the
frequency and time domains,including the kinds of functions or operations that are
"simpler" in one or the other, and has deep connections to many areas of modern
mathematics.
Derivation:
Let x(t) be a non periodic signal
𝑥T(𝑡) be periodic with period T
Let their relation is given by x(t)=𝑥T(𝑡)
The fourier series of periodic signal 𝑥T(𝑡) is :
∞
𝑥T(𝑡) = Σ 𝐶n𝑒jnw0t
n=–∞
Where
BS LAB 85 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
T
𝐶 = 1 f2 𝑥 (𝑡)𝑒–jnw0t𝑑𝑡
n
𝑇 –T
And
2π T2
𝑤0 = T
∴ 𝑇𝐶 = 1 f2
T
𝑥 (𝑡)𝑒–jnw0t𝑑𝑡
n
𝑇 –T
Let 𝑛𝑤0=w at T→ ∞
T2
2π
As T→ ∞ We have 𝑤0 = ( ) → and the discrete fourier spectrum becomes
0 T
continous.
Further ,the summation becomes integral and 𝑥T(𝑡) → 𝑥(𝑡)
Thus ,as T→ ∞
𝑇𝐶 1 T
=2 𝑥 (𝑡)𝑒–jnw0t𝑑𝑡
ƒ
n —T T
T 2
∞
=ƒ –∞ [𝑥T (𝑡) ])𝑒–jwt𝑑𝑡
∞ 𝑥(𝑡)𝑒–jwt𝑑𝑡
=ƒ –∞
∴ X(w)= –∞ 𝑥(𝑡)𝑒–jwt𝑑𝑡
=X(w)
∞
Formulae:
X(w)=İ
–∞ 𝑥(𝑡)𝑒–jwt𝑑𝑡
Calculations:
1.sin 𝑤0𝑡:
Given x(t)= sin 𝑤0𝑡
X(w)=F[sin 𝑤0𝑡]
ejw0t–e—jw0t
=F[ 2J ]
=2j [F[𝑒 ]- F[𝑒–jw0t]
1 jw0t
= 1 [2𝜋𝛿(𝜔 − 𝜔 )
2j 0 − 2𝜋𝛿(𝜔 + 𝜔0)]
BS LAB 86 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
BS LAB 87 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-1(i):(Command Window):
x=
2*heaviside(t + 1) - 2*heaviside(t - 1)
x1 =
2*heaviside(t + 1) - 2*heaviside(t - 1)
y=
y1 =
(4*sin(w))/w
BS LAB 88 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
m=
4*(imag(sin(w)/w)^2 + real(sin(w)/w)^2)^(1/2)
p=
angle(sin(w)/w)
Output-1(ii):
Output-2(i):(Command Window):
x=
2*heaviside(t + 2) - 2*heaviside(t - 2)
x1 =
2*heaviside(t + 2) - 2*heaviside(t - 2)
BS LAB 89 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
y=
y1 =
(4*sin(2*w))/w
m=
4*(imag(sin(2*w)/w)^2 + real(sin(2*w)/w)^2)^(1/2)
p=
angle(sin(2*w)/w)
Output-2(ii):
Output-3(i):(Command Window):
x=
2*heaviside(t + 4) - 2*heaviside(t - 4)
BS LAB 81 ECE-CEH-JNTUH
0
2021-22 Std.Id:20011A0403
y=
y1 =
(4*sin(4*w))/w
m=
4*(imag(sin(4*w)/w)^2 + real(sin(4*w)/w)^2)^(1/2)
p=
angle(sin(4*w)/w)
Output-3(ii):
BS LAB 90 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
subplot(2,3,3)
ezplot(m,[-6,6,-5,10])
subplot(2,3,6)
ezplot(p)
Output-4(i):(Command Window):
x=
x1 =
y=
y1 =
-(2*exp(-w*2i)*(exp(w*2i) - 1)^2)/w^2
m=
p=
angle(-(exp(-w*2i)*(exp(w*2i) - 1)^2)/w^2)
Output-4(i):
BS LAB 91 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
clear all
close all
syms t
x=(t+4).*(heaviside(t+4)-heaviside(t))+((-1)*(t-4)).*(heaviside(t)-heaviside(t-4))
x1=simplify(x)
y=fourier(x1)
y1=simplify(y)
m=sqrt(real(y1)^2+imag(y1)^2)
p=angle(y1)
subplot(2,3,1);ezplot(x,[-6,6,-1,5])
subplot(2,3,4);ezplot(y,[-6,6,-5,20])
subplot(2,3,5);ezplot(y1,[-6,6,-5,20])
subplot(2,3,3);ezplot(m,[-6,6,-5,20])
subplot(2,3,6);ezplot(p)
Output-5(i):(Command Window):
x=
x1 =
y=
y1 =
-(exp(-w*4i)*(exp(w*4i) - 1)^2)/w^2
m=
p=
angle(-(exp(-w*4i)*(exp(w*4i) - 1)^2)/w^2)
Output-5(i):
BS LAB 92 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Result:
Hence the Fourier Transform of a Signal is found and Waveforms of its Magnitude and Phase
Responses are observed.
BS LAB 93 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:3
Aim:
To find the Laplace Transform of a Signal and to plot and determine the Location of Poles ans
Zeros
Software Required:
MATLAB.
Theory:
The Laplace transform can be used to solve differential equations.
Besides being a different and efficient alternative to variation of
parameters and undetermined coefficients, the Laplace method is
particularly advantageous for input terms that are piecewise-
defined, periodic or impulsive. The direct Laplace transform or the
Laplace integral of a function f(t) defined for 0 ≤ t < ∞ is the
ordinary calculus integration L–notation recognizes that
integration always proceeds over t = 0 to t = ∞ and that the
integral involves an integrator instead of the usual dt. These
minor differences
distinguish Laplace integrals from the ordinary integrals found on the inside covers of calculus
texts. Lerch’s law, the formal rule of erasing the integral signs is valid provided the integrals
are equal for large s and certain conditions hold on y and
Derivation:
The fourier transform of a continous time signal signal x(t) can be represented as
∞
X(w)=ƒ– 𝑥(𝑡)𝑒–jwt𝑑𝑡
∞
Where
1 ∞
X(t)= ƒ 𝑥(𝑤)𝑒–jwt𝑑𝑤
2π –∞
Formulae:
∞
X(s)=ƒ– 𝑥(𝑡)𝑒–st𝑑𝑡
∞
Calculation:
W
Sin wt u(t) 𝐿𝑇 ¯
S 2 +W 2
Procedure:
⮚ Switch on the system with MATLAB tool.
⮚ Launch MATLAB software by clicking on MATLAB icon on the desktop.
⮚ Create new program from NEW option in FILE menu.
⮚ Write the program in TEXT EDITOR window.
⮚ Save the program with .m extension.
⮚ Run the program from the EDITOR menu or by pressing F5.
⮚ Check the COMMAND window for output values/errors.If any errors are there,debug the
errors,modify the program,and go to step 6.
⮚ Observe the text outputs in command window and graphical outputs in FIGURES.
⮚ Close the MATLAB tool properly.
⮚ Switch off the system.
syms t
f=sin(t)
L=laplace(f)
L1=collect(L)
[num,den]=numden(L1)
transform=tf(sym2poly(num),sym2poly(den),0.001)
subplot(2,2,1)
ezplot(t,f)
subplot(2,2,2)
ezplot(L)
subplot(2,2,3)
ezplot(L1)
subplot(2,2,4)
pzmap(transform)
Output-1(i):(Command Window):
f=
sin(t)
L=
1/(s^2 + 1)
L1 =
1/(s^2 + 1)
num =
den =
s^2 + 1
transform =
z^2 + 1
Output-1(i):
BS LAB 96 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Output-2(i):(Command Window):
f=
cos(t)
L=
s/(s^2 + 1)
L1 =
s/(s^2 + 1)
num =
den =
BS LAB 97 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
s^2 + 1
transform =
z^2 + 1
Output-2(ii):
Output-3(i):(Command Window):
f=
BS LAB 98 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
heaviside(t)
l=
1/s
l1 =
1/s
num =
den =
transform =
Output-3(ii):
Result:
Hence the Laplace Transform of a Signal is found and the Location of Poles ans Zeros are
plotted and determined
BS LAB 99 ECE-CEH-JNTUH
2021-22 Std.Id:20011A0403
Number of Programs:3
Aim:
To find the Z-Transform of a Signal and to plot and determine the Location of Poles ans Zeros
Software Required:
MATLAB.
Theory:
In the study of discrete-time signal and systems, we have thus far considered the time-domain
and the frequency domain. The z domain gives us a third representation. All three domains are
related to each other. A special feature of the z-transform is that for the signals and system of
interest to us, all of the analysis will be in terms of ratios of polynomials. Working with these
polynomials is relatively straight forward.
Definition of the z-Transform
• This transformation produces a new representation of denoted
• Returning to the original sequence (inverse z-transform) requires finding the
coefficient associated with the nth power.
– In the sequence or n-domain the independent variable is n
– In the z-domain the independent variable is z
Derivation:
The discrete time fouriertransform of a sequence x(n) is given by
X(w)=∑∞
n=–∞ 𝑥(𝑛)𝑒–jwn
For the existence of DTFT ,the above summation should converge ,i.e x(n) must be
absolutely summable.
The z transform of the sequence x(n) is given by
Z[x(n)]=X(z)
= ∑∞n=–∞ 𝑥(𝑛)𝑧–n
Formulae:
Z[x(n)]= ∑∞
n=–∞ 𝑥(𝑛)𝑧–n
Calculations:
X(n)=sin wn u(n)
=sin wn for n≥ 0
∞
=1∑n=0 𝑠𝑖𝑛 𝑠𝑖𝑛 𝑤𝑛 𝑧–n
= ∑∞
n=0 1(𝑒jwn𝑧–n − 𝑒–jwn𝑧–n)
2j
=∑ (z—1ejw)n–(z—1e—jw)n
∞ 1
n=0 2j
=∑∞ (z—1ejw)n ∞ (z—1e—jw)n
n=0 1 2j − ∑n=0 1 2j
zsin zsin w
Sin wnu(n) 𝑍𝑇¯ =z2–2zco w+1
w
subplot(2,2,2);ezplot(F);
subplot(2,2,3);ezplot(f1);
subplot(2,2,4);pzmap(h);
Output-1(i):(Command Window):
f=
sin(n)
F=
(z*sin(1))/(z^2 - 2*cos(1)*z + 1)
f1 =
(sin(1)*z)/(z^2 - 2*cos(1)*z + 1)
num =
z*sin(1)
den =
z^2 - 2*cos(1)*z + 1
h=
0.8415 s
s^2 - 1.081 s + 1
Output-1(ii):
Output-2(i):(Command Window):
f=
cos(n)
F=
f1 =
num =
z^2 - cos(1)*z
den =
z^2 - 2*cos(1)*z + 1
h=
s^2 - 0.5403 s
s^2 - 1.081 s + 1
Output-2(ii):
Output-3(i):(Command Window):
f=
heaviside(n)
F=
1/(z - 1) + 1/2
f1 =
(z + 1)/(2*z - 2)
num =
den =
2*z - 2
h=
s+1
2s-2
Output-3(ii):
Result:
Hence the Z-Transform of a Signal is found and the Location of Poles ans Zeros are plotted
and determined