










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
MATLAB LAB NO # 3 ABOUT Signal and system processing
Typology: Assignments
1 / 18
This page cannot be seen from the preview
Don't miss anything!











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)