Discrete Time Systems -
Properties
Discrete Time Systems
• Both Ip and Op are discrete signals.
• Common System Properties:
– Static vs. dynamic
– Time-invariant vs. time-variant
– Linear vs. nonlinear
– Causal vs. non-causal
– Stable vs. unstable systems
Static vs. dynamic
• Static system (a.k.a. memoryless): the output at time n depends
only on the input sample at time n; otherwise system is dynamic.
• 𝑦(𝑛) =
𝑇 [𝑥(𝑛 − 𝑁); 𝑥(𝑛 − 𝑁 + 1); 𝑥(𝑛 − 1); 𝑥(𝑛); 𝑥(𝑛 +
1) ; 𝑥(𝑛 + 𝑀 − 1); 𝑥(𝑛 + 𝑀)]; 𝑁; 𝑀 > 0
• For N = M =0, 𝑦(𝑛) = 𝑇 [𝑥(𝑛)], the system is static.
Examples
• 𝑦(𝑛) = 𝐴 𝑥(𝑛), 𝐴 ≠ 0
• 𝑦 𝑛 = 𝐴 𝑥 𝑛 + 𝐵, 𝐴, B ≠ 0
• 𝑦(𝑛) = 𝑥(𝑛) cos(n − 1)
• 𝑦(𝑛) = 𝑥(−𝑛)
• 𝑦(𝑛) = 𝑥(𝑛 + 1)
• 𝑦 𝑛 = (𝑛 − 1)𝑥(𝑛2)
• Do you know of any such system?
If I increase the duration of class beyond regular time…..
Time-invariant vs. time-variant
• IF TI, 𝑥 𝑛 → 𝑦 𝑛 ⟹ 𝑥 𝑛 − 𝑘 → 𝑦 (𝑛 − 𝑘 )
– for every input 𝑥 (𝑛) and every time shift 𝑘
• 𝑦(𝑛) = 𝑥(−𝑛)?
• If you perform an experiment today, it should lead to
same results tomorrow as well.
Time-invariant vs. time-variant
• 𝑦(𝑛) = 𝑥(−𝑛)
• Time variant
• If n is inside brackets # x[n + const], then the
system is TI .
• A system that computes average should be time
invariant.
• x[kn], where k is not one, x[n2] are?
Linear vs. Nonlinear Systems
• Follows superposition principle
• Governed by :
• 𝑇 [𝑎1 𝑥1 (𝑛) + 𝑎2 𝑥2 (𝑛)] = 𝑎1 𝑇 [𝑥1 (𝑛)] +
𝑎2 𝑇 [𝑥2 (𝑛)]
– for any arbitrary input sequences 𝑥1 (𝑛) and 𝑥2 (𝑛), and
any arbitrary constants a1 and a2
– y(n) = nx(n)
– Y(n) = x(n2)
– Y(n) = x2(n)
– Y(n) = ex(n)
• Revision of signals and systems
• Basic concepts of systems, notations
• Direct form I & II realizations
• Crosscorrelation, relation with convolution
• I/p Op relations using Crosscorrelation
• Determines periodicity of a given signal, time
lag etc
TI system, find linearity?
Discrete signal representation, ^ represents the origin,
otherwise default is the left most element for origin
• x1(n) = {1,0,2} {0,1,2}
• x2(n) = {0,0,3} {0,1,0,2}
• x3(n) = {0,0,0,1} {1,2^,1}
Linear system, find TI
• x1(n) = {-1,2^,1} {1,2^,-1,0,1}
• x2(n) = {1,-1^,-1} {-1,1^,0,2}
• x3(n) = {0,1^,1} {1^,2,1}
Find impulse response of LTI system {1,3,3,1} {1,4,6,4,1},
system is under zero initial condition or relaxed.
Causal vs. non-causal
• Causal system: output of system at any time n
depends only on present and past inputs
• System is causal if;
𝑦 (𝑛) = 𝑇 [𝑥 (𝑛), 𝑥 (𝑛 − 1), 𝑥 (𝑛 − 2), . . . ]∀𝑛
𝑦 𝑛 = 𝑥(𝑛2 )
Stability
• Bounded Input-Bounded output (BIBO) Stable: every
bounded input produces a bounded output
• System is BIBO stable if
• 𝑥 𝑛 ≤ 𝑀𝑥 < ∞ → 𝑦 𝑛 ≤ 𝑀𝑦 < ∞ ∀𝑛
FIR vs IIR
• Finite vs. Infinite Impulse Response
• For causal LTI systems, h(n) = 0 for n < 0.
• Finite impulse response (FIR):
• 𝑦 (𝑛) = 𝑛𝑘=0 ℎ(𝑘 )𝑥 (𝑛 − 𝑘 )
• Infinite impulse response (IIR): 𝑦 (𝑛) =
𝑛
𝑘=0 ℎ(𝑘 )𝑥 (𝑛 − 𝑘 )
• How to realize these systems?
• Implementation :Two classes
• Finite impulse response (FIR): 𝑦 (𝑛) =
𝑛
𝑘=0 ℎ(𝑘 )𝑥 (𝑛 − 𝑘 )
• These are Nonrecursive systems
• In infinite impulse response (IIR):
𝑦 (𝑛) = 𝑛𝑘=0 ℎ(𝑘 )𝑥 (𝑛 − 𝑘 )recursive
systems
System Realization
• FIR systems can be readily implemented by their
convolution summation (involves additions,
multiplications, and a finite number of memory
locations).
• IIR systems, however, cannot be practically
implemented by convolution as this requires infinite
memory locations, multiplications, and additions.
• There is a practical and computationally efficient
means of implementing all FIR and a family of IIR
systems that makes use of difference equations
LCCDE
• Lets take a recursive equation
• y(n) = ay(n-1) + x(n)
• y(1) = ay(0) + x(1) = a2y(-1) + ax(0) +x(1)
• y(2) = ay(1) + x(2) = a3y(-1) + a2x(0) + ax(1) +
x(2)
𝑛 𝑘
• Y(n) = an+1y(-1) + 𝑘=0 𝑎 𝑥 𝑛 − 𝑘 ,𝑛 ≥ 0
Zero state response
• Lets take y(-1) = 0 ie the system is relaxed or
zero initial conditions.
• Only Second term remains and is called zero-
state response.
• Zero state also refers the fact that system is at
zero state, where state also has a connotation
of memory.
• Also called as forced response as it is forced by
an input.
Zero input response
• Suppose that the system is non-relaxed ie y(-
1) is non-zero, and the input x(n) = 0.
• Then the output of the system is called zero
input response.
• First term is zero input response.
• Also called natural or free response.
• Nth order LCCDE
• 𝑁 𝑘=0 𝑘 𝑎 𝑦(𝑛 − 𝑘) = 𝑀
𝑘=0 𝑏𝑘 𝑥(𝑛 − 𝑘)
• Initial
conditions: 𝑦(−1); 𝑦(−2); 𝑦(−3); 𝑦(−𝑁).
• Solution – y(n) = yh(n) + yp(n)
Homogenous solution
• 𝑁𝑘=0 𝑎𝑘 𝑦 𝑛 − 𝑘 = 0
• Put yh(n)=𝜆𝑛
• 𝑁𝑘=0 𝑎𝑘 𝜆
𝑛−𝑘 = 0
• 𝜆𝑛−𝑁 𝜆𝑁 + 𝑎1𝜆𝑁−1 + 𝑎2𝜆𝑁−2 + ⋯ + 𝑎𝑁 − 1𝜆 + 𝑎𝑁 − 𝑁 =
0
• yh(n) = C1𝜆1𝑛 + C2𝜆2𝑛 +…+ CN𝜆𝑁𝑁 𝑛
Example
• Determine the homogenous solution of the system
described by the first order difference equation y(n) + ay(n-
1) = x(n)
• 𝜆𝑛 + 𝑎 𝜆𝑛−1 = 0
• yh(n)=C 𝜆𝑛 , C is determined by initial conditions
• If we want to determine zero-input response, then x(n) = 0,
and particular solution is zero in this case.
• yh(0)=C
• y(0)=-ay(-1) = yh(0) = C
• yzi(n) = -ay(-1) 𝜆𝑛 = (-a)n+1y(-1), n>=0
Example
• Determine the zero input response of the system described
by the homogenous second order difference equation y(n) –
3y(n-1) – 4y(n-2) = 0.
• Yh(n) = C1 𝜆1𝑛 +C2 𝜆2𝑛
• Y(0) = 3y(-1) + 4y(-2) = C1 + C2
• Y(1) = 13y(-1) + 12y(-2) = -C1+4C2
• Given y(-1) and y(-2), we can find C1 and C2, which gives zero
input response.
Particular solution
• First order difference equation with input
x(n) = u(n).
• Yp(n) = Ku(n)
• Ku(n) + aKu(n-1) = u(n)
• For n>=1 Particular solution is of same
form as Input
• K+aK = 1 X(n) = Au(n), then yp(n) = Ku(n)
X(n) = Amnu(n), then yp(n) = Kmnu(n)
• K = 1/(a+1) X(n)= Acos wn, then
yp(n) = K1coswn+K2sin wn
X(n) = δ(n), yp(n) = 0
Find particular solution
• y(n) = 5/6 y(n-1) – 1/6y(n-2) + x(n), x(n) = 2n,
n>=0
y(n) + .2y(n-1) = x(n)
a = [1 0 .2]; b = [1 1]; %%%coefficients of DE
x =[1 1 1 1 1 1 ]; %%%input
zi = [1]; %%initial condition y(-1)
xic = filtic(b,a,zi); %%%generating filter initial condition for
command filter
y = filter(b,a,x,xic); %filtering while taking care of initial
conditions
plot(y)
%x = zeros(1,10); % for zero input response as input = 0
%zi = 0; for zero state response as initial conditions = 0
Total solution
• y(n) + ay(n-1) = x(n), x(n) = u(n)
• yp(n) = 1/(1+a)u(n)
• yh(n) = C(-a)n
• Suppose we want to obtain zero state response,
y(-1) = 0
• Y(0) +ay(-1) = 1
• Whereas, y(0) = C + 1/(1+a) = 1
• Thus C = a/(1+a)
• Y(n) = {1 – (-a)n+1}/(1+a)
Total solution contd.
• y(n) – 3y(n-1) – 4y(n-2) = x(n) + 2x(n-1), x(n) =
4nu(n), initial conditions y(-1) and y(-2).
• Y(n) = C1(-1)n + C2(4)n + yp(n)
• Yp(n) = Kn4nu(n)
• Determine y(n), n>=0 of the system y(n) –
4y(n-1) + 4y(n-2) = x(n) – x(n-1)
when input is x(n) = (-1)nu(n), and the system
is relaxed ie zero initial conditions.
Impulse response of LTI system using
zero state response
• Compute homogenous solution as particular solution is
zero.
• In other words, we compute only zero state response .
• Start with homogenous solution and then find the
coefficients, imposing zero initial conditions
• Here particular solution is zero and total solution is the
homogenous solution only.
• Determine impulse response and step
response for y(n) = 0.6y(n-1) -0.08y(n-2) + x(n)
• Impose three conditions
• -start with homogenous response
• -zero initial conditions
• -input is impulse function
Impulse response using matlab
• Let us assume a system y(n) = x(n) + x(n-1),
with zero initial conditions.
• h(n) is computed by substituting x(n) =
delta(n)
• %%%using matlab
• b = [1 1]; a = [1]; x = [1 0 0 0 0 0 0 0]; zi = 0;
• h = filter(b,a,x);
• n = 1:numel(x); stem(n,h)
• y(n) − y(n − 1) + 0.9y(n − 2) = x(n); ∀n
• Calculate and plot the impulse response h(n)
at n = −20, . . . , 100.
• Calculate and plot the unit step response s(n)
at n = −20, . . . , 100.
• Is the system specified by h(n) stable?
Basic building blocks
• Adder, Multiplier and Unit Delay, Unit Advance
• Consider a 5-point local averager:
1 𝑛
• 𝑦 𝑛 = 𝑘=𝑛−4 𝑥 𝑘 , 𝑛 = 0, 1, 2 …
5
• Impulse response of system
1 𝑛
• ℎ 𝑛 = 𝑘=𝑛−4 𝛿 𝑘 , 𝑛 = 0, 1, 2 …
5
• FIR implementation
• Memory requirements stay constant; only
need to store 5 values (4 last + present). Fixed
number of adders required.
• In general, length M FIR impulse response requires
• M multipliers, M-1 addition and M-1 memory
elements
IIR system realization
• IIR
• 𝑦 𝑛 =
𝑛
𝑘=0 𝑥 𝑘 , 𝑛 = 0, 1, 2 … 𝑓𝑜𝑟 𝑦 −1 = 0
• The impulse response is given by:
• ℎ 𝑛 = 𝑛𝑘=0 𝛿 𝑘 , 𝑛 = 0, 1, 2 …
• IIR memory requirements seem to grow with
increasing n.
• 𝑦 𝑛 =
𝑛−1
𝑘=0 𝑥 𝑘 + 𝑥 𝑛 = 𝑦 𝑛 − 1 + 𝑥(𝑛)
Direct Form I vs. Direct Form II
Realizations
𝑁 𝑀
• 𝑘=0 𝑎𝑘 𝑦(𝑛 − 𝑘) = 𝑘=0 𝑏𝑘 𝑥(𝑛 − 𝑘)
𝑁 𝑀
• 𝑦 𝑛 =− 𝑘=1 𝑎𝑘 𝑦 𝑛−𝑘 + 𝑘=0 𝑏𝑘 𝑥(𝑛 − 𝑘)
𝑀
• Output 1: 𝑣 𝑛 = 𝑘=0 𝑏𝑘 𝑥(𝑛 − 𝑘) (nonrecursive)
𝑁
• Output 2: 𝑦 𝑛 = − 𝑘=1 𝑎𝑘 𝑦 𝑛 − 𝑘 + 𝑣(𝑛)
(recursive)
Direct Form I IIR Filter
Implementation
• Requires: M + N + 1 multiplications, M + N additions, M + N memory locations
• Uses separate delays for input and output
Direct Form II IIR Filter
Implementation
• Requires: M + N + 1 multiplications, M + N
additions, M + N memory locations
Direct Form II IIR Filter
Implementation
• Requires: ??? multiplications, ?? additions, ??
memory
Direct Form II IIR Filter
Implementation
• Requires: M + N + 1 multiplications, M + N
additions, max(M , N ) memory
• Last lecture –
– Basics of TI, stable, causal systems
– Notion of FIR and IIR impulse responses
– Difference equations and LTI
– Direct form I and II realization
• Cross and Auto-correlations
• Periodicity, Echo, impulse response
• Z-transform
Cross correlation (Matched filter)
• Correlation of Discrete-Time Signals:
• Consider a class of problems related to radar
𝑦 𝑛 = 𝑎𝑥(𝑛 – 𝐷) + 𝑤(𝑛)
w(n) = noise
x(n) = transmitted signal
D = round trip delay
a = attenuation
Crosscorrelation
• Define crosscorrelation for energy signals as –
rxy (l ) x(n) y(n l ) x(n l ) y(n),
n n
l 0,1,2,...
(Put 𝑛 = 𝑙 + 𝑚)
• 𝑟𝑦𝑥 (𝑙) is thus the folded version of 𝑟𝑥𝑦(𝑙)
around 𝑙 = 0
ryx (l ) y(n) x(n l ), l 0,1,2,... ⟹ rxy (l ) ryx (l )
n
Example – anu(n), 0<a<1
• The cross-correlation machine and convolution
machine are identical, except that in the
correlation machine this flip doesn't take place,
and the samples run in the normal direction.
rxy (l ) x(l ) y (l )
Auto-correlation
• For autocorrelation, we thus have:
rxx (l ) rxx (0) E x
• This means that autocorrelation of a signal attains its
maximum value at zero lag (makes sense as we expect the
signal to match itself perfectly at zero lag).
𝑟𝑥𝑥 (𝑙) 𝑟𝑥𝑥 (𝑙)
• Normalized autocorrelation 𝜌𝑥𝑥 = =
𝑟𝑥𝑥 (0) 𝐸𝑥
𝑟𝑥𝑦 (𝑙)
• Normalized crosscorrelation 𝜌𝑥𝑦 (𝑙) = =
𝑟𝑥𝑥 (0)𝑟𝑦𝑦 (0)
𝑟𝑥𝑦 (𝑙)
𝐸𝑥 𝐸𝑦
Correlation of Periodic Sequences:
• Let x(n) and y(n) be periodic with period N
signals. Their crosscorrelation is defined
as:
1 N 1
rxy (l ) x(n) y (n l )
N n 0
Periodic signals corrupted with noise
• 𝑦 𝑛 = 𝑥 𝑛 + 𝑤(𝑛)
• 𝑟𝑦𝑦 𝑙 = 𝑟𝑥𝑥 𝑙 +𝑟𝑤𝑤 𝑙
• Autocorrelation of noise is usually a spike at l
= 0 due to assumption of white noise.
• Apart from peaks at l=0, there will be peaks at
integer multiples of N.
• ECG and PPG signals are periodic and period
can be extracted using this way.
• %%% Generate periodic signal an test for perdiodicity
• nx = [-50:50];
• x = cos(pi*nx); %periodic with period N = 2
• z=x;
• y = x;
• % [y,ny] = sigshift(x,nx,2); % obtain x(n-2)
• ny = nx;
• w = .15*randn(1,length(y)); nw = ny; % generate w(n)
• [y,ny] = sigadd(y,ny,w,nw); % obtain y(n) = x(n) + w(n)
• [y,ny] = sigfold(y,ny); % obtain y(-n)
• [rxy,nrxy] = conv_m(x,nx,y,ny); % cross-corrlation
• subplot(3,1,1);stem(nx,z)
• subplot(3,1,2);stem(nx,y)
• subplot(3,1,3);stem(nrxy,rxy./length(nx))
IP-OP relations for LTI Systems
• 𝑦 𝑛 = 𝑥 𝑛 ∗ ℎ(𝑛)
ryx (l ) y (l ) x(l ) h(l ) x(l ) x(l )
h(l ) rxx (l )
• As an illustration, if x(n) is white sequence, auto-
correlation would be similar to delta function.
• If this is given as an input to LIT, the output is its
impulse response.
Use white noise as input to determine
impulse response
• nx = [-50:50];
• ny = nx;
• w = .15*randn(1,length(nx));w=w/norm(w); nw = ny; %
generate w(n)
• h = [1, 2];
• [y,ny] = sigfold(w,nw); % obtain y(-n)
• [rxx,nrxx] = conv_m(w,nw,y,ny); % auto-correlation, rxx
• [ryx,nryx] = conv_m(h,1:numel(h),rxx,nrxx); % h*rxx
• subplot(3,1,1);stem(nrxx,rxx) % plot of rxx
• subplot(3,1,2);stem(nryx,ryx) % plot of ryx = h*rxx
• subplot(3,1,3);stem(1:numel(h),h) % plot of h, should be
same as that of ryx
Prove
ryy (l ) y (l ) y (l ) rhh (l ) rxx (l )
In this lecture, we learned about:
• Representations of discrete time signals and common basic DT signals
• Manipulation and representations/diagrams of DT systems
• Various classification of DT signals:
• Periodic vs. non-periodic, symmetric vs. anti-symmetric
• Classifications of DT systems:
– Static vs. dynamic, time-invariant vs. time-variant, linear vs. non-linear, causal vs.
– non-causal, stable vs. non-stable, FIR vs. IIR
• LTI systems and their representation
• Convolution for determining response to arbitrary inputs
• Cross-correlation