Presentation is loading. Please wait.

Presentation is loading. Please wait.

EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 2 DISCRETE TIME SIGNAL AND SYSTEMS.

Similar presentations


Presentation on theme: "EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 2 DISCRETE TIME SIGNAL AND SYSTEMS."— Presentation transcript:

1 EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 2 DISCRETE TIME SIGNAL AND SYSTEMS

2 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

3 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 T s; thus occurs at t=T s has an amplitude of 41, and the next delayed by 2T s has an amplitude 36 and so on.  This input signal is passed through a constant multiplier; an amplifier; of gain A = 7/2,  W 1 is the outcome when each element of the string x[n] is multiplied by A.  W 1 = Ax[n] = [11.2 143.5 126 -33.25 0]. 

4 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 W 4 = x[n] + y[n]: W 4 = [4.9 40.5 36 -8.7 1]. Ex: [4x[n] -10y[n-1]] = [12.8 164 144 -38 0] - [ 0 17 -5 0 8]. Result: [12.8 147 149 -38 -8]. Reds represent the position of elements at n= 0.

5 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 T s, the output is W 2 = x[n-1] = [ 0 3.2 41 36 -9.5 ].  And if advanced, the output would be: W 3 = [ 41 36 –9.5 0 0 ].  Note that as the position of arrows shifts, Underlines shows zeros that are stuffed or padded.

6 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 W 4 = x[n]. y[n]: W 5 = [5.44 -20.5 0 -7.6 0]. It is dot-product / element to element multiplication.

7 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]. x[n] D1D1 D2D2 D3D3 x[n-1] x[n-2]x[n-3] oo 11 22 33 y(n)

8 Solution to example_1 The solution lies in multiplying two polynomials: [a 0 x 0 + a 1 x 1 +……+a n-1 x n-1 ].[b o x o + b 1 x 1 +……..b m-1 x m-1 ]. The result is evaluated by tabular calculations of: [a o a 1 a 2 a 3 ] x [b o b 1 b 2 ] =a o b 2 a 1 b 2 a 2 b 2 a 3 b 2 a o b 1 a 1 b 1 a 2 b 1 a 3 b 1 x a o b o a 1 b o a 2 b o a 3 b o x x ___________________________________________ c o x o + c 1 x 1 + c 2 x 2 +c 3 x 3 + c 4 x 4 + c 5 x 5 has {m+n-1} terms and power {m+n-2}. This procedure of multiplication is termed as Linear Convolution or, Convolution.

9 Method_1 to Solution of Example_1 [3.2 41 36 -9.6 0] x [1 2 3 2 ].  6.4 82 72 -19.20 9.6 123 108-28.8 0x 6.4 82 72 -19.2 0 xx 3.2 41 36 -9.6 0 x xx _____________________________________ [ 3.2 47.4 127.6 191.8 170.8 43.2 -19.2 0 ]  y[n] = 3.2x[n] + 47.4x[n-1] + 127.6x[n-2] + 191.8x[n-3] + 170.8x[n-4] + 43.2x[n-5] - 19.2x[n-6]

10 Method_2 to Solution of Example_1 Alternative procedure is using the table 3.2 41 36 -9.60 13.2 41 36 -9.60 26.4 82 72 -19.20 39.6123108 -28.80 26.48272 -19.20

11 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 (p x q) “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 next column of the circulant matrix by pasting the previous one to right after shifting all the elements circularly one down.

12 Creating Toeplitz or Circulant matrix for linear convolution  Continue the procedure till a (pxq) matrix is constituted.  Likewise make another matrix M 2 = (qX1) from the coefficients of another polynomial.  Multiply [M 1 ] & [M 2 ] to get [M ]; a (p x 1) matrix.  The transpose of the result is the convolution.  note: You can set to (pxp) (px1) matrix also as defined in some literature.

13 Method_3 for Example_1  P= M+N-1 = 5 + 4 -1= 8.  One matrix is [8x4] another  matrix is [4x1] Linear convolution Transposed

14 A general structure of a Digital filter y[n] + a 1 y[n-1] + a 2 y[n-2] = b o x[n] + b 1 x[n-1] + b 2 x[n-2] b0b0 y[n] y[n-1] y[n-2] -a 1 -a 2 D D D D b1b1 b2b2 x[n-2] x[n-1] x[n]

15 Transfer function: z-transform y[n] + a 1 y[n-1] + a 2 y[n-2] = b o x[n] + b 1 x[n-1] + b 2 x[n-2] If all the components are linear and time invariant, the above equation can be expressed as: The transfer function h[n] is given by: y[n] / x[n] = h[n] = [ b o + b 1 D + b 2 D 2 ] / [1+ a 1 D + a 2 D 2 ]. In Discrete time systems, we replace D by z -1, H[z] = [ b o + b 1 z -1 + b 2 z -2 ] / [1+ a z -1 + a 2 z -2 ] [1+ a 1 D + a 2 D 2 ] y[n] = [ b o + b 1 D + b 2 D 2 ] x[n]

