 Welcome to the 19th lecture on the subject of digital signal processing and its applications. Let us take a few minutes to recapitulate what we did in the previous lecture. In the previous lecture, we had begun discussing the synthesis of discrete time systems. In fact, the synthesis of digital filters. We had looked at the ideal filters, the four ideal filters that we most commonly encounter. Namely, the ideal low pass filter, the ideal high pass filter, band pass filter and band stop filter. I had taken the specific instance of the ideal low pass filter and we had looked at the impulse response of the ideal low pass filter. From the impulse response, we had drawn 3, in fact, from the frequency response, the ideal frequency response and from the impulse response we had drawn 3 conclusions. The first one was that the filter was of course non-causal. But unfortunately, it could not even be made causal if we allowed a delay, a finite delay. So by introducing a finite delay, we could not make the filter causal because the number of non-zero samples on the negative side of n was infinite. So you see if it were finite, if you have a finite number of negative samples or samples on negative n, then you can take the farthest back sample. So for example, suppose you have samples which are non-zero for negative n all the way from n going from 0 to n going to minus 20. You can introduce a delay of 20 samples and make the filter causal. So if you have a finite number of non-zero samples on the negative side, it is always possible to make the filter causal even if it is non-causal to begin with. Unfortunately, that is not the case with the ideal filter. Secondly, we noted that the ideal filter was unstable. We took the specific example of omega c equal to pi by 2. But I encourage you to take other examples of omega c as well. So you could look at omega c equal to pi by 4 if you like or 3 pi by 4 or some other values. And convince yourself that in each of these cases, the filter would become unstable. In fact, I put it before you as a challenge to show that for general omega c, this filter is unstable. That is a bit of a more demanding challenge. We had shown it for the specific case of omega c equal to pi by 2. But show it more generally for any omega c between 0 and pi that the filter is unstable. Essentially, you will need to show that the filter impulse response is non-summable, non-absolutely summable. Thirdly, we noted that the ideal filter was irrational and that was because we could not have a continuum of zeros in the frequency response if the filter were rational. Now of course, some people like to talk about what is called the Paley-Wiener criterion. You know, personally at this stage, I think it is adequate to note that for a rational function, you cannot have a continuum of zeros as we do in the ideal filter. And in fact, because the ideal filter is irrational, we are now left with the trouble that it is unrealizable. So, in all these counts, the filter is describable, but not realizable. Describable means you could put down an impulse response for it. You could describe what it does, but you can never realize it. What we wish to do in the process of filter design is to realize meaningful specifications. We said that yesterday. If we put down the specifications as we did yesterday, for example, for the ideal low pass filter or for that matter for the other kinds of filters as well, we are not in a position to ever meet those specifications with any rational system. So, one task that we have before us today is to put down realizable specifications. And the second task, not just today but onwards from now is to evolve a procedure to meet the specs. We shall in future abbreviate specifications by specs. So, we would need to evolve a procedure to meet the specifications. Before we go on to discussing meaningful specifications, we must complete one little detail. And that is, we saw the ideal impulse response of the low pass filter, but we did not really look at the ideal impulse response of the other three kinds of filters. Let us spend a minute in writing down a process which will take us from the low pass to the other kinds of filters. So, in fact, that is very easy. If we look for example at the band pass filter, its ideal response is between omega c 1 and omega c 2 and of course its mirror image on the other side minus omega c 1 to minus omega c 2. And it is very easy to see that this can be construed to be a filter which emerges from two low pass filters, one with a cut off at omega c 2 and the other with a cut off at omega c 1. So, essentially a band pass filter is an ideal low pass filter with a cut off at omega c 2 minus an ideal low pass filter with a cut off at omega c 1. Now the discrete time Fourier transform and the inverse discrete time Fourier transform are both linear operators and therefore, if we have this relationship between the frequency responses the same relationship would carry over to the inverse discrete time Fourier transform. So, therefore, one can compute the ideal impulse response of the band pass filter by using a combination of two impulse responses. Now, I leave it to you as an exercise to do the same for the other two ideal filters. This is a similar approach for the high pass and band stop filters. Essentially the approach involves invoking the linearity of the discrete time Fourier transform and the inverse discrete time Fourier transform. So, with that then we are in a position to compute all the ideal responses, but as we have noted none of them is going to be realizable. Now of course, I have not shown it for each case, but I leave it to you as an exercise to generalize this for the other cases. In fact, you could take a band pass filter for example, with a cut off between pi by 4 and 3 pi by 4 if you like and then see what happens to it. Is it stable or not stable and in fact, you will find that all of them are unstable and unrealizable. Anyway, now let us get down to business by putting down specifications that we can actually realize. So, we need to understand what we need to compromise from the ideal. There are three things that we need to compromise from the ideal. You see that part now you notice in all the ideal responses that we have taken here the responses the frequency responses are piecewise constant. In fact, we explained what piecewise constant means, but it is more than just piecewise constant. In fact, you can classify them as some regions which you want to pass and some regions that you want to stop. So, it is more specific than piecewise constant. You can also have piecewise constant responses where different parts of the frequency axis have different non-zero magnitudes that is also possible that is more general, but we are not looking at that case here. We are looking at a case where each band either carries a one response on it or a zero response on it. So, therefore, we have the notion of pass bands where the ideal magnitude is 1. So, in the pass band you are trying to make the ideal response ideal magnitude response equal to 1. And in the stop band you are trying to make the ideal magnitude response equal to 0. And these are the only two kinds of bands that we have in the filters that we have seen. So, the first compromise that we need to effect is that we cannot have the magnitude response 1 of that matter constant either in the pass band or in the stop band. If we wish that the filter be rational. Now again a minute thought will convince us why this is so. Suppose indeed the response were constant in the pass band. It is very easy to see that if you have a rational system which gives you a constant value all over a continuum of the independent variable. Then if you subtract 1 from that, let that constant value be 1 without any loss of generality. It could be any constant does not matter. If you subtract that constant from the rational function the resultant function must be rational. A constant is a rational function. The difference of two rational functions is always rational. So, you have here a rational function which then becomes 0 over a continuum and you run the same problem you run into a contradiction. So, either the rational function is really 0 which of course is totally useless or there is a contradiction. You could not have had a rational function in the first place which is constant all over a band. So, the very idea of being constant over a band is alien to rational functions. Therefore, the first compromise that we must live with being constant valued over a band is alien to rational functions except trivially. By trivially I mean the rational function itself is a constant then of course it is of no use at all. Is that correct? Therefore, we have to compromise there. We cannot insist that the rational function be constant over a band. And therefore, our first compromise is that pass band and stop band must have a tolerance. By tolerance we mean that the magnitude response is allowed to vary in a certain region. We cannot insist that it be a constant. Now the other thing that disqualifies the ideal filter is the discontinuity. In fact, I briefly remarked about this in the previous lecture. I put it as a challenge before you to show that the fact that you have a discontinuity is the cause of instability. It is a challenging problem not at all simple to solve. Anyway, the discontinuity is the trouble in the ideal filter. Therefore, the next compromise that we need to make is not to have a discontinuity. Discontinuity in frequency response is the cause of instability. And therefore, the second compromise is we must insist on a continuous frequency response. That is the ideal towards which we wish to strive or the specifications that we wish to meet must allow the frequency response to become continuous. In fact, for a rational function it needs to be much more. It needs to be analytic anyway. So, we put that compromise down. Second compromise, there needs to be a transition band between successive bands. You cannot have a pass band touching a stop band. There must be a band of transition during which you may allow the response to move gradually from the pass band to the stop band or from the stop band to the pass band. So, let us take therefore the example of the low pass filter. What kind of specifications can we put which can be met? So, in the low pass filter, realistic specifications would look like this. You would of course have a pass band edge which we will call omega p. The pass band itself would have a tolerance. So of course the ideal response that you want is a 1. But you must allow the response to vary from 1 plus delta 1 to 1 minus delta 1. You also need to have a stop band edge here. And again in the stop band you cannot have the response go to 0 all over. So, you must have a tolerance and therefore you must allow the response to vary in the shaded regions in the pass band and in the stop band. So, this is the stop band and so is this and this is the pass band and this is the transition band and so is this. See if you look at it, there are three, actually there are two basic compromises and three compromises in all. You have a pass band tolerance here. You have a stop band tolerance in these two and you have a transition band. Omega p is called the pass band edge. These are called the pass band edges. And this is called the stop band edge. So is this. And obviously the pass band edge and stop band edge cannot coincide. That is what a transition band is all about. Now we have good news. No matter how small the tolerance in the pass band is, as long as it is non-zero and how small the stop band tolerances and how small the transition band is, the filter is realizable. That is the good news. Although we started with the bad news that the ideal filter is unrealizable, we now have the good news that the moment we make these two basic compromises, the filter becomes realizable and realizable either with an infinite impulse response system or with a finite impulse response system. That is the beauty of it. Let us make a note of that. Yes, there is a question. So the question is why do we need a pass band tolerance? Now you see, suppose you did not allow a pass band tolerance. That means you insisted that the response be constant in the pass band. In fact the same thing holds to the stop band. Suppose the response is constant in the pass band. Now let that constant be C and let us assume that you could indeed get a rational function which meets that constant response C in the pass band. When you subtract C that constant from the rational function, the resultant function is also rational. You see C a constant is a rational function. One rational function minus another rational function is rational. So the difference is a rational function, the difference is 0 all over the pass band and you run into the same trouble that you did when you want a continuum of zeros for a rational function. Is that correct? Is that clear? Is it clear now why you cannot have a constant pass band or stop band response? Yes, because that leads to contradiction to rationality. In fact, now that this question has been raised let me put one more challenge before you. It is not only constant C that is forbidden by a rational function. My contention is other things are forbidden too. What are those other things? What are the other kinds of you know responses that cannot be for a rational function that is left to you and to think right. Anyway it is not directly relevant to what we are doing right now. So I would not like to, but I put it as a challenge before you. So now coming back to this discussion let us make a note of this. We will note therefore that once we have made these compromise the specifications are realizable. Realizable no matter how small are delta 1, delta 2 and omega s minus omega p no matter how small all of them are. Yes there is a question. The question is what about the causality condition? Well the beauty is that you can realize these with causal filters, but you will have to allow a phase. Now what we are talking about here is the magnitude response. We have put specifications so please note let us make I think that is a good question. So you know the specifications that we are putting are on the magnitude response and the phase response comes as a necessary evil right. So remember the specifications are on the magnitude response not the phase response. In fact we cannot put a specification on the phase response that is the problem. If we also insist on putting specifications in the phase response then we become restricted not that we cannot realize it, but what we cannot realize is 0 phase response that is not possible. And now that also answers why phase response is a necessary evil. Phase response is essentially a consequence of causality. If you had 0 phase response you could never get causal systems. In fact I put this as an exercise for you to reason. Show that a real filter with a 0 phase response can never be causal. Yes there is a question. So the question is how can the phase decide the causality of a system? Well what I am saying is that the phase is a consequence of the causality of the system. It does not decide. You know if you want the system to be causal you have no choice but to allow a phase response. But just because the system has a phase response does not mean it is causal. So you can have non-causal systems also with a phase response. But if you want causality phase response is a must. And if you want causality there is a certain kind of phase response that you need to have. What it means is you see what is phase response after all? A phase response shifts each sine wave in time by a pre-specified angle. Is that correct? What does the magnitude response do? It multiplies each sinusoid in the input by what the magnitude response specifies. What is the phase response do? It adds that phase to each sine wave in the input depending on what the phase response is at that frequency. When you add a phase to a sine wave what are you doing to a sine wave? Essentially you are moving the sine wave. So what you need to do is to move all sine waves adequately to make the system causal. That is what the phase response must satisfy if you want to ensure causality. You know if you want to answer the question in a broad sense then the phase response must be such that sine waves are all shifted in a manner that causality is ensured that you are not asking for future inputs to come before you can deal with the present output. So essentially you are asking you know you have to wait for some time that is what it means. Waiting for some time for an output to emerge is a consequence of causality. The effect of the current sample is not going to be felt only now it is going to be felt for some time from now as well. That is another way to understand causality and in a way you have to wait for that time. So the waiting time that is the consequence of the system being causal is reflected in the phase response or in other words the phase response is necessary if you want the system to be causal. Unfortunately when you have put down magnitude response specifications then phase response specifications cannot be put as well and then we cannot insist that they be met too that is not possible. So if you meet the magnitude response specifications whether it be with an infinite impulse response system or with a finite impulse response system there is only a certain class of phase responses that you can then meet. You cannot ask for an arbitrary phase response and have that independently met as well. That is what it is all about. The phase response is not really not too much in your control after you have met the magnitude response specifications.