0% found this document useful (0 votes)
38 views

Signals and Systems Lab2. Linear Time-Invariant Systems

This document describes an experiment on signals and systems. It covers several topics: 1. Convolution sum for discrete-time linear time-invariant (LTI) systems, which describes the output of an LTI system as the convolution of the input and impulse response. 2. Causal LTI systems described by linear constant-coefficient difference equations, which characterize LTI systems using coefficient vectors A and B. 3. Exercises are provided to calculate convolution sums and characterize systems using coefficient descriptions.

Uploaded by

York Kang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Signals and Systems Lab2. Linear Time-Invariant Systems

This document describes an experiment on signals and systems. It covers several topics: 1. Convolution sum for discrete-time linear time-invariant (LTI) systems, which describes the output of an LTI system as the convolution of the input and impulse response. 2. Causal LTI systems described by linear constant-coefficient difference equations, which characterize LTI systems using coefficient vectors A and B. 3. Exercises are provided to calculate convolution sums and characterize systems using coefficient descriptions.

Uploaded by

York Kang
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

信号与系统实验

Signals and Systems Laboratory


Lab #2. Linear Time-Invariant
Systems
Instructor:张利君
Office: 一教129
Email: zhanglj@sustech.edu.cn
Department of Electrical and
Electronic Engineering
Outline
1. Convolution Sum for Discrete-Time LTI
Systems
2. Causal LTI Systems Described by Linear
Constant-Coefficient Difference Equations
3. Convolution Integral for Continuous-Time LTI
Systems
4. Causal LTI Systems Described by Linear
Constant-Coefficient Differential Equations
5. Design a Wireless Signal Detector

信号与系统实验 Signals and Systems Laboratory 2


Part 1. Convolution Sum for
Discrete-Time LTI Systems

信号与系统实验 Signals and Systems Laboratory 3


Representation of Discrete-Time Signals
+∞

𝑥𝑛 = 𝑥 𝑘 𝛿[𝑛 − 𝑘]
𝑘=−∞
n = 1:4;
x = [1 2 0.5 1];
stem(n,x,'filled'); xlabel('n');
title('x[n]');
xticks([1 2 3 4 ]); yticks([0 0.5 1
1.5 2]);
box off; grid on;

信号与系统实验 Signals and Systems Laboratory 4


Representation of Discrete-Time Signals

+∞

𝑥𝑛 = 𝑥 𝑘 𝛿[𝑛 − 𝑘]
𝑘=−∞
Another example
Time index for
nonzero values

n = 11:14;
x = [1 2 0.5 1];
stem(n,x,'filled'); xlabel('n');
title('x[n]');
xticks([11 12 13 14]); yticks([0
0.5 1 1.5 2]);
box off; grid on;

信号与系统实验 Signals and Systems Laboratory 5


Discrete-Time Unit Impulse Response

𝛿[𝑛 − 𝑘] S ℎ𝑘 [𝑛] (𝑘 = ⋯ , −1,0,1, ⋯)

S is linear
+∞ +∞
𝑥𝑛 = 𝑥 𝑘 𝛿[𝑛 − 𝑘] S 𝑦𝑛 = 𝑥[𝑘] ℎ𝑘 [𝑛]
𝑘=−∞ 𝑘=−∞
S is time-invariant
ℎ𝑘 𝑛 = ℎ[𝑛 − 𝑘]
+∞ +∞

𝑥𝑛 = 𝑥 𝑘 𝛿[𝑛 − 𝑘] S 𝑦𝑛 = 𝑥 𝑘 ℎ[𝑛 − 𝑘]
𝑘=−∞ 𝑘=−∞

Convolution Sum!

信号与系统实验 Signals and Systems Laboratory 6


Response of LTI Systems: Convolution Sum
+∞

𝑦𝑛 = 𝑥 𝑘 ℎ[𝑛 − 𝑘]
𝑘=−∞

𝑦 𝑛 = 𝑥[𝑛] ∗ ℎ[𝑛]

1. An LTI system is completely characterized by


its impulse response h[n].
2. From the impulse response, we can know
everything about the LTI system. (causality,
stability, static/dynamic, invertibility)
3. For any input, we can find the output
immediately by the convolution sum.

信号与系统实验 Signals and Systems Laboratory 7


Calculate Convolution Sum
Example#1 𝑦 𝑛 = 𝑥[𝑛] ∗ ℎ[𝑛]

h 𝑛 = 𝛿 𝑛 + 𝛿 𝑛 − 1 + 𝛿[𝑛 − 2]
𝑥 𝑛 = 0.5𝛿 𝑛 + 2𝛿[𝑛 − 1]

① Inspect the time index k where 𝑥[𝑘] ≠ 0;