16 Transfer function…  In time domain, the resulting transfer function of cascaded block is the convolution of transfer functions of each block. h[n] = h 1 [n] * h 2 [n]. * is the sign of convolution.  In Z-domain; H[z] = H 1 [z] H 2 [z]…. h 1 [n] h 2 [n] h 1 [n] h 1 [n] * h 2 [n] * x[n] y[n] x[n] y[n]

17 Transfer function… The transfer function of blocks connected in parallel is given by the their sum. h[n] = h 1 [n] + h 2 [n]+…. H[z] = H 1 [z] + H 2 [z] +… h 1 [n] + h 2 [n] h 1 [n] h 2 [n] x[n]y[n]x[n] y[n]

18 Transfer function…..  h[n] = h 1 [n] + h 2 [n] * {h 3 [n] + h 4 [n]} = h 1 [n] + h 2 [n]*h 3 [n] + h 2 [n]*h 4 [n]  H[z] = H 1 [z] + H 2 [z]H 3 [z] + H 2 [z]H 4 [z] h 1 [n] h 2 [n] h 3 [n] h 4 [n] x[n] y[n]

19 Inverse Transfer Function The transfer functions h 1 [n] and h 2 [n] or, H 1 [z] and H 2 [z] if observe the rule: h 1 [n] * h 2 [n] =  [n], or, H 1 [z] H 2 [z] = 1 are inverse of each other.

20 Inverse convolution  Inverse transfer function are used when output y[n] and TF h[n] are known and x[n], the input is be obtained.  It is obtained by dividing polynomial y[n] by the polynomial h[n].  This process is called inverse convolution.

21 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.

22 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: [4,4,9,14, 12,19,17, 12,19,17, 13,8,10,3].

23 The system can also be periodic Z -1 + + x[n]     y[n] Feedback makes it periodic

24 The number of delays are three  Therefore the system periodicity; N=3.  Solve for h[n] = [          Inputs: a. x 1 [n] = [ 1 2 3 ] b. x 2 [n] = [1 2 3 4 ] c. x 3 [n] = [1 2 3 4 5]

25 We illustrate the case with x 3 (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.

26 Convolution with periodic input using wrap around method: The linear convolution of the given problem is: [4, 4, 9, 10, 8, 10, 3]. 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. [ 4 4 9 10 8 10 3 ] The result is [17 12 19] The output is in the sequence of 17, 12, 19, 17, 12, 19,17, 12,19,17……… In an steady-state sequence, first term is unimportant. Sequence should be maintained.

27 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]

28 Solution by circulant matrix  Since the periodicity is 4, The size of the circulant matrix has to be (4x4) and that of vector matrix: (4x1).  Additional element in vector matrix is padded to a zero at the beginning or, end.  Since x[n] made circulant matrix and h[n] as vector matrix after padding one zero in the end.  With padding zero in the beginning, result will be [31,12,34,11]

29 Solution by circulant matrix  h[n] can be made a (4x4) circulant matrix by padding a zeroes.  x[n] can be a column matrix.. Zero padded in the circulant matrix of h[n]

30 Example Workout the linear convolution of x[n] =[2 5 0 4 ] and h[n] =[4 1 3]. h[n] is periodic of periodicity N = 3. 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] = 3. It is [8 22 11 + 31 4 12] = [39 26 23]

31 The circulant matrix in this case: 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.

32 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.

33 Solution_1 of periodic convolution Convention for circular convolution  [1 0 1 1]  [1 2 3 1] = [1 2 4 4 5 4 1]. The length of the string is (2N-1)= 7. The length of periodic signal is 4. [ 1 2 4 4 + 5 4 1 0] [ 6 6 5 4 ] ans.

34 Solution_2 for periodic convolution a matrix approach Any one of the periodic sequence is made circulating matrix.

35 Deconvolution  It is the process to evaluate x(t) for the given when y(t) and h(t).  The mathematical description for convolution is: i.e. y(n) = h(0)x(n) + h(1)x(n-1) + … + h(n)x(0)  The above can be rewritten for n  1 as:

36 Deconvolution:  ence

37 Now we shall learn about the correlation function, and shall differentiate between correlation and convolution processes and shall lay stress on CORRELATION

38 Correlation  Provides the measure of similarity or coherence between two functions at a given lag of time.  If the two function originate from one single function, it is called auto-correlation.  If they originate independently, the measure is called cross-correlation.

39 CONVOLUTION & CORRELATION basic mathematical model. Let x(t) and h(t) be the two real TIME functions, The convolution integral of the two aperiodic functions, y(t) = x(t)*h(t) is: While the correlation R xh (t) = x(t)  y(t) is given by the equation : The difference is: in correlation, the time function is not reversed. And that, R xh (t) represent energy/power. Then, does y(t) also represent energy?

40 Convolution & Correlation The two signals are real. If one or both of the functions are symmetrical, it results into symmetrical nature of the integration curve. The length of the time-duration after integration is also the same. The area under the curve of two integrals one due to convolution and other due to correlation is same. Their nature is not same.

