Lecture-3:
Review of required digital signal processing
                          Convolution
Convolution is one of the most frequently used operations
in DSP. Specially in digital filtering applications where two
finite and causal sequences x[n] and h[n] of lengths N1
and N2 are convolved
                                            
   y[n] = h[n]  x[n] =    h[k ]x[n − k ] =  h[k ]x[n − k ]
                          k = −            k =0
      Operations involved
   Folding
   Shifting
   Multiplication
   Summation
                        ES & BM   Signal Processing   3
                       
           y (t ) =
                      
                        x( )h(t −  )
                       = −
h()
       
x()
       
y(t)
       t
                               
                   y (t ) =
                              
                                x( )h(t −  )
                               = −
           h(-)
    x()
              
    y(t)
              t
                                     
                         y (t ) =
                                    
                                      x( )h(t − )
                                     = −
           h(t-), t=0
    x()
              
    y(t)
              t
                                   
                         y(t) =    x( )h(t −  )
                                   =−
                   h(t-), t=1
               
       
x()
           
y(t)
           t
                             
                   y(t) =    x( )h(t −  )
                             =−
                     h(t-),t=2
           
               
x()
       
y(t)
       t
                         
               y(t) =    x( )h(t −  )
                         =−
                                    h(t-),t=5
           
                           
x()
       
y(t)
       t
       Example convolutions
                                
    f *g=    f ( )g(t −  ) =  g( ) f (t −  )
             =−                =−
     The sum of the product of 2 functions after 1
                is reversed & shifted.
       Convolution of two rectangles
                        http://mathworld.wolfram.com/Convolution
       Example convolutions
                                
    f *g=    f ( )g(t −  ) =  g( ) f (t −  )
             =−                =−
     The sum of the product of 2 functions after 1 is
                  reversed & shifted.
        Convolution of two Gaussians
h(n)={2,1,-3,0}      x(n)={1,2,3,0}
                  INTRODUCTION TO DIGITAL SPEECH PROCESSING (ET60007)   © CET, IIT KGP
            Circular convolution
•Circular convolution of x(n) and h(n) is defined as
the convolution of h(n) with a periodic signal xp(n) :
                 y p ( n) = x p ( n)  h( n)
                       N −1
             y p (n) =  h(n) x((m − n)) N
                       n =0
             m = 0,1,.......N − 1
where
 x p (n) = x(n mod N ),                −  n  
                     Introduction
   Correlation is a mathematical operation that is
    very similar to convolution. Just as with
    convolution, correlation uses two signals to
    produce a third signal. This third signal is called
    the cross-correlation of the two input signals. If
    a signal is correlated with itself, the resulting
    signal is instead called the autocorrelation.
                                      ES & BM   Signal Processing   14
   Autocorrelation
    ◦ Correlating a signal with itself
                    The problem
   Given a signal of some known shape, what is
    the best way to determine where (or if) the
    signal occurs in another signal..?? Correlation
    is the answer.
                                   ES & BM   Signal Processing   16
                          Correlation
               
rxy (l ) =    x ( n) y ( n − l )
             n = −
                                            l = 0,1,2,...
               
rxy (l ) =    x ( n + l ) y ( n)
             n = −
                                            l = 0,1,2,...
         Where, rxy(l) is the correlation coefficients
   Autocorrelation can be used to extract a signal
    from noise
          Cross correlation to locate signal
   Cross correlation can be used to detect and
    locate known reference signal in noise
             Convolution vs. correlation
❑ Convolution is the relationship between a system's input
  signal, output signal, and impulse response.
❑ Correlation is a way to detect a known waveform in a noisy
  background.
❑ The similar mathematics is only a convenient coincidence.
                                                               20
y(n)=-a1y(n-1)+b0x(n)+b1x(n-1)
      v(n)=b0x(n)+b1x(n-1)
      y(n)=-a1y(n-1)+v(n)
                  INTRODUCTION TO DIGITAL SPEECH PROCESSING (ET60007)   © CET, IIT KGP
                    Direct Form I
   Transfer function of recursive LTI system
                             N              M
                   yn = − ak yn − k  +  bk xn − k 
                             k =1           k =0
            M
     vn =  bk xn − k                                                    N
            k =0                                            wn = − ak wn − k  + x(n)
             N                                                           k =1
     yn =  ak yn − k  + vn                                            M
            k =1                                             yn =  bk wn − k 
                                                                         k =0
                                                                                 Copyright (C) 2005 Güner
                                            351M Digital Signal Processing       Arslan                     22
Direct Form I
                23
                                 Copyright (C) 2005 Güner
351M Digital Signal Processing   Arslan                     24
Frequency-Domain Representation of Discrete
         Signals and LTI Systems
   x(n) = e jn            LTI system                      y ( n)
 complex-valued                      h( n)             LTI system output
exponencial signal
                          impulse response
                                 
                     y ( n) =    h( k ) x ( n − k )
                                k =−
                                                                           25
LTI system output:
                                      
