Sample Viva Questions
Sample Viva Questions
Sample Viva Questions
1.
2.
3.
4.
( )=
Plot ( ) for x from
=
=
3. Define and plot the real and the imaginary part of the signal
( )=
,
( )=
)/
( ) through your
Performance
Viva
(10 Marks)
(5 Marks )
Total/15
Performance
/4
Results
/3
Critical Analysis
/1
/2
Comments
27
Equipment Required
Software: MATLAB
Hardware: Computer
Lab Instructions
This lab activity comprises of three parts: Pre-lab, Lab Exercises, and Post-Lab Viva session.
The students should perform and demonstrate each lab task separately for step-wise evaluation.
Only those tasks that are completed during the allocated lab time will be credited to the students.
Students are however encouraged to practice on their own in spare time for enhancing their skills.
Lab objectives
MATLAB codes
Results (graphs/tables) duly commented and discussed
Conclusion
Lab Task
Plot the continuous time signal
( ) = cos( )
Solution
% Program to understand the CT signal
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
clear all
close all
t= -10:0.1:10
x= cos(t)
plot (t,x)
xlabel('Time Axis')
ylabel('Amplitude')
title('Graph of x(n)=cos(t)')
29
Lab Task
Plot the discrete time signal
[ ] = cos[ ]
Solution
% Program to understand the CT signal
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
clear all
close all
n= -10:.1:10;
x= cos(n);
stem (n,x)
xlabel('Time Axis')
ylabel('Amplitude')
title('Graph of x(n)=cos(n)')
ROll Number:_________________________
Modify the code to plot using your roll number.
A discrete time signal x[n] is usually obtained by sampling a continuous-time signal ( ) at a constant rate.
Suppose Ts is the sampling period, that is every we sample the value of ( ). Suppose also that n , i.e.
= 0, 1, 2, 3, ..The sequence of the sample is derived from the continuous time signal ( ).
Lab Task
Modify the above lab tasks to plot the CT and DT signals together.
Solution
Digital Signals
Digital signals are the signals that both independent and dependent variables take values from a discrete set.
In the following example, the signal [ ] =
[ ] is again plotted, but we use the command round to limit
the set of values that [ ] can take, That is, [ ] can be 1,0 1.
Lab Task
Plot the digital signal [ ] = cos( ),
Solution
% Program to
31
xlabel('Time Axis')
ylabel('Amplitude')
title('Graph of x(n)=cos(n)- Digital Signal')
( + )
Where
=
/ ,
=
=
,
).
given by
is defined by
/2 .
Solution
First, the period is calculated as T=2 /=2 /3 =2/3. Hence, the MATLAB implementation is as
follows.
% Program to understand the plotting of sinusoidal signal
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
close all
clear all
A=3;
omega=3*pi;
thita=pi/3;
T= 2*pi/omega;
t=0:0.01:4*T;
x=A*cos(omega*t+thita);
plot(t,x)
title ('sinusoidal signal')
xlablel('time')
ylabel('Amplitude')
33
When referring to the sinusoidal signals we refer both to cosines and sine, as a cosine and sine are infact the
same signal with a
phase difference.
Lab Task
Plot the following two signals together in the same plot.
( ) = cos( )
( ) = sin( + )
2
Solution
Exponential Signals
Exponential signals are signals of the form
( )=
If
if
(0) =
Lab Task
Plot the Signal ( ) =
Where
=
And
( )=
= 1.
= /2
Solution
% Program to understand the plotting of exponential signal.
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
close all
clear all
A= input ('Enter the Roll Number')
beta1= A/100
beta2= -A/100
T= A/2;
t=-T:.1:T;
x=A*exp(beta1*t);
y=A*exp(beta2*t);
plot(t,x,'or',t,y,'.b')
xlabel('time')
ylabel('Amlitude')
title ('Exponential Signal')
legend('Growing Exponentiaa','Decaying Exponential')
35
When referring to the sinusoidal signals we refer to the both sines and cosines, as cosine and a sine are in
fact the same signal with a
= , phase difference.
is also
(cos( + ) + sin( + ))
Lab Task
Plot the real and imaginary parts of signal ( ) = 2
Solution
First of all find the period of the signal.
=
2
2
=
=2
t=0:.1:2;
y_re=real(2*exp(1i*pi*t+pi/3));
y_im=imag(2*exp(1i*pi*t+pi/3));
plot(t,y_re,t,y_im,'-.')
title('Complex Exponential')
xlabel('TIme')
ylabel('Apmmlitude')
legend ('Real Part','Imaginary Part')
Lab Task
Solution
1,
0,
>0
<0
The MATLAB command that generates the unit step function is the command heaviside(t).
According to MATLAB programmers, unit step function is given by
u(t)=
1,
0,
>0
<0
i.e. it is not defined at t=0, In the following example three different methods of defining and plotting the unit
step function are presented.
Lab Task
Implement the unit step function.
Solution
Method 1
% Program to understand the Unit Step Signal
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
37
clc
close all
clear all
)=
1,
0,
0
<0 <
Suppose that we want to define and plot the unit step function for
plot the function.
Lab Task
Plot the unit step function for
Solution
39
( ) ( ) = (0),
( ) = 1.
For special reasons, ( ) can be losely defined as a function that is infinite at t=0 and zero elsewhere.
This is the way that ( ) is implemented from the MATLAB programmers. The mathematical
expression is
( )=
,
0,
=0
0
An alternative definition for the Dirac function that is usually applicable when dealing with discretetime signal is given now. In this case, we refer to ( ) as the
or the
function. The
mathematical definition of delta function is
( )=
1,
0,
=0
0
Lab Task
Plot the unit impulse function.
Solution
% Program to understand the UnitImpulse
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
close all
third way
41
figure
t=-5:.1:10
d=[zeros(1,50) inf zeros(1,100) ];
plot(t,d)
title ('Unit Impulse Using zeros and inf(t)')
xlabel('TIme')
ylabel('Amplitude')
)=
,
0,
Lab Task
Define and plot the Dirac function for
Solution
43
1,
0,
=0
0
]=
1,
0,
Lab Task
Plot the unit impulse sequence.
Solution
% Program to understand the Unit Impulse
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
close all
clear all
%delta(t)
n=-3:3
d=gauspuls(n)
stem(n,d)
title('Unit Impulse Using gauspuls(n)')
xlabel('n')
ylabel('Amplitude')
ylim([-0.5 1.5])
% second way
figure
n1=-3:-1;
n2=0;
n3=1:3;
n=[n1 n2 n3]
d1=zeros(size(n1));
d2=1;
d3=zeros(size(n3));
d=[d1 d2 d3]
stem(n,d)
title('Unit Impulse-Second Method')
xlabel('n')
ylabel('Amplitude')
ylim([-0.5 1.5])
% third way
figure
n1=-3;
n2=3;
n=n1:n2
d=(n==0)
stem(n,d)
title('Unit Impulse - Third Method')
xlabel('n')
ylabel('Amplitude')
ylim([-0.5 1.5])
45
1,
0,
0
<0
1,
0,
<
The command of the Heaviside is not applicable to the unit step sequence.
Lab Task
i.
Plot the unit step sequence.
ii.
Plot the unit step sequence for
=2
Solution
% Program to understand the UnitImpulse
% Muhammmad Usman Iqbal
% EEE223 Signals and Systems
clc
close all
clear all
%
u[n]
n1=-3:-1;
n2=0:5;
n=[n1 n2];
u1=zeros(size(n1));
u2=ones(size(n2));
u=[u1 u2];
stem(n,u)
title ('Unit Step-first method ')
xlabel ('n')
ylabel ('Apmlitude')
ylim ([-0.5 1.5])
second way
figure
n=-3:5
n0=0;
u=(n>=n0)
stem(n,u)
title ('Unit Step-second method ')
xlabel ('n')
ylabel ('Apmlitude')
ylim ([-0.5 1.5])
%u[n-n0]
figure
n1=-3:1;
n2=2:5;
n=[n1 n2];
u1=zeros(size(n1));
u2=ones(size(n2));
u2=ones(size(n2));
u=[u1 u2];
stem(n,u)
title ('Unit Step-u[n-n0]-first method')
xlabel ('n')
ylabel ('Apmlitude')
ylim ([-0.5 1.5])
second way
figure
n=-3:5
47
n0=2;
u=((n-n0)>=0)
stem(n,u)
title ('Unit Step-u[n-n0]-second method')
xlabel ('n')
ylabel ('Apmlitude')
ylim ([-0.5 1.5])
Lab Task
Plot the ascending and descending real exponential sequence for the value of
range of
.
Solution
, the sequence [ ]
in the
49
Sinusoidal Sequence
The sinusoidal sequence is defined by the expression of the form
[ ]=
cos(
+ )
[ ]=
Where
=
=
=
Lab Task
Plot the sinusoidal sequence
[ ]=
Solution
cos 2
=
0
+ )
51
= 1,
0,
Performance
Viva
(10 Marks)
(5 Marks )
Total/15
Performance
/4
Results
/3
Critical Analysis
/1
/2
Comments
53
Equipment Required
Software: MATLAB
Hardware: Computer
Lab Instructions
This lab activity comprises of three parts: Pre-lab, Lab Exercises, and Post-Lab Viva session.
The students should perform and demonstrate each lab task separately for step-wise evaluation.
Only those tasks that are completed during the allocated lab time will be credited to the students.
Students are however encouraged to practice on their own in spare time for enhancing their skills.
Lab objectives
MATLAB codes
Results (graphs/tables) duly commented and discussed
Conclusion
=6 / ,
),
Lab Task
Verify that the signal ( ) =
( ) is periodic.
, but
Solution
=2
A sinusoidal sequence [ ] =
satisfied.
),
( +
( )=
),
( )+
( )=
and
( )=
( +
)+
( +
( +
),
),
Suppose that x(t) is indeed periodic with period T. Then, the following relationship holds:
( )= ( + )=
( + )+
( + ).
( + )=
( +
)+
( +
.)
Equation is valid if
=
if
are prime numbers, then the period of the signal ( ) =
according to relation defined in above equation.
Lab Task
Plot the signal ( ) =
( )+
( )+
( ) is computed directly
Solution
The period 1 of
( ) is computed as 1 =
(3 ) is computed as 2 =
55