41 Convolution & Correlation  Each of the two functions, x(t) and h(t) may be represented by power series.  Multiplication of them yields convolution.  While multiplication of one series reversed yields Correlation.

42 Convolution & Correlation  In convolution, x(t) and h(t) are real time functions.  In correlation, x(t) and h(t) can be complex functions. In case both functions are complex conjugate, one of them is conjugated.  Convolutions can be had for the functions in domains other than time.  Correlation is meaningful exclusively in time domain.  Correlation is a special case of convolution with one function time reversed.

43 Auto and Cross correlations  If the functions originate from the same source, the resulting summation or, integration is termed as Auto Correlation.  Should they belong to different independent sources, the resulting summation or, integration is Cross- correlation.  The signals can be power (periodic) signal or energy (aperiodic) signal.

44 Correlation of Periodic signals  If x(t) and h(t) are periodic, the correlation represents power and is worked out to be: The integral at different time delay , represent the power developed by the two signals at that delay. If the signals are aperiodic, the above integral, with the term 1/T set to 1, would represent energy

45 Properties of Correlation functions  R xh (t) represent power and power is always real, a scalar quantity.  It has R xh (t)= R hx (-t) symmetry.  In auto-correlation, since x=h, is inherently an even symmetric.  Its maximum value rests at t=0.  In general R xh (t)  R hx (t), does not commutate.  It has maximum value at t=0. Therefore  R xh (  )   R xh (0).

46 More Properties  If x(t) and h(t) are periodic, then R xh (t) is also periodic.  R xx (t) R hh (t)>  R xh (t)  2.  Since arithmetic mean  geometric mean, [R xx (t) + R hh (t)]/2   R xx (t) R hh (t) and also   R xh (t) 

47 Properties of correlations  The Fourier Transform of correlation function is called power spectral density PSD; V 2 /Hz..  When x(t) and h(t) are statistically independent random processes, then R xh (t) = R hx (t) and,  with zero mean, they follow the rule of orthogonal functions,  R xh (t) = R hx (t) = 0.  That is, resultant output power in the duration of composite periodicity is zero.  It is the effective way of matching two functions. Here we match x(t) with delayed version of y(t).

48 Example: To work out convolution and correlation of the sequences: x 1 [n]=[1 2 3 4] and x 2 [n]=[0 1 2 3] Convolution: x 1 [n]*x 2 [n] =x 2 [n]*x 1 [n] = [0 1 4 10 16 17 12] Area= sum of all numbers=60. Cross Correlation: X 2 [n]**x 1 [n] = conv. X 2 [n]*x 1 [-n] = [0 1 2 3]* [4 3 2 1] = [0 4 11 20 14 8 3] Area = sum of all numbers = 60. unlike in convolution: X 2 [n]**x 1 [n]  x 1 [n]**x 2 [n]. = [3 8 14 20 11 4 0] The sequence is reversed !!

49 Cross correlation  should have same length. Or, append zero The sequences.  The sequence can be represented as even and odd part.  The maximum of even function is always at center of the sequence, denoted as n=0.

50 Even and Odd sequences of correlation function  The correlation function is: z[n] = [1 4 11 20 14 8 3]  z[-n]= [3 8 14 20 11 4 1]  Even sequence: {z[n] +z[-n]}/2  Odd sequence: {z[n]-z[-n]}/2  Z ev [n] = [2 6 12.5 20 12.5 6 2]  Z odd [n]= [-1 -2 -1.5 0 1.5 2 1]  Even function is symmetrical about center.  Even function has maximum at Center.  Sum is that of original sequence.  odd function is skew symmetrical (mirror image) about center and its value is zero.  Sum of odd function sequence is zero.

51 Autocorrelation  Auto correlation is the correlation of a sequence with itself.  Let the sequence be: x[n] [1 2 3 4]  It’s autocorrelation is = x[n]**x[n]= [1 2 3 4][4 3 2 1] = [4 11 20 40 20 11 4] always symmetrical and maximum at center.

52 Correlation and Regression s/ncorrelationregression 01Karl Pearson Method  xy = [b yx b xy ] 1/2 B xy = cov(x,y)/var(x); y on x. B yx = cov(x,y)/var(y); x on y. 02Standard error of estimate: S yx =  y  [1-  xy 2 ] and S yx /S xy =  y /  x  var(x) =  x,  var(y) =  y. 03Coefficients of correlation provides the degree of relationship between variables. Coefficient of regression provides the nature of relationship between the variables. 04It does not employ cause-effect relationship, the transfer function. It does imply the cause-effect relationship, that is, transfer function 05Relationship may be arbitrary.Relationship is founded. 06Coefficient is independent of: (a) origin and (b) the scale. Coefficient is independent of : (a) origin but not (b) the scale. 07Prediction is not possible.Prediction is possible.


Download ppt "EKT430/4 DIGITAL SIGNAL PROCESSING 2007/2008 CHAPTER 2 DISCRETE TIME SIGNAL AND SYSTEMS."

Similar presentations


Ads by Google