DSP 02 - UniMAP Portal
Download
Report
Transcript DSP 02 - UniMAP Portal
After completing this portion, you should be
able to
manipulate the signal
Using
simple mathematical tools
that
make basic building blocks
and
should be able to explore their outputs
Tools: Building blocks:
Multiply with a constant: Gain.
Let the signal x[n] = [3.2 41 36 -9.5 0]
The element shown by upward arrow in the string represent
the signal at t = 0,
The next element, delayed by Ts; thus occurs at t=Ts has an
amplitude of 41, and the next delayed by 2Ts has an
amplitude 36 and so on.
This input signal is passed through a constant multiplier; an
amplifier; of gain A = 7/2,
W1 is the outcome when each element of the string x[n] is
multiplied by A.
W1= Ax[n] = [
].
Tools: shifting:
can be implemented by a shift register.
If the sampled signal x[n] = [ 3.2 41 36 -9.5 0] ;
is delayed by Ts, the output is
W2= x[n-1] = [
].
And if advanced, the output would be:
W3 = [
].
Note that as the position of arrows shifts,
Underlines shows zeros that are stuffed or padded.
Tools: addition
If one signal is x[n] = [3.2 41 36 -9.5 0] ;
and another is y[n] = [1.7 –0.5 0 0.8 1] .
The addition is element wise
W4= x[n] + y[n]:
W4 = [
].
Ex: [4x[n] -10y[n-1]] = [
]
Result:
[
].
Reds represent the position of elements at n= 0.
Tools: Multiplication
If one signal is x[n] = [3.2 41 36 -9.5 0] ;
and another is y[n] = [1.7 –0.5 0 0.8 1] .
The element wise multiplication is W4= x[n] . y[n]:
W5 = [
].
It is dot-product / element to element
multiplication.
Example_1:
realization of h[n]= [1,2,3,2]
For input: x[n] = [3.2 41 36 -9.6 0] for n=0:4;
Calculate output y[n].
Method_1 to Solution of Example_1
[3.2 41 36 -9.6 0] x [1 2 3 2 ].
Y[n]=
_______________________________
[
]
Solution to example_1
soln: The solution lies in multiplying two polynomials:
[a0x0 + a1 x1 +……+an-1xn-1 ].[boxo + b1 x1 +……..bm-1 xm-1].
The result is evaluated by tabular calculations of:
[ao
a1
a2 a3] x [bo
b1
b2 ]
=
a ob 2 a 1b 2 a 2b 2 a 3b 2
a ob 1 a 1b 1 a 2b 1 a 3b 1 x
a o b o a 1b o a 2b o a 3b o x
x
___________________________________________
coxo + c1x1 + c2x2 +c3x3 + c4x4 + c5x5
has {m+n -1} terms and power {m+n-2}.
This procedure of multiplication is termed as
Linear Convolution or, Convolution.
Method_2 to Solution of Example_1
Alternative procedure is using the table
3.2 41 36 -9.6
0
1
3.2 41 36 -9.6
0
2
6.4
82
72
-19.2
0
3
9.6 123 108 -28.8
0
2
6.4 82
0
72
-19.2
Toeplitz Algorithm for linear convolution
An algorithm to convert polynomials into a circulant matrix
and multiply to yield linear convolution.
The algorithm :
• Since the terms after multiplication are: p = m+n-1,
• therefore we need to convert any one of the
polynomials into a (pxq) “circulant” matrix and
• Another polynomial of length ‘q’ into a (qX1) matrix.
• To begin, create a column vector of size p from the
coefficients of any of the given polynomial and Pad
zeros in the remaining cells.
• Make second column of the circulant matrix by pasting
the first column to right and shifting all the elements
circularly one down.
Creating Toeplitz or Circulant
matrix for linear convolution
Continue the procedure till a (pxq) matrix is
constituted.
Likewise make another matrix M2 = (qX1) from
the coefficients of another polynomial.
Multiply [M1] and [M2] to get [M ]; a (p x 1)
matrix.
The transpose of the result is the convolution.
Alternatively we can use (pxp) (px1) matrix
also.
Method_3 for Example_1
• P= M+N-1 = 5 + 4 -1= 8.
• One matrix is [8x4] another matrix is [4x1]
A general structure of a Digital filter
y[n] + a1 y[n-1] + a2 y[n-2] = bo x[n] + b1 x[n-1] + b2 x[n-2]
Transfer function: z-transform
y[n] + a1 y[n-1] + a2 y[n-2] = bo x[n] + b1x[n-1] + b2 x[n-2]
If all the components are
linear and time invariant,
the above equation can be rewritten as:
The transfer function h[n] is given by:
y[n] / x[n] = h[n] =
In DSP Literature we use z-1 place of D,
Transfer function…
x[n]
h1[n]
h2 [n]
y[n]
x[n]
y[n]
h2 [n]
x[n]
h1[n]
y[n]
h1[n] * h2 [n]
*
• In time domain, the resulting transfer function of
cascaded block is the convolution of transfer
functions of each block.
h[n] = h1[n] *h2[n]. * is the sign of convolution.
• In Z-domain; H[z] = H1[z] H2[z]….
Transfer function…
h1[n]
x[n]
y[n]
x[n]
h1[n] + h2[n]
h2[n]
The transfer function of blocks connected in
parallel is given by the their sum.
h[n] = h1[n] + h2[n]+….
H[z] = H1[z] + H2[z] +…
y[n]
Transfer function…..
Inverse Transfer Function
The transfer functions
h1[n] and h2[n]
or,
H1[z] and H2[z]
if observe the rule:
h1[n] * h2[n] = [n],
or, H1[z] H2[z] = 1
are inverse of each other.
Inverse convolution
• Inverse transfer function are used when
solution to two polynomials in the form
y[n]/x[n] is to be obtained.
• It is obtained by dividing polynomial y[n] by
the polynomial x[n].
• This process is called inverse convolution.
Convolution with one input periodic
only one input x[n] is periodic; periodicity
N = 3:
Let x[n] = [2, 1, 3,……..] and
h[n] = [2,1, 1,3,1].
Word length of h[n] = M = 5.
The above can be solved by basic convolution
method.
Make an array of three or more x[n] in a
sequence.
Use linear convolution procedure to calculate
output.
Convolution contd.
The first and last (M-1) terms are
transients.
Remaining in between terms have
periodicity of N.
Number of repeated terms are “one less
over the repeated terms” of x[n] used in
the array.
For x[n] repeated thrice, the output is:
The system can also be periodic
x[n]
Z-1
+
ao
Z-1
Z-1
a2
a1
+
Feedback makes
it periodic
y[n]
a3
The number of delays are three
•
•
Therefore the system periodicity; N=3.
Solve for
h[n] = [ao a1 a2 a3] =[1 2 3 4]
Inputs:
a. x1[n] = [ 1 2 3 ]
b. x2[n] = [1 2 3 4 ]
c. x3[n] = [1 2 3 4 5]
We illustrate the case with x3(t)
Note: steady state output is [34, 44, 52] and circulates in the length of 3. It is due to
three delay elements.
The linear convolved output is [1, 4, 10, 20, 30, 34, 31, 20] when foldback in the
length of 3, we get:
[01, 04, 10,
20, 30, 34
31, 20
] .
Column wise summation gives: [52, 54, 44] which matches with the above.
Convolution with periodic input
using wrap around method:
The linear convolution of the given problem is:
[
].
The output will observe the periodicity of repeating function x[n]
i.e. N=3.
Therefore we wrap the convolved output in the word length of x[n]
N = 3 and sum them column wise.
The result is [
The output is in the sequence of
]
In an steady-state sequence, first term is unimportant. Sequence
should be maintained.
Example
Workout the linear convolution of
x[n] =[2 5 0 4 ] and h[n] =[4 1 3].
x[n] is periodic of periodicity N = 4.
length of convolved string is 4+3-1= 6.
Linear convolution: Y[n] = [8 22 11 31 4 12]
To find the periodic convolution wrap around the
length N=length of x[n] = 4.
It is [8 22 11 31
+ 4 12
]
= [12 34 11 31]
Example
Workout the linear convolution of
x[n] =[
] and h[n] =[
].
h[n] is periodic of periodicity N = 3.
length of convolved string is 4+3-1= 6.
Linear convolution: Y[n] = [
]
To find the periodic convolution wrap around the
length N=length of x[n] = 3.
It is
The circulant matrix in this case:
4 3 1 4 2
5
39
1 4 3 1 = 26
0
3 1 4 3 4 23
Note the circulant matrix. It is a 3x4 matrix made
from the values of x(n) =[4,1,3] with last column
made out of circulation. Size of x(n) being smaller
than h(n), zero padding is not needed.
Periodic Convolution:
both the signals should be of same period.
Let each signal be of word length N.
Find the linear convolution of one-period
segment of each. The string length is 2N-1.
Take elements equal to word length (N) in one
row.
Remaining [N-1] elements are to be wrapped
in second row.
Add elements column wise. The result will be
one period of periodic convolution.
Solution_1 of periodic
convolution
Convention for circular convolution
[1 0 1 1] [1 2 3 1] = [
].
The length of the string is (2N-1)= 7.
The length of periodic signal is 4.
ans.
Solution_2 for periodic
convolution a matrix approach
Deconvolution
• It is the process to evaluate x(t) for the given when y(t)
and h(t).
• The mathematical description for convolution is:
n
y( n) =
( h( k) x( n k) )
k =0
i.e. y(n)=h(0)x(n)+x(1)x(n-1)+……..+h(n)x(0)
• The above can be rewritten for n1 as:
n
y( n) = h( 0) x( n)
(h(k) x(n k))
k =1
Deconvolution:
n
y( n) = h( 0) x( n)
( h( k) x( n k) )
k =1
Hence
n
y( n)
x( n ) =
( h ( k) x( n k) )
k =1
h ( 0)