y ( n) =    h( k ) x ( n − k ) =
           k =−
                                      h (
                                     k =−
                                           k ) e j ( n − k )
                                                              =
                                              
      =     h (
           k =−
                 k ) e − j k j n
                             e     = e j n
                                               h (
                                              k =−
                                                    k ) e − j k
y (n) = e jn H (e j )
                                                
Frequency response:           H (e j ) =       h
                                              k =−
                                                   ( k ) e − j k
                                                                    26
H (e j ) = H (e j ) e j ( )
H (e j ) = Re  H (e j )  + j Im  H (e j ) 
              
                              
                                             
H (e ) =  h(k )cos k + j  −  h(k )sin k 
    j
         k =−              k =−           
                        
Re  H (e j )  =    h(k )cosk
                       k =−
                            
Im  H (e j )  = −  h(k )sin k
                        k =−
                                                        27
 Magnitude response:
      j                  j   2                  j    2
H (e ) = Re  H (e )  + Im  H (e ) 
 Phase response:
                                       Im  H (e j ) 
 ( ) = arg  H (e j )  = arctg            j
                                          
                                       Re  H (e ) 
 Group delay function:
           d ( )
 ( ) = −
            d
                                                            28
  Comments on relationship between the impulse response and
                     frequency response
The important property of the frequency response
                                            
  H (e j ) =       
                k =−
                      h ( k ) e − j k
                                       =     h ( k )e
                                            k =−
                                                         − j + 2 l 
                                                                          = H (e
                                                                                   j + 2 l 
                                                                                                  )
is fact that this function is periodic with period 2  .
In fact, we may view the previous expression as the exponential
                                   j
Fourier series expansion for H (e ) , with h(k) as the Fourier series
coefficients. Consequently, the unit impulse response h(k) is related
         j
to H (e ) through the integral expression
                
         1
h( n) =
        2   −
                   H (e j  )e j  n d
                                                                                                      29
           Comments on symmetry properties
For LTI systems with real-valued impulse response, the magnitude response,
phase responses, the real component of and the imaginary component of
   H (e j )   possess these symmetry properties:
The real component: even function of      periodic with period 2 
                  Re  H (e − j )  = Re  H (e j ) 
The imaginary component: odd function of          periodic with period   2
                   Im  H (e − j )  = − Im  H (e j ) 
                                                                               30
The magnitude response: even function of   periodic with period 2                2
                            H (e j ) = H (e − j )
The phase response: odd function of         periodic with period    2
                     arg  H (e − j )  = − arg  H (e j ) 
Consequence:
                  H  (j
                       e )     ( )
If we known              and         for 0    ,        we can describe these
functions ( i.e. also H (e j ) ) for all values of  .
                                                                                    31
  Symmetry               H (e j )        EVEN
  Properties
                                                   
−4 −3   −2   −   0              2   3     4
                                           OD
                      ( )
                                            D
                                                   
−4 −3   −2   −   0              2   3     4
                                                       32
                            Normalized Frequency
It is often desirable to express the frequency response of an LTI system
in terms of units of frequency that involve sampling interval T. In this
case, the expressions:
                                                       
             
                                                1
     j
H (e ) =     h ( k )e
            k =−
                           − j k
                                       h( n) =
                                               2         H (e j  )e j  n d
                                                      −
are modified to the form:
                                         
                    H (e   j T
                                  )=     h(kT )e
                                       k =−
                                                       − j kT
                                        /T
                          T
                 h(nT ) =
                          2           
                                    − /T
                                              H (e jT )e jnT d
                                                                                   33
      j T is periodic with period 2  / T = 2 F, where F   is
H ( e     )
sampling frequency.
Solution: normalized frequency approach:   F /2 → 
 Example:
 F = 100 kHz       F / 2 = 50 kHz      50kHz → 
                          20 x103     2
 f1 = 20 kHz         1 =        3
                                   =    = 0.4 
                          50 x10       5
                          25 x103     
  f 2 = 25kHz        2 =        3
                                    = = 0.5 
                          50 x10      2
                                                                  34
                             Z -Transform
Definition: The Z – transform of a discrete-time signal x(n) is
defined as the power series:
             
                                   X ( z ) = Z [ x(n)]
 X ( z) =    x (n) z
            k =−
                        −k
where z is a complex variable. The above given relations
are sometimes called the direct Z - transform because
they transform the time-domain signal x(n) into its complex-
plane representation X(z).
Since Z – transform is an infinite power series, it exists only
for those values of z for which this series converges. The
region of convergence of X(z) is the set of all values of z for
which X(z) attains a finite value.
                                                                  35
The procedure for transforming from z – domain to the time-
domain is called the inverse Z – transform. It can be shown
that the inverse Z – transform is given by
                1
     xn =           X ( z ) z n −1
                                        x(n) = Z −1  X ( z )
              j 2   c
where C denotes the closed contour in the region of
convergence of X(z) that encircles the origin.
                                                                 36