ErhanInce DSP Lecture2 Ch2
ErhanInce DSP Lecture2 Ch2
e-mail: [email protected]
1
2
3
4
5
6
7
8
9
10
11
12
cos
cos =
13
Determine the fundamental period of the following sequence
not rational
rational N 1= 20
If N1 and N2 were different we take their least common multiplier as the period.
14
n=0:30;
xn = 3*cos((pi/8)*n);
figure, stem(n,xn)
15
16
17
If the output y[n] for each value of n depends only on the input x[n] at the same n value
then we say the system is MEMORYLESS.
18
19
𝟏 𝟎 𝟏 𝟎 𝟎 𝟎𝟏
𝟎𝟏𝟎𝟎𝟎𝟏𝟎
𝟏𝟎𝟎𝟎𝟏𝟎𝟎
d=[1; 0; 0; 0; 1; 0; 1]
B = 1/3*ones(3,1)
out = filter(B,1,d)
filter(B,A,X)
Filters the data in vector X with the filter defined in vectors A and B
20
21
22
x[n] = 1 0 0 1 1 0 1
y[n-1]= 0 1 1 1 2 3 3
y[n] = 1 1 1 2 3 3 4 the output is growing in accumulator
23
24
25
26
27
28
Time Invariant System
If such a time shift in the input signal causes the same time-shift
In the output signal, then we say the system is time-invariant
29
30
y[n] = x[n] cos(0.2n)
y[n-n0] =x[n-n0]cos(0.2(n-n0))
w[n] y[n-n0]
31
y[n]=3x[n]-4x[n-1]
x1= x[n-n0]
y1[n]=3x1[n]-4x1[n-1] = 3 x[n-n0] - 4 x[n-n0-1]
32
33
the accumulator
Let
34
If for any choice of n0
No feature values
Only past and present values
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Difference Equations
An important subclass of LTI systems are defined by
an Nth-order linear constant-coefficient difference equation:
N M
a
0
k y[n k ] bm x[n m ]
0
y = filter(a,b,x);
53
Total Solution Calculation
N M
a
k 0
k y[n k ] bm x[n m ]
m 0
a
k 0
k yh [n k ] 0
Some textbooks use the term complementary solution instead of homogeneous solution
54
Homogeneous Solution
N
Given the homogeneous equation: a k yh [n k ] 0
k 0
yh [n ] n
then
N
yh [n ] ak n k n N a0N a1N 1 a N 0
k 0
a
k 0
k y[n k ] bm x[n m ]
m 0
To find the particular solution we assume for the solution yp[n] a form that
depends on the form of the specific input signal x[n].
y[ n ] y h [ n ] y p [ n ]
56
General Form of Particular
Solution
Input Signal Particular Solution
x[n] yp[n]
A (constant) K
AMn KMn
AnM K0nM+K1nM-1+…+KM
AnnM An(K0nM+K1nM-1+…+KM)
A cos(o n) K1 cos(o n) K 2 sin(o n)
A sin(o n)
57
Example
Determine the homogeneous solution for
58
Example
Determine the particular solution for
6 8
which is satisfied by b = -2
59
Example
Determine the total solution for
then 1 1
y[ 1] A1 A2 2 1 A1 1.8
3 2
1 1 A2 4.8
y[ 3] A1 A2 2 1
9 4
62
Example
Determine the impulse response for
h[n] A1 3 A2 2
n n
For n=0
y[0] y[ 1] 6 y[ 2] x[0]
h[0] δ[0] 1 A1 A2 1
For n=1
y[1] y[0] 6 y[ 1] x[1] 3 A1 2 A2 A1 A2 0
h[1] h[0] δ[1] 0 3 2
A1 , A2
5 5
3 2 n
h[n] 3 2
n
n 0
5 5
65
66
67
Frequency Response of the Ideal Delay
𝑦 [ 𝑛 ] =𝑥 [ 𝑛 −𝑛 𝑑 ]
If we consider then
H(
𝑗𝑤
=1 ∠ H( 𝑒 ¿=−𝑤 𝑛 𝑑
69
70
71
Frequency Response of the Moving-Average System
Impulse response of a moving-average system is
72
73
74
75
76
77