Lab Report 7: Convolution of LTI systems in MATLAB PDF

Title Lab Report 7: Convolution of LTI systems in MATLAB
Author Areej Gul Nawab Khan
Course Signal and System
Institution Air University
Pages 14
File Size 1.1 MB
File Type PDF
Total Downloads 36
Total Views 124

Summary

Tasks of topic Convolution of LTI systems implemented on MATLAB...


Description

SIGNALS AND SYSTEMS

EXPERIMENT 07 Convolution of LTI systems in MATLAB Objectives: 

Familiarizing students with implementation of LTI systems in MATLAB

Background Knowledge: Convolution of Continuous-Time Signals: Convolution is a mathematical operation that describes the action of a linear system on a signal. The impulse response of a linear time-invariant system completely specifies the system. More specifically, if the impulse response of a system is known one can compute the system output for any input signal. The output of a system to any input signal is computed by the convolution of the input signal with the impulse response of the system. Suppose 𝑦(𝑡) denotes the output of the system, 𝑥(𝑡) is the input signal and ℎ(𝑡) is the impulse response of the system. The mathematical expression of the convolution relationship is: 𝒚(𝒕) = 𝒙(𝒕) ∗ 𝒉(𝒕) where, * is the symbol for convolution. The convolution between two continuous-time signals involves the computation of an integral. The convolution integral is written as: +∞

𝒚(𝒕) = 𝒙(𝒕) ∗ 𝒉(𝒕) = ∫

−∞

𝒙(𝝉) ∗ 𝒉(𝒕 − 𝝉)𝒅𝝉

Convolution in MATLAB: ‘conv’ is the built- in function in MATLAB that convolves LTI systems and returns the result of this convolution. y = conv(x,h) returns the convolution of vectors x and h. The resulting vector is of length: 𝑳𝒆𝒏𝒈𝒕𝒉(𝒚) = 𝑳𝒆𝒏𝒈𝒕𝒉(𝒙) + 𝑳𝒆𝒏𝒈𝒕𝒉(𝒉) − 𝟏 Since convolution is commutative, convolving ‘x’ with ‘h’ or convolving ‘h’ with ‘x’ will evaluate similar results. Deconvolution of Continuous-Time Signals: If ℎ(𝑡) (impulse response of a system) and 𝑦(𝑡) (output of a system) are available, then the input signal 𝑥(𝑡) that was applied to the system can be retrieved. This process is called deconvolution and is implemented in MATLAB using the command ‘deconv’. Deconvolution is useful in determining the impulse response of a system if the input and output signals are known. The command to find the response of system is h = deconv(y,x).

SIGNALS AND SYSTEMS The ‘deconv’ command does not follow commutative property; hence, the output signal must be the first input argument of the command ‘deconv’.

Convolution of Discrete-Time Signals: Convolution of discrete-time signals essentially follows the same steps as the continuous-time convolution. Suppose 𝑦[𝑛] denotes the output of the system, 𝑥[𝑛] is the input signal and ℎ[𝑛] is the impulse response of the system. The mathematical expression of the convolution relationship is: 𝒚[𝒏] = 𝒙[𝒏] ∗ 𝒉[𝒏] The convolution between two discrete-time signals involves a summation. The convolution summation is written as: +∞

𝒚[𝒏] = 𝒙[𝒏] ∗ 𝒉[𝒏] = ∑ 𝒙[𝒌] 𝒉[𝒏 − 𝒌] 𝒌= −∞

The discrete-time convolution sum is analytically calculated by following the steps given below: Step 1

List the index ‘k’ for the convolution sum

Step 2

List the input x in terms of k as ‘x[k]’

Step 3

Obtain the reversed sequence h[-k], and align the rightmost element of h[n-k] to the leftmost element of x[k]

Step 4

Multiply and sum the overlapping non-zero terms to get y[n]

Step 5

Slide h[n-k] to the right by one position

Step 6

Repeat step 4; stop if all the output values are zero or when you get the result

SIGNALS AND SYSTEMS The ‘conv’ command in MATLAB is used to convolve two discrete-time signals, much as we convolve two continuous-time signals. The deconvolution is also performed in the same way using ‘deconv’ command.

Properties of Convolution: Mathematical properties of convolution are given below: 

Commutative



Associative



Distributive

𝑥(𝑡) ∗ ℎ(𝑡) = ℎ(𝑡) ∗ 𝑥(𝑡) 𝑥(𝑡) ∗ {ℎ1 (𝑡) ∗ ℎ2 (𝑡)} = {𝑥 (𝑡) ∗ ℎ1 (𝑡)} ∗ ℎ2 (𝑡) 𝑥(𝑡) ∗ {ℎ1 (𝑡) + ℎ2 (𝑡)} = 𝑥 (𝑡) ∗ ℎ1 (𝑡) + 𝑥(𝑡) ∗ ℎ2 (𝑡)

Linear Time Invariant Systems: Linear time-invariant systems (LTI systems) are the systems that are both linear and timeinvariant. Linear systems are systems whose outputs for a linear combination of inputs are the same as a linear combination of individual responses to those inputs. Time-invariant systems are systems where the output does not depend on when an input was applied. These properties make LTI systems easy to represent and understand graphically. Linearity: If a system is linear, this means that when an input to a given system is scaled by a value, the output of the system is scaled by the same amount.