② Shift h[n] to ℎ[𝑛 − 𝑘] as a whole on the n
axis;
③ Multiply ℎ[𝑛 − 𝑘] by 𝑥 𝑘 ;
④ Sum over −∞ < 𝑘 < +∞, where 𝑥[𝑘] ≠ 0,
then we obtain the output 𝑦[𝑛] for all n as
a whole.

𝑦 𝑛 = 0.5ℎ 𝑛 + 2ℎ[𝑛 − 1]
This is convenient only for sequences
with short durations!

信号与系统实验 Signals and Systems Laboratory 8


Calculate Convolution Sum
Example#2 𝑦 𝑛 = 𝑥[𝑛] ∗ ℎ[𝑛]
h𝑛 =𝑢 𝑛 𝑥 𝑛 = 𝛼𝑛𝑢 𝑛

① x k as a whole;
② Flip ℎ[𝑘] to ℎ −𝑘 ;
③ Shift ℎ[−𝑘] to ℎ[𝑛 − 𝑘] for each n;
④ Multiply 𝑥[𝑘] with ℎ[𝑛 − 𝑘] over the whole k axis;
𝑘
𝑥 𝑘 ℎ 𝑛−𝑘 = 𝛼 0≤𝑘≤𝑛
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
⑤ Sum over k, obtain the value of 𝑦[𝑛] for the specific time index n;
⑥ For other values of n, return to step 3 to do shift-multiplication-
summation again.
This is the usual way to
calculate convolution!

信号与系统实验 Signals and Systems Laboratory 9


Convolution Sum in MATLAB: conv(u,v)
+∞
𝑛−𝑏 =𝑎 →𝑛 =𝑎+𝑏
𝑦 𝑛 =𝑢 𝑛 ∗𝑣 𝑛 = 𝑢 𝑘 𝑣[𝑛 − 𝑘] 𝑛−𝑏−𝑀 =𝑎+𝑁 →𝑛 =𝑎+𝑏+𝑀+𝑁
𝑘=−∞ ∴ 𝑛𝑦 = [𝑎 + 𝑏: 𝑎 + 𝑏 + 𝑀 + 𝑁]
 Time index for nonzero values of 𝑢 𝑛 : 𝑛𝑢 = 𝑎: 𝑎 + 𝑁 ▲= 𝑎 + 𝑏 = 𝑛𝑢 1 + 𝑛𝑣(1)
 Time index for nonzero values of 𝑣 𝑛 : 𝑛𝑣 = 𝑏: 𝑏 + 𝑀 ∎ = 𝑎 + 𝑏 + 𝑀 + 𝑁 = 𝑛𝑢 𝑒𝑛𝑑 + 𝑛𝑣(𝑒𝑛𝑑)
Total number of nonzero values of y[n] is:
 Time index for nonzero values of 𝑦 𝑛 : 𝑛𝑦 =▲: ∎ 𝑀+𝑁+1

𝑢[𝑘] ⋯ 𝑘 𝑣[𝑘]
𝑎
⋯ 𝑘
𝑎+1 𝑎+2 𝑎+𝑁 𝑏 𝑏+1 𝑏+𝑀

Flip w.r.t the origin

Shift to the right by n


𝑣[−𝑘] ⋯ 𝑘
−𝑏 − 𝑀 −𝑏 − 1 −𝑏

信号与系统实验 Signals and Systems Laboratory 10


Convolution Sum in MATLAB: conv(u,v)
+∞

𝑦 𝑛 =𝑢 𝑛 ∗𝑣 𝑛 = 𝑢 𝑘 𝑣[𝑛 − 𝑘]
𝑘=−∞
 Define 𝑢, 𝑛𝑢 and 𝑣, 𝑛𝑣;
 Calculate 𝑦[𝑛] by 𝑦 = 𝑐𝑜𝑛𝑣(𝑢, 𝑣);
 Calculate the time index for nonzero values of 𝑦[𝑛]
𝑛𝑦 = 𝑛𝑢 1 + 𝑛𝑣 1 : 𝑛𝑢 𝑒𝑛𝑑 + 𝑛𝑣(𝑒𝑛𝑑)
u = [1 1 0.5 1.5];
nu = 3:6;
v = [1 1];
nv = 5:6;
y = conv(u,v);
ny = nu(1)+nv(1):nu(end)+nv(end);
subplot(3,1,1);
stem(nu,u,'r');xlim([3,12]);xlabel('n');
title('u[n]');
subplot(3,1,2);
stem(nv,v,'g');xlim([3,12]);xlabel('n');
title('v[n]');
subplot(3,1,3);stem(ny,y,'b');xlim([3,12
]);xlabel('n');title('y[n]=u[n]*v[n]');

信号与系统实验 Signals and Systems Laboratory 11


Exercise 2.1

Calculate the convolution between the discrete-time signals


