Page 194 -
P. 194

in the integration subroutine should ideally be determined using the shortest
                             of the periods present in the integrand.


                             Application 2
                             As mentioned earlier, the Transfer Function technique is the prime tool for
                             the analysis and design of digital filters. In this and the following application,
                             we illustrate its use in the design of a low-pass digital filter and a digital pro-
                             totype bandpass filter.
                              The low-pass filter, as its name indicates, filters out the high-frequency
                             components from a signal.
                              Its defining difference equation is given by:


                                                   yk() =  ( −1  a y k) ( − 1 ) +  au k()  (6.112)

                             giving for its Transfer Function the expression:


                                                      Hz() =     a                        (6.113)
                                                            1 −  ( −1  az)  −1

                             Written as a function of the normalized frequency, it is given by:


                                                         jΩ     ae  jΩ
                                                      He(  ) =  jΩ                        (6.114)
                                                             e  −  ( −1  a)

                             We plot, in Figure 6.4, the magnitude and the phase of the transfer function
                             as a function of the normalized frequency for the value of a = 0.1. Note that
                             the gain is equal to 1 for Ω = 0, and decreases monotonically thereafter.
                              To appreciate the operation of this filter, consider a sinusoidal signal that has
                             been contaminated by the addition of noise. We can simulate the noise by add-
                             ing to the original signal an array consisting of random numbers with maxi-
                             mum amplitude equal to 20% of the original signal. The top panel of Figure
                             6.5 represents the contaminated signal. If we pass this signal through a low-
                             pass filter, the lower panel of Figure 6.5 shows the outputted filtered signal.
                              As can be observed, the noise, which is a high-frequency signal, has been
                             filtered out and the signal shape has been almost restored to its original shape
                             before that noise was added.
                              The following script M-file simulates the above operations:

                                t=linspace(0,4*pi,300);
                                N=length(t);
                                s=sin(t);
                                n=0.3*rand(1,N);
                                u=s+n;


                             © 2001 by CRC Press LLC
   189   190   191   192   193   194   195   196   197   198   199