For a linear system, an input x passed through the linear system L results in the output y. If x is scaled by a value α and is passed through the same system L, the output will also be scaled by α. A linear system obeys the principle of superposition. This means that if two inputs are added together and passed through a linear system, the output will be the sum of the individual inputs' outputs.

SIGNALS AND SYSTEMS

The scaling property mentioned above still holds in conjunction with the superposition principle. Therefore, if the inputs x1 and x2 are scaled by factors 𝑎1 and 𝑎2 , respectively, then the sum of these scaled inputs will give the sum of the individual scaled outputs. A discrete system is said to be linear if it satisfies the principle of superposition, such as: 𝐿[ 𝑎1 𝑥1 (𝑛) + 𝑎2 𝑥2 (𝑛) ] = 𝑎1 𝐿[ 𝑥1 (𝑛) ] + 𝑎2 𝐿[ 𝑥2 (𝑛) ] Time Invariance: Time-invariant systems are systems where the output for a particular input does not change depending on when that input was applied. A time-invariant system that takes in signal x(t) and produces output y(t) will also, when excited by signal x(t-t0), produces the time-shifted output y(tt0). Hence, the system is time invariant because the output does not depend on the particular time the input is applied.

When x(t) and x(t−t0) are passed through a time-invariant system, the inputs x(t) and x(t−t0) produce the same output. The only difference is that the output due to x(t−t0) is shifted by a time t0. Equivalently, a discrete-time system is time or (more appropriately) shift invariant if, 𝑦[𝑛 − 𝑛0 ] = 𝑇𝐼{𝑥[𝑛 − 𝑛0 ]}

SIGNALS AND SYSTEMS

LAB TASKS 1. Suppose that a linear time-invariant system is described by impulse response 𝒉[𝒏] = 𝟐𝒏 ∗ 𝒖[𝒏]. Compute response of the system to the input signal 𝒙[𝒏] = 𝒖[𝒏 + 𝟏𝟎] − 𝒖[𝒏 − 𝟓] for 𝒏 = −𝟏𝟓: 𝟏𝟓. Hint: (𝒖[𝒏] is the unit step function. Use the ‘conv’ function for computing the convolution of the given signals and use subplot() command to plot 𝒙[𝒏], 𝒉[𝒏] and 𝒚[𝒏]. SOURCE CODE:

SIGNALS AND SYSTEMS

OUTPUT:

SIGNALS AND SYSTEMS 2. Suppose that impulse response of a system is: 𝒆−𝒏, −𝟏𝟎 ≤ 𝒏 ≤ 𝟏𝟎 𝒉[𝒏] = { 𝟎, 𝒆𝒍𝒔𝒆𝒘𝒉𝒆𝒓𝒆 Compute the response of this system to input signal x[n], where: 𝟏, 𝒙[𝒏] = { 𝟎,

𝟎≤𝒏≤𝟓 𝒆𝒍𝒔𝒆𝒘𝒉𝒆𝒓𝒆

Use subplot command to plot 𝒙[𝒏], 𝒉[𝒏] and 𝒚[𝒏]. SOURCE CODE:

SIGNALS AND SYSTEMS

OUTPUT:

SIGNALS AND SYSTEMS 3. Consider the following input signal and the impulse response of the LTI system: 𝒙[𝒏] = 𝒆−𝟐𝒏𝒖[𝒏] 𝒉[𝒏] = 𝒖[𝒏 − 𝟏𝟎] Find the output y[n] when n=-15:15. Use subplot command to plot 𝒙[𝒏], 𝒉[𝒏] and 𝒚[𝒏].

SOURCE CODE:

SIGNALS AND SYSTEMS

OUTPUT:

SIGNALS AND SYSTEMS 4. Verify all the mathematical properties of convolution integral for the following signals: 𝒙[𝒏] = 𝒆−𝟐𝒏 ∗ 𝒖[𝒏 − 𝟏𝟎] 𝒉𝟏[𝒏] = 𝟐 −𝒏 ∗ 𝒖[𝒏 + 𝟑] 𝒉𝟐[𝒏] = 𝟎. 𝟑 𝒏 ∗ 𝒖[𝒏 − 𝟓] Use subplot command to plot 𝒙[𝒏], 𝒉𝟏 [𝒏], 𝒉𝟐[𝒏], LHS and RHS results of each property.

SOURCE CODE:

SIGNALS AND SYSTEMS

SIGNALS AND SYSTEMS

OUTPUT:

SIGNALS AND SYSTEMS

Conclusion: In this lab we have learnt about:  Convolution is a mathematical way of combining two signals to form a third signal. It is a mathematical operation that expresses a relationship between an input signal, the output signal, and the impulse response of a linear-time invariant system.  Studied about Discrete time convolution and continuous time convolution in MATLAB.  Studied about Linear time-invariant systems (LTI systems) , the systems that are both linear and time-invariant.  Implemented all these concepts in lab tasks....


Similar Free PDFs