ℎ 𝑛 = 0.7𝑛 , 0 ≤ 𝑛 ≤ 10 and 𝑥 𝑛 = 𝑢 𝑛 − 𝑢 𝑛 − 4 . Plot
ℎ[𝑛], 𝑥[𝑛] and y n = 𝑥 𝑛 ∗ ℎ[𝑛] for 0 ≤ 𝑛 ≤ 20 in three
subplots.

信号与系统实验 Signals and Systems Laboratory 12


信号与系统实验 Signals and Systems Laboratory 13
Part 2. Causal LTI Systems
Described by Linear Constant-
Coefficient Difference Equations

信号与系统实验 Signals and Systems Laboratory 14


Linear Constant-Coefficient Difference Equations
𝑁 𝑀

𝑎𝑘 𝑦 𝑛 − 𝑘 = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0

In order to completely define the input-output relationship of a system, some


auxiliary conditions are required. Different choices of the auxiliary conditions lead
to different input-output relationships. For an LTI system, the causality condition is
equivalent to the condition of initial rest—i.e., if 𝑥 𝑛 = 0 for 𝑛 < 𝑛0 , then 𝑦 𝑛 =
0 for all 𝑛 < 𝑛0 as well.

Linear constant-
coefficient difference + The condition
= Causal LTI
of initial rest system
equation

信号与系统实验 Signals and Systems Laboratory 15


Linear Constant-Coefficient Difference Equations
𝑁 𝑀

𝑎𝑘 𝑦 𝑛 − 𝑘 = 𝑏𝑘 𝑥[𝑛 − 𝑘]
𝑘=0 𝑘=0
𝑀
𝑏𝑘  Non-recursive
𝑁=0 𝑦𝑛 =
𝑎0
𝑥[𝑛 − 𝑘]  No need for auxiliary
𝑘=0
conditions
 Impulse response has
FIR 𝑏𝑛 finite duration
0≤𝑛≤𝑀
ℎ 𝑛 = 𝑎0  The output can be
calculated by conv(x,h)
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Example: 𝑦 𝑛 = 𝑥 𝑛 + 0.5𝑥 𝑛 − 1 + 2𝑥[𝑛 − 2]
 Recursive
 Auxiliary conditions is
𝑁≥1 Impulse response has
required
infinite duration  Impulse response has
IIR infinite duration
Example: 𝑦 𝑛 − 0.8𝑦[𝑛 − 1] = 2𝑥 𝑛  The output cannot be
calculated by conv(x,h)

信号与系统实验 Signals and Systems Laboratory 16


Causal LTI Systems
A causal discrete-time LTI system is uniquely determined by two vectors
𝐴 = [𝑎0 𝑎1 𝑎2 ⋯ 𝑎𝑁 ] and 𝐵 = [𝑏0 𝑏1 ⋯ 𝑏𝑀 ].

𝐴 = [1], 𝐵 = [1 0.5 2] for 𝑦 𝑛 = 𝑥 𝑛 + 0.5𝑥 𝑛 − 1 + 2𝑥[𝑛 − 2]

𝐴 = [1 − 0.8], 𝐵 = [2] for 𝑦 𝑛 − 0.8𝑦[𝑛 − 1] = 2𝑥 𝑛

How to define the system?


𝑦 𝑛 = −𝑦 𝑛 − 1 − 0.5𝑦 𝑛 − 2 + 0.2𝑥 𝑛 + 0.1𝑥 𝑛 − 1 + 0.1𝑥[𝑛 − 2]

信号与系统实验 Signals and Systems Laboratory 17


Output Calculation for Discrete-Time
Causal LTI Systems
For FIR systems, the command 𝑦 = 𝑐𝑜𝑛𝑣(𝑥, ℎ) can be
utilized, but how about the IIR system?

𝑦 = 𝑓𝑖𝑙𝑡𝑒𝑟(𝐵, 𝐴, 𝑥)

This is a solution for all discrete-time causal LTI


systems including FIR and IIR systems.

Attention: y share the same time index with the input


x, so the output y may be truncated, it does not cover
the whole nonzero elements of the output.

信号与系统实验 Signals and Systems Laboratory 18


Output Calculation for Discrete-Time
Causal LTI Systems
𝑦 𝑛 − 0.8𝑦[𝑛 − 1] = 2𝑥 𝑛

A = [1 -0.8];
B = 2;
x1 = [1]; % input is unit impulse,
output is the unit impulse response
y1 = filter(B,A,x1); y1n = 0;
x2 = [1 0 0 0];
y2 = filter(B,A,x2); y2n = 0:3;
x3 = [1 0 0 0 0 0 0 0 0 0 0];
y3 = filter(B,A,x3); y3n = 0:10;
subplot(3,1,1); stem(y1n,y1); xlim([0,10]);
subplot(3,1,2); stem(y2n,y2); xlim([0,10]);
subplot(3,1,3); stem(y3n,y3); xlim([0,10]);

