LAB 3 MATLAB SNS lab, Assignments of Signals and Systems

MATLAB LAB NO # 3 ABOUT Signal and system processing

Typology: Assignments

2020/2021

Uploaded on 03/28/2021

arsalan-latif
arsalan-latif ๐Ÿ‡ต๐Ÿ‡ฐ

3 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
EXPERIMENT 03
BASIC SIGNAL OPERATIONS AND LINEAR TIME INVARIANT SYSTEMS
OBJECTIVE:
The objective of this lab is to familiarize students with basic signal operations like time
inversion, time compression, time expansion, decomposition of a signal into its even and odd
parts and to understand linear time/ shift invariant systems.
EQUIPMENT/ TOOL:
MATLAB 2016a
BACKGROUND:
Basic Mathematical Operations:
Time inversion:
Time inversion of signal can be considered as inversion of time axis as shown in fig.6.1.
Fig. 6.1: Time Inversion
Following MATLAB code is an implementation of time reversal/flipping.
Example of time reversal/flipping:
x1=[10 1 10 20 2 20 30 3
30]; t=-4:4
for i=1:length(x1)
x3(i)=x1(length(x1)+1-
i)
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download LAB 3 MATLAB SNS lab and more Assignments Signals and Systems in PDF only on Docsity!

EXPERIMENT 03

BASIC SIGNAL OPERATIONS AND LINEAR TIME INVARIANT SYSTEMS

OBJECTIVE:

The objective of this lab is to familiarize students with basic signal operations like time inversion, time compression, time expansion, decomposition of a signal into its even and odd parts and to understand linear time/ shift invariant systems. EQUIPMENT/ TOOL: MATLAB 2016a BACKGROUND: Basic Mathematical Operations: Time inversion: Time inversion of signal can be considered as inversion of time axis as shown in fig.6.1. Fig. 6.1: Time Inversion Following MATLAB code is an implementation of time reversal/flipping. Example of time reversal/flipping: x1=[10 1 10 20 2 20 30 3 30]; t=-4: for i=1:length(x1) x3(i)=x1(length(x1)+1- i)

end figure ; subplot 211 stem(t,x1) axis([-5 5 0 50]) title('Original Signal') subplot 212 stem(t,x3) axis([-5 5 0 50]) title('Flipped Signal') Fig. 6.2: Time Reversal Above operation can be easily done using vectorization by the following command xN = xn(length(xn):-1:1) or fliplr (xn).

title('zero insertion') n=3:2:2*length(x)- 1

t=x1(n-1) t1=x1(n+1) x1(n)=(t+t1)/2; subplot 313 stem(x1) Fig. 6.3: Time Compression & Expansion Even/ Odd Decomposition of a Signal: Even and odd signals bear some important symmetry properties. Under reversal of independent variable, these signals either remain the same (even signal) or get reflected or flipped (odd signal) about the horizontal axis. Even Signals : x(t) = x(โ€“t), x[n] = x[โ€“n] Odd Signals: x(t) = โ€“x(โ€“t), x[n] = โ€“x[โ€“n] Following is an example execution of an even-odd decomposition of signal.

namely

L[a1x1(n) + a2 x2 (n)] = a1 L[x1 (n)] + a2 Lx2(n)] A discrete system is time-invariant if shifting the input only causes the same shift in the output .A system is said to be bounded-input bounded-output (BIBO) stable if every bounded input produces a bounded output. A system is said to be causal if the output at index n0 depends only on the input up to and including the index no; that is output does not depend on the future values of the input. Properties of LTI systems: The defining properties of any LTI system are linearity and time invariance. Linearity: Linearity means that the relationship between the input and the output of the system is a linear map: If input ๐‘ฅ 1 (๐‘ก) produces response ๐‘ฆ 1 (๐‘ก) and input ๐‘ฅ 2 (๐‘ก) produces ๐‘ฆ 2 (๐‘ก), then the scaled and summed input , then the scaled and summed input ๐‘Ž 1 ๐‘ฅ 1 (๐‘ก)+ ๐‘Ž 2 ๐‘ฅ 2 (๐‘ก) produces the scaled and summed response ๐‘Ž 1 ๐‘ฆ 1 (๐‘ก)+ ๐‘Ž 2 ๐‘ฆ 2 (๐‘ก) where ๐‘Ž 1 and ๐‘Ž 2 are real scalers. Time Invariance: Time invariance means that whether we apply an input to the system now or t seconds from now, the output will be identical except for a time delay of the t seconds. That is, if the output due to input (๐‘ก) is (๐‘ก) , then the output due to input ๐‘ฅ(๐‘ก โˆ’ ๐‘‡) ) is ๐‘ฆ(๐‘ก โˆ’ ๐‘‡) ). Hence, the system is time invariant because the output does not depend on the particular time the input is applied. Any LTI system can be characterized entirely by a single function called the system's impulse response. The output of the system is simply the convolution of the input to the system with the system's impulse response. Proof of LTI system properties on MATLAB: % Proof of LTI system properties % Linerity

x1(t>=-0.8 & t<=1.2)=1; y1 = conv(x1,h); tt = t(1)+t(1):0.1:t(end) +t(end); subplot(6,1,6);

plot((1:length(y1))0.1,y10.1) ; hold on; pad = zeros(1,0.2/0.1); y2 = [pad y]; plot ((1:length(y2))0.1,y20.1,'r+'); ylabel('Time-invariance property')

T II. (a) For the above designed signal expand the signal by 2.Demonstrate all the steps and enter screenshots. (b) Now compress the signal as a result of part (a) by a factor of 3. (c) Time Expand the signal by a factor of 2.

T III. Explore the following commands. ๏‚ท real ๏‚ท imag ๏‚ท angle ๏‚ท abs, ๏‚ท complex, ๏‚ท conj Take a vector of any five complex numbers and implement above mentioned commands on it.

T IV. Which of the following signals are even and which of the following signal are odd? (a) [2 2 2 5 2 2 2] (b) [2 2 2 5 -2 -2 -2] (c) [2 1 2 3 3 2 4 5] (d) [1 1 1 1 1 1 1] Prove your answer by decomposing your signals into even and odd parts. Using even and odd part of signal reconstruct your original signal back using x(t) = xe(t) + xo(t)