 Welcome to the 30th lecture on the subject of digital signal processing and its applications. We are now at a position where we have seen some approaches to discrete time filter design. Let us take a minute or two to recapitulate. We have seen the design of IR filters where we have essentially taken advantage of the known methods in analog filter design. So what we did there was to use the known designs like the Butterworth design, the Chebyshev design and of course we did not talk about it but one could also use the Jacobi or the elliptic design. And then a generic transformation that converts the S variable to the Z variable called the bilinear transformation can then be employed. We have seen what properties that transformation needs to satisfy and therefore we evolved the whole process of design by taking advantage of known analog designs. Now what we really did was to design low pass filters. We designed analog low pass filters and then we evolved what is called a frequency transformation in the analog domain to design other kinds of analog filters. Now we then saw that there is one important limitation of analog filters namely that they can never give linear phase. To demand linear phase we then need to move to finite impulse response filter design and we did that. In the approaches there are several different approaches that can be used to finite impulse response or FIR filter design. However, we have looked at one of the approaches which is in some sense the simplest namely the approach based on windows. What we do in a windowing approach is essentially as the name suggests. By the way at this point it is a good idea to take stock of the meaning of the word window in this context or why the word window is used. A window as we understand it in common conversation, common parlance means an opening to the external world against the wall. So you know if there were no wall then the entire scenery outside will be visible but because we have walls that separate us from the outside world in a residence we also provide windows which give us a limited view of the scenery outside. Now window can also be shaped or it can be tinted, the glass on a window can be tinted and if we use such tinted or colored glasses on the window then the scene outside is appropriately modified perhaps to our liking or may not be to our liking whatever it be. Now the same principle has been applied in this FIR filter design context. What we have done here is to use the window which shows us a part of the impulse response not the entire impulse response and it also modifies the impulse response in a manner that we wish or in a manner that we find advantageous. So this is the explanation of the word window. We have seen different windows for FIR filter design last time. In fact we have come to the conclusion that there is a basic conflict that we can never quite resolve but we can optimize the conflict between the main lobe width and the relative side lobe area and the main lobe width contributes to transition bandwidth, the relative side lobe area to the maximum deviation in the pass span and the stop span. Among the windows the optimal window so to speak is what is called the Kaiser window named after the mathematician who proposed that window. The Kaiser window has the ability to change both shape and length unlike other windows where the shape is fixed but the length can change. Changing the length would in general reduce the transition bandwidth according to a certain rate of fall off. Different windows have a different rate of fall off for the transition bandwidth as a function of length. But no matter how large you make the window you can never do away with the pass span and stop span tolerance and for a given window shape that tolerance reaches an asymptotic limit. An asymptotic limit can only be changed if we change the window shape and that is by the Kaiser window which is optimal in the sense of you know the kind of transition bandwidth that you get and the kind of tolerance that you get for a given shape. Now we also saw finally that one could always associate a given shape with a tolerance. So you know once you have a tolerance then you can find out the Kaiser window parameter corresponding the Kaiser window shape parameter corresponding to the tolerance and for that shape parameter you would have a certain way in which the transition bandwidth changes with length and the Kaiser window always does better than the corresponding window of known shape which gives the same pass span and stop span tolerance. So these are some of the things that we discussed in the previous lecture and now we are quite well equipped to complete a design on FIR filters using windows. Now one important observation here is that all our discussion is relevant when the filters that we are trying to design are piecewise constant. In fact all the discussion about pass span tolerance, stop span tolerance and so on and transition band are meaningful when there are piecewise constant responses which we are trying to realize. Of course all the standard responses that we try to realize are indeed piecewise constant. But let me now give you an example of a system that we sometimes want to realize but which is not piecewise constant in its magnitude response. So an example of a non-piecewise constant and the simplest example is what is called a differentiator or a band limited differentiator to be more precise. So you see a differentiator is described in continuous time by y t is equal to d x t d t where x t is the input and y t the output. In the frequency domain this translates now incidentally a differentiator is a linear shift invariant system. The only problem is it is not stable that is very easy to see all that we need to do is to give x t is equal to sin of t squared to the system. Obviously this input is bounded and the output then turns out to be 2 t cos t squared which is unbounded bounded input leading to unbounded output and therefore the system is not stable. However we can associate with it a frequency response meaning we can say what happens in general when we give a sinusoidal input. So the beauty is now this is a beautiful illustration where you can have a response a bounded response to a sinusoidal input and therefore you can talk about a frequency response but you cannot quite you know you cannot immediately conclude a system is stable. So having a frequency response does not necessarily mean the system is stable that is because if the output might be bounded for given sinusoidal inputs but it may not be bounded for all bounded inputs. And indeed if we do happen to give it the complex exponential if x t happens to be the complex exponential e raised to the power j omega t then y t clearly becomes j omega e raised to the power j omega t and therefore the frequency response of the differentiator is j omega. So in spite of the system being unstable it does have a frequency response and of course the physical meaning of this is that the magnitude varies linearly as a function of omega and the phase is plus pi by 2 when omega is positive and minus pi by 2 when omega is negative. So in fact we can draw the magnitude in phase response. So the magnitude is linear mod omega is the magnitude and the phase response is equally easy to draw. The phase response is plus pi by 2 for omega greater than 0 and minus pi by 2 for omega less than 0 that is easy to see. Incidentally if we dissociate this magnitude response but retain this phase response that means we keep this phase response but make the magnitude response different. We make it one everywhere. A system which has a magnitude response of one everywhere but this phase response is called a Hilbert transformer. This phase response with a unit magnitude response is called the Hilbert transformer. The physical significance of a Hilbert transformer is that it adds a phase of pi by 2 or a phase of 90 degrees independent of frequency. So in a way in informal language you could say it converts cosine to sine or sine to cosine. I mentioned the Hilbert transformer because it is very useful in communication. The idea of a Hilbert transformer has been employed in understanding analog communication particularly amplitude modulation and some people use it indirectly in phase modulation too. Anyway that was a point besides. But you see the reason why I mentioned these is that one can of course find the ideal impulse response of a band limited differentiator. So now you could restrict this differentiator to operate only between 0 and half the sampling frequency. So you could then describe on the normalized angular frequency axis. We could describe a system, an LSI system with frequency response. We will use small omega to denote the normalized angular frequency axis. An LSI system with frequency response h of omega given by j omega. Of course omega between minus pi and pi is called a digitally differentiator or discrete time differentiator. And this is an example of a non-piece wise constant frequency response which is useful. What is the physical significance of a digitally differentiator? It essentially differentiates the underlying continuous signal and then we assume that we have sampled that signal which has been differentiated. So you could think of the discrete sequence which came from a band limited sequence. There is an underlying continuous signal there. The underlying continuous signal has been differentiated with respect to time and it has then been re-sampled at the same points. That is the physical interpretation of the action of a differentiator, digital differentiator. Now the digital differentiator as I said is an example of a system which is not piece wise constant in its magnitude response. And therefore we could in principle do the same thing that we did in windowing. Namely we could find the ideal impulse response. In fact let me give this to you as an exercise. Exercise obtain the ideal impulse response of a digital differentiator. That is very easy to do. Find the inverse DTFT essentially. Is it a stable system? Explain. Well if we take a queue from the analog domain then we kind of expect the answer to be no. But we should find out independently in the discrete domain. It is not obvious that it should be unstable in the discrete domain. But perhaps we do expect that because it was unstable in the analog case. But one should you know investigate independently. Third, truncate this to minus n to plus n for different n. Study the frequency response. This would have to be done with some software. So the question is what you what you explain? It says no easy answer. We do not know what will happen when you truncate this between minus n and plus n and find the frequency response. It is not going to be easy to explain. Of course you can you can you can say how to find the you can find it by convolving this ideal impulse the ideal frequency response with the window spectrum. But what that convolution will yield is not easy to say. Because here we cannot use the argument of main loop coming in and going out and so on. There is no ideal pass path. But it should therefore be interesting to see what happens. And this is left to you as an exercise to study with. Anyway it turns out I mean I might give you just a part of the answer. It turns out that good windows quote unquote good windows do work reasonably well even for such responses though it is more difficult to explain why they do. So that is one observation. You know the good thing about FIR filter design the way we have studied FIR filter design based on window functions is that you can also use it to design non-piece wise constant responses and of course leave the actual degraded response to nature. So you cannot say too much about how the response will get degraded. But experience shows that it is acceptable. And therefore unlike the unlock filter design approaches which you cannot use for non-piece wise constant responses the discrete the FIR filter design approach can be used for non-piece wise constant responses. So the bilinear transform for example cannot be employed for non-piece wise constant responses.