MATLAB assume 𝑦 −1 = 0

信号与系统实验 Signals and Systems Laboratory 19


Output Calculation for Discrete-Time
Causal LTI Systems
𝑦 𝑛 = 𝑥 𝑛 + 0.5𝑥 𝑛 − 1 + 2𝑥[𝑛 − 2]

A = 1;B = [1 0.5 2]; % h[n] = B[n],


nh = 0:2, Nh = 3
x = [1]; % nx = 0:0
xx = [1 0 0]; % extend x[n], add
(Nh-1) zeros in the behind.
y1 = filter(B,A,xx); y1n = 0:2;
y2 = conv(x,B); y2n = 0:2;
subplot(2,1,1); stem(y1n,y1);
xticks([0:5]); xlim([0,5]);
title('impulse response by
filter');
subplot(2,1,2); stem(y2n,y2,'r');
xticks([0:5]); xlim([0,5]);
title('impulse response by conv');
MATLAB assume 𝑥 −1 = 𝑥[−2] = 0

信号与系统实验 Signals and Systems Laboratory 20


Output Calculation for Discrete-Time
Causal LTI Systems
Steps for calculate the output of FIR systems
𝑀

yn = 𝑏𝑚 𝑥[𝑛 − 𝑚]
𝑚=0

① Define ℎ = 𝑏0 𝑏1 ⋯ 𝑏𝑀 and its time index 𝑛ℎ = 0: 𝑀;


② Define input sequence 𝑥[𝑛] and its time index 𝑛𝑥;
③ Extend the input sequence by 𝑀 zeros 𝑥 = 𝑥 𝑧𝑒𝑟𝑜𝑠 1, 𝑀 , update
its time index simultaneously 𝑛𝑥 = 𝑛𝑥 1 : 𝑛𝑥 𝑒𝑛𝑑 + 𝑀
④ Calculate output sequence by 𝑦 = 𝑓𝑖𝑙𝑡𝑒𝑟 ℎ, 1, 𝑥 ;
⑤ Define the time index of the output by 𝑛𝑦 = 𝑛𝑥;
⑥ Plot the output of the system by 𝑠𝑡𝑒𝑚(𝑛𝑦, 𝑦).

信号与系统实验 Signals and Systems Laboratory 21


Comparison Between conv(u,v) and
filter(b,a,x)

𝒘 = 𝒄𝒐𝒏𝒗(𝒖, 𝒗) 𝒚 = 𝒇𝒊𝒍𝒕𝒆𝒓(𝒃, 𝒂, 𝒙)
Signal of finite duration Signal of finite duration
FIR FIR and IIR
𝑛𝑤 𝑛𝑦 = 𝑛𝑥
= 𝑛𝑢 1 Truncated output
+ 𝑛𝑣 1 : 𝑛𝑢 𝑒𝑛𝑑
+ 𝑛𝑣(𝑒𝑛𝑑)

信号与系统实验 Signals and Systems Laboratory 22


Impulse Response for Discrete-Time Causal
LTI Systems by impz(b,a,k)

𝑦 𝑛 + 0.5𝑦 𝑛 − 1 − 0.2𝑦[𝑛 − 2] = 10𝑥 𝑛

a = [1 0.5 -0.2];
b = 10;
k = 20;
impz(b,a,k)

Number
of points
MATLAB assume 𝑦 −2 = 𝑦[−1] = 0

信号与系统实验 Signals and Systems Laboratory 23


Exercise 2.2
𝑦 𝑛 = −𝑦 𝑛 − 1 − 0.5𝑦 𝑛 − 2 + 0.2𝑥 𝑛 + 0.1𝑥 𝑛 − 1 + 0.1𝑥[𝑛 − 2]

For the above system, compute and plot in the time interval
0 ≤ 𝑛 ≤ 20

a) The impulse response of the system


b) The step response of the system
c) The response of the system to the input 𝑥 𝑛 = 𝑛 ∙ 0.9𝑛 ,
0≤𝑛≤5

信号与系统实验 Signals and Systems Laboratory 24


信号与系统实验 Signals and Systems Laboratory 25
Part 3. Convolution Integral for
Continuous-Time LTI Systems

信号与系统实验 Signals and Systems Laboratory 26


Representation of Continuous-Time Signals

+∞

𝑥(𝑡) = 𝑥(𝑘∆)𝛿∆ (𝑡 − 𝑘∆)∆


𝑘=−∞

𝛿 𝑡 = lim 𝛿∆ (𝑡)
∆→0 𝑥(𝑘∆)𝛿∆ (𝑡 − 𝑘∆)∆

+∞
𝑥 𝑡 = lim 𝑥 𝑡 = 𝑥 𝜏 𝛿 𝑡 − 𝜏 𝑑𝜏
∆→0 −∞

信号与系统实验 Signals and Systems Laboratory 27


Continuous-Time Unit Impulse Response

𝛿∆ (𝑡 − 𝑘∆) S ℎ𝑘∆ (𝑡) (𝑘 = ⋯ , −1,0,1, ⋯)

S is linear
+∞ +∞

𝑥(𝑡) = 𝑥(𝑘∆)𝛿∆ (𝑡 − 𝑘∆)∆ S 𝑦(𝑡) = 𝑥 𝑘∆ ℎ𝑘∆ (𝑡)∆


𝑘=−∞ 𝑘=−∞
+∞ +∞
𝑥 𝑡 = lim 𝑥 𝑡 = 𝑥 𝜏 𝛿 𝑡 − 𝜏 𝑑𝜏 𝑦 𝑡 = lim 𝑦 𝑡 = 𝑥 𝜏 ℎ𝜏 𝑡 𝑑𝜏
∆→0 ∆→0 −∞
−∞
S is time-invariant
ℎ𝜏 (𝑡) = ℎ(𝑡 − 𝜏)

+∞ +∞
𝑥 𝑡 = 𝑥 𝜏 𝛿 𝑡 − 𝜏 𝑑𝜏 S 𝑦 𝑡 = 𝑥 𝜏 ℎ 𝑡 − 𝜏 𝑑𝜏
−∞ −∞

Convolution Integral!

信号与系统实验 Signals and Systems Laboratory 28


Response of LTI Systems: Convolution Integral
+∞
𝑦 𝑡 = 𝑥 𝜏 ℎ 𝑡 − 𝜏 𝑑𝜏
−∞

𝑦(𝑡) = 𝑥(𝑡) ∗ ℎ(𝑡)

1. An LTI system is completely characterized by


its impulse response h(t).
2. From the impulse response, we can know
everything about the LTI system. (causality,
stability, static/dynamic, invertibility)
3. For any input, we can find the output
immediately by the convolution integral.

信号与系统实验 Signals and Systems Laboratory 29


Calculate Convolution Integral
Example 𝑦(𝑡) = 𝑥(𝑡) ∗ ℎ(𝑡) 1

h(t) = 𝑒 −𝑡 𝑢(𝑡) 𝑥(𝑡) = 𝑢(𝑡) 0 

1
1 1 1 
0
  t
0 0 0 1

① Flip ℎ(𝜏) to ℎ(−𝜏); 0
② Shift ℎ(−𝜏) to ℎ(𝑡 − 𝜏) for any t;
③ Multiply 𝑥(𝜏) with ℎ(𝑡 − 𝜏) over the whole 𝜏 axis; 1
−(𝑡−𝜏) 𝑡 > 0
𝑥(𝜏)ℎ(𝑡 − 𝜏) = 𝑒 
0 𝑡≤0 t 0
⑤ Integrate over 𝜏, obtain 𝑦(𝑡)
1

0 t

信号与系统实验 Signals and Systems Laboratory 30


Convolution Integral in MATLAB: conv(u,v)
+∞
y 𝑡 = −∞
𝑢 𝜏 𝑣 𝑡 − 𝜏 𝑑𝜏
1−𝑡 0≤𝑡≤1
𝑢 𝑡 =
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
y(𝑡) = 𝑢(𝑡) ∗ 𝑣(𝑡)
1 0≤𝑡≤2
 𝑣 𝑡 =
Define time step length: step_length 0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
 Define 𝑢 𝑡𝑢 and v, 𝑡𝑣;
 Calculate y(𝑡) by y = 𝑐𝑜𝑛𝑣(𝑢, 𝑣)*step_length;
 Calculate the time index for nonzero values of y(𝑡)
𝑛𝑦 = 𝑛𝑢 1 + 𝑛𝑣 1 : 𝑛𝑢 𝑒𝑛𝑑 + 𝑛𝑣(𝑒𝑛𝑑)
step_length = 0.01;
tv = 0: step_length :2;
v = ones(size(tv));
tu = 0: step_length :1;
u = 1-tu;
y = conv(u,v)* step_length;
ty = 0: step_length :3;
figure; plot(ty,y);

信号与系统实验 Signals and Systems Laboratory 31


Exercise 2.3
Calculate the convolution integral between the continuous-
time signals ℎ 𝑡 = 𝑒 −𝑡 𝑢 𝑡 − 𝑢(𝑡 − 10) and
0.6 −1 ≤ 𝑡 < 0.5
𝑥 𝑡 = 0.3 0.5 ≤ 𝑡 < 3
0 𝑡 < −1 𝑎𝑛𝑑 𝑡 > 3
Plot ℎ(𝑡), 𝑥(𝑡) and y(t) = 𝑥(𝑡) ∗ ℎ(𝑡) for −1 ≤ 𝑡 ≤ 20 in
three subplots.

信号与系统实验 Signals and Systems Laboratory 32


Part 4. Causal LTI Systems
Described by Linear Constant-
Coefficient Differential Equations

信号与系统实验 Signals and Systems Laboratory 33


Linear Constant-Coefficient Differential Equations
𝑁 𝑀
𝑑𝑘 𝑦(𝑡) 𝑑 𝑘 𝑥(𝑡)
𝑎𝑘 = 𝑏𝑘
𝑑𝑡𝑘 𝑑𝑡𝑘
𝑘=0 𝑘=0

In order to completely define the input-output relationship of a system, some


auxiliary conditions are required. Different choices of the auxiliary conditions lead
to different input-output relationships. For an LTI system, the causality condition is
equivalent to the condition of initial rest—i.e., if 𝑥(𝑡) = 0 for t ≤ 𝑡0 , then 𝑦(𝑡) = 0
for all t ≤ 𝑡0 as well, and therefore, the response for 𝑡 > 𝑡0 can be calculated from
the differential equation with the initial conditions
𝑑𝑦(𝑡0 ) 𝑑 𝑁−1 𝑦 𝑡0
𝑦 𝑡0 = =⋯= =0
𝑑𝑡 𝑑𝑡𝑁−1

Linear constant-
coefficient differential + The condition
= Causal LTI
of initial rest system
equation

信号与系统实验 Signals and Systems Laboratory 34


Linear Constant-Coefficient Differential Equations
𝑁 𝑀
𝑑 𝑘 𝑦(𝑡) 𝑑 𝑘 𝑥(𝑡)
𝑎𝑘 = 𝑏𝑘
𝑑𝑡𝑘 𝑑𝑡𝑘
𝑘=0 𝑘=0

𝑀
1 𝑑 𝑘 𝑥(𝑡)  Differentiate the input
𝑁=0 𝑦(𝑡) =
𝑎0
𝑏𝑘
𝑑𝑡𝑘
explicitly
𝑘=0
 No need for auxiliary
conditions

Example: 𝑦(𝑡) = 𝑥(𝑡) + 0.5𝑥(𝑡) + 2𝑥(𝑡)

 Implicit
 Auxiliary conditions is
𝑁≥1 𝑦 𝑡 = 𝑦ℎ 𝑡 + 𝑦𝑝 (𝑡) required
 The response consists
of two parts— a
Example: 𝑦(𝑡) − 0.8𝑦(𝑡) = 2𝑥(𝑡) particular solution plus
a homogeneous
solution

信号与系统实验 Signals and Systems Laboratory 35


Causal LTI Systems
A causal continuous-time LTI system is uniquely determined by two
vectors 𝐴 = [𝑎𝑁 ⋯ 𝑎2 𝑎1 𝑎0 ] and 𝐵 = [𝑏𝑀 ⋯ 𝑏1 𝑏0 ].

𝐴 = [1], 𝐵 = [2 0.5 1] for 𝑦(𝑡) = 𝑥(𝑡) + 0.5𝑥(𝑡) + 2𝑥(𝑡)

𝐴 = [1 − 0.8], 𝐵 = [2] for 𝑦(𝑡) − 0.8𝑦(𝑡) = 2𝑥(𝑡)

How to define the system?


𝑦 𝑡 + 𝑦 𝑡 + 0.5𝑦 𝑡 = 0.2𝑥 𝑡 + 0.1𝑥 𝑡 + 0.1𝑥(𝑡)

Pay attention to the order of the


coefficient vectors here!

信号与系统实验 Signals and Systems Laboratory 36


Output Calculation for Continuous-Time
Causal LTI Systems

𝑦 = 𝑙𝑠𝑖𝑚 𝐵, 𝐴, 𝑥, 𝑡
𝑦 = 𝑙𝑠𝑖𝑚(𝑠𝑦𝑠, 𝑥, 𝑡) Transfer
function
𝑠𝑦𝑠 = 𝑡𝑓(𝐵, 𝐴)
Impulse response: 𝑦 = 𝑖𝑚𝑝𝑢𝑙𝑠𝑒 𝐵, 𝐴, 𝑡
Step response: 𝑦 = 𝑠𝑡𝑒𝑝(𝐵, 𝐴, 𝑡)

𝐴 = [𝑎𝑁 ⋯ 𝑎2 𝑎1 𝑎0 ] 𝐵 = [𝑏𝑀 ⋯ 𝑏1 𝑏0 ]

𝑁 𝑀
𝑑 𝑘 𝑦(𝑡) 𝑑 𝑘 𝑥(𝑡)
𝑎𝑘 = 𝑏𝑘
𝑑𝑡𝑘 𝑑𝑡𝑘
𝑘=0 𝑘=0

信号与系统实验 Signals and Systems Laboratory 37


Output Calculation for Continuous-Time
Causal LTI Systems
𝑦 𝑡 + 2𝑦 𝑡 + 10𝑦 𝑡 = 10𝑥(𝑡)
a = [1 2 10]; b = 10;
t = 0:0.01:10; x = cos(2*pi*t);
y = lsim(b,a,x,t);
figure(1);impulse(b,a,t); MATLAB assume 𝑦(0) = 𝑦(0) = 0
figure(2);step(b,a,t);
figure(3);plot(t,y); title('response to the input
x(t)=cos(2\pit)');

信号与系统实验 Signals and Systems Laboratory 38


Exercise 2.4
For the system with the condition of initial rest,
𝑦 𝑡 + 3𝑦 𝑡 + 12𝑦 𝑡 = 𝑥 𝑡 − 𝑥 𝑡 − 6𝑥(𝑡)
Calculate and plot the impulse response, step response
and the response to the input
𝑥 𝑡 = cos 3𝜋𝑡 𝑢(𝑡)
for 0 ≤ 𝑡 ≤ 10.

信号与系统实验 Signals and Systems Laboratory 39


信号与系统实验 Signals and Systems Laboratory 40
Part 5. Design a Wireless Signal
Detector

信号与系统实验 Signals and Systems Laboratory 41


Example: Simplified Wireless Channel
Attenuation 0.4; delay 3

Attenuation 0.8; delay 1

Transmitter Receiver
Attenuation 0.6; delay 2
Wireless Channel (LTI System)
𝑦 𝑛 = 0.8𝑥 𝑛 − 1 + 0.6𝑥 𝑛 − 2 + 0.4𝑥[𝑛 − 3]

Detected Signal Received Signal


Signal Detector
z 𝑛 = 𝑥[𝑛] or 𝑦[𝑛]
(LTI System)
𝑧 𝑛 = 𝑥[𝑛 − 𝑘]
Impulse Response: ℎ2 𝑛 ∗ ℎ1 𝑛 = 𝛿[𝑛] or 𝛿 𝑛 − 𝑘
Difference Equation: 0.8𝑧 𝑛 − 1 + 0.6𝑧 𝑛 − 2 + 0.4𝑧 𝑛 − 3 = 𝑦[𝑛]
𝑧 𝑛 = 𝑧[𝑛 − 1] → 0.8𝑧 𝑛 + 0.6𝑧 𝑛 − 1 + 0.4𝑧 𝑛 − 2 = 𝑦[𝑛]

信号与系统实验 Signals and Systems Laboratory 42


Wireless Channel Simulation
Attenuation 0.4; delay 3

Attenuation 0.8; delay 1

Transmitter Receiver
Attenuation 0.6; delay 2
Wireless Channel (LTI System)

% Generate Tx signal
x = [1 2 3 4 0 0 0 1 2 5 0 0 ];
% Obtian Rx signal by simulating the wireless channel
a1 = 1;
b1 = [0 0.8 0.6 0.4];
y = filter(b1,a1,x);
% Compare the transmitted signal with the received
signal
figure(1);
subplot(2,1,1); stem(x); title('transmitted signal
x[n]');
subplot(2,1,2); stem(y); title('received signal
y[n]');

信号与系统实验 Signals and Systems Laboratory 43


Signal Detector Design Verification
Detected Signal Received Signal
Signal Detector
or
(LTI System)

Impulse Response: or
Difference Equation:

% Generate the detected signal by


the design of a detector
a2 = [0.8 0.6 0.4]; b2 = 1;
z = filter(b2,a2,y);
% Compare the transmitted signal
with the detected signal
figure(2);
subplot(2,1,1); stem(x);
title('transmitted signal x[n]');
subplot(2,1,2); stem(z);
title('detected signal z[n]');

信号与系统实验 Signals and Systems Laboratory 44


Think More…
In the above example, the wireless channel model is known,
the filter structure and parameters are given. The detector
design problem is a piece of cake, just use inverse filtering, find
the inverse of the impulse response of the original wireless
channel model.
If the wireless channel model is unknown, the problem is
very difficult, but if we know the structure of the model, but the
parameters are to be determined, then this is a relatively easy
problem: parameter estimation problem.
How can we find the parameters in the model?
𝑦 𝑛 = 𝑥 𝑛 + 𝛼𝑥[𝑛 − 𝑁]
How to find 𝛼? Least squares? How to find N? That is exactly
what the assignment 2.10 needs you to do! Do we need any
tools? Any mathematics?

信号与系统实验 Signals and Systems Laboratory 45


Echo Cancellation (Lab Assignment 2.10)

𝑅𝑦𝑦 𝑛 = 𝑥[𝑛] ∗ 𝛿 𝑛 + 𝛼𝛿 𝑛 − 𝑁 ∗ 𝑥[−𝑛] ∗ 𝛿 𝑛 + 𝛼𝛿 𝑛 + 𝑁


= 𝑅𝑥𝑥 [𝑛] ∗ 1 + 𝛼 2 𝛿 𝑛 + 𝛼𝛿 𝑛 − 𝑁 + 𝛼𝛿[𝑛 + 𝑁]
= 1 + 𝛼 2 𝑅𝑥𝑥 𝑛 + 𝛼𝑅𝑥𝑥 𝑛 − 𝑁 + 𝛼𝑅𝑥𝑥 [𝑛 + 𝑁]

𝑅𝑥𝑦 𝑛 = 𝑥 𝑛 ∗ 𝑦 −𝑛 = 𝑥[𝑛] ∗ 𝑥[−𝑛] ∗ 𝛿 𝑛 + 𝛼𝛿 𝑛 + 𝑁


= 𝑅𝑥𝑥 [𝑛] ∗ 𝛿 𝑛 + 𝛼𝛿[𝑛 + 𝑁]
= 𝑅𝑥𝑥 𝑛 + 𝛼𝑅𝑥𝑥 [𝑛 + 𝑁]

信号与系统实验 Signals and Systems Laboratory 46


Echo Cancellation (Lab Assignment 2.10)

Attenuation 𝛼; delay N

Attenuation 1; delay 0
Transmitter Receiver
𝑦 𝑛 = 𝑥 𝑛 + 𝛼𝑥 𝑛 − 𝑁

𝑦 𝑛 = 𝑥 𝑛 + 𝛼𝑥 𝑛 − 𝑁

min 𝑦 𝑛 − 𝑦[𝑛]
𝛼,𝑁

信号与系统实验 Signals and Systems Laboratory 47


Auto-correlation and Cross-correlation
Auto-correlation: 𝜙𝑥𝑥 𝑛 = +∞
𝑚=−∞ 𝑥 𝑚 + 𝑛 𝑥 𝑚 = 𝑥[𝑛] ∗ 𝑥[−𝑛]

Cross-correlation: 𝜙𝑥𝑦 𝑛 = +∞
𝑚=−∞ 𝑥 𝑚 + 𝑛 𝑦 𝑚 = 𝑥[𝑛] ∗ 𝑦[−𝑛]

clear all; close all;


u = randn(1,40); nu = 1:40;
v = fliplr(u); nv = -40:-1;
w = conv(u,v);
nw = nu(1)+nv(1):nu(end)+nv(end);
figure(1);
subplot(2,1,1); stem(nu,u);
xlabel('n');ylabel('u[n]');
title('a random signal');
subplot(2,1,2);stem(nw,w);
xlabel('n');ylabel('\phi_{uu}');
title('auto-correlation of a
random signal');

Auto-correlation of a random signal has a high peak at the origin.

信号与系统实验 Signals and Systems Laboratory 48


Auto-correlation Application: Echo Cancellation
Auto-correlation: 𝜙𝑥𝑥 𝑛 = +∞
𝑚=−∞ 𝑥 𝑚 + 𝑛 𝑥 𝑚 = 𝑥[𝑛] ∗ 𝑥[−𝑛]

Cross-correlation: 𝜙𝑥𝑦 𝑛 = +∞
𝑚=−∞ 𝑥 𝑚 + 𝑛 𝑦 𝑚 = 𝑥[𝑛] ∗ 𝑦[−𝑛]
nx = 100; x = randn(1,nx);
N = 50; alpha = 0.9; 𝑦 𝑛 = 𝑥 𝑛 + 0.9𝑥 𝑛 − 50
y = filter([1 zeros(1,N-1) alpha],1,x);
Rxx = conv(x,fliplr(x));
Ryy = conv(y,fliplr(y));
Ryx = conv(y,fliplr(x));
figure;
subplot(3,1,1); plot([-nx+1:nx-1],Rxx);grid on;
title('autocorrelation of x[n]');
subplot(3,1,2); plot([-nx+1:nx-1],Ryy);grid on;
title('autocorrelation of y[n]');
subplot(3,1,3); plot([-nx+1:nx-1],Ryx);grid on;
title('cross-correlation of y[n] and x[n]');

Look at the differences between auto-correlations and cross-correlation


of input and output signals of a filter.

信号与系统实验 Signals and Systems Laboratory 49


Lab#2 Assignment
 Read tutorial 2.1&2.2&2.3 by yourself
 Finish 2.4 & 2.5 & 2.10
◇ The sound file for 2.10: lineup.mat
Download it from Blackboard.

Deadline: 10:00am October 14th


Submit the report in word or pdf
format through Blackboard.

信号与系统实验 Signals and Systems Laboratory 50

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy