 A warm welcome to the eleventh lecture on the subject of wavelets and multirate digital signal processing, in which we proceed further on the theme of the two channel filter bank. You will recall that in the previous lecture, the tenth lecture, we had looked at what happens when a sequence crosses a down sampler and an up sampler. I would like to put before you the effect in the z domain once again, when we cross a down sampler and when we cross an up sampler. So, today's lecture as I said is entitled the two channel filter bank and we intend in this lecture to talk about this structure which we have been repeating often again, but today we intend to analyze it threadbare so to speak. Now remember that H 0 was a low pass filter, H 1 a high pass filter, you know it is helpful to get this structure firmly embedded in our consciousness. It is a structure often used in the implementation of a discrete wavelet transform, for example of the Haar multi resolution analysis. So, it does no harm to repeat the structure more than once. We have been looking at the structure almost in every one of the last 2 to 3 lectures, but no harm done. Anyway, here is the structure once again and what we intend to do finally today in this structure is to relate the z transforms at every point in this structure. Let us start doing that and to do that let us first recall what happens when we go past a down sampler and up sampler. So, as I said let us look at the up sampler first, a recall from the previous lecture noted from the previous lecture that if you have x in n going to an up sampler by a factor of 2 to produce x out n here then x out z in this case may be to be specific we could say x out u to denote up sampling here. So, x out u z is x in z squared in this case. Let us similarly see what happens when we go past a down sampler. So, for the down sampler by a factor of 2 remember we had analyzed in detail the case of a down sampling by a factor of 2. We had indicated how to generalize, but it was a little more complicated. So, here we have x out d n if you please and in fact we had noted that this operation of down sampling by 2 was equivalent to 2 operations and let me spell out those operations once again following which I shall write down the z transform here. So, we had agreed that this operation of down sampling by 2 can be split into modulation with half 1 raised to the power of n plus minus 1 raised to the power of n first followed by inverse up sampling by 2 inverse you know we had noted that up sampling by 2 or up sampling by any integer factor for that matter was an invertible operation and in fact this is also evident in the z domain and therefore, we can talk about the inverse here. Now, based on this we had write we had written down the z transform. So, we had said x out d z here is half x in z raised to the half plus x in minus z raised to the half. We had derived this towards the end of the previous lecture and of course, if you did not wish to go beyond the inverse up sampler at this point instead of z raised to the power half you would simply have z. So, much so then for the z domain effect of down sampling and up sampling. Now, what do we intend to do next? We intend to use these relationships to build up the relation between the z transform of the output and the z transform of the input. So, essentially we wish to establish the input output relationship in this 2 band or 2 channel filter bank in the z domain. Now, of course, I must make a remark here before we embark upon this activity. We are assuming that the z transforms exist at all points. There are rare situations or may be not so rare where that may not be true, but for the moment we shall ignore those situations. They are not very frequent in practical applications and therefore, we can comfortably begin with the assumption that the z transforms exist at all points. Of course, I do not mean the Fourier transforms exist they may or may not. Anyway coming back then to that 2 channel filter bank that we began with earlier on in this lecture I put it back before you here. I intend now to relate y z and x z in this diagram and towards that objective let us number the z transforms at different points. In fact, let us give the sequences names. So, let us call this y 1 let us call this y 2 and so on and the very output we shall just call y without any subscript. So, accordingly this becomes y 3 this y 4. This y 5 y 6 y 7 y 8 and then of course, y 9 is simply y. So, with this then let me write down the expressions for each of these. So, let us begin with y 1. y 1 is easy and so is y 2. In fact, if we look at the z domain relationships y 1 z is simply x z times h 2 0 z and similarly, y 2 z is simply x z times h 1 z. When we filter with a filter of system function h 0 z the effect is to multiply the z transform of the input by the system function of the filter to produce the z transform of the output. And therefore, y 1 z and y 2 z are easy y 1 z is h 0 z x z y 2 z is h 1 z x z. Now, we have before us the relationship that emerges between y 3 and y 1 and similarly, between y 4 and y 2. As I said down sampling by 2 is equivalent to a modulation and then an inverse upsampling by 2. So, you know it is easy then to jump from y 1 to y 5 first and y 2 to y 6 because if you think of this down sampling by 2 operation as a modulation followed by an inverse upsample by 2 the inverse upsample by 2 cancels with this upsample by 2 leaving only the modulation here. So, this is a strategy which we might find useful in some circumstances in analyzing multirate operations particularly when you have a down sampler followed by an upsampler. You know if you have a down sampler followed by an upsampler of the same factor it is sometimes easier to go past both of them and then jump back behind the upsampler we will do exactly that here. So, we will put the relation between y 1 and y 5 and y 1 to y 5 is essentially just a modulation. Modulation by 1 raised to the power of n plus minus 1 raised to the power of n multiplied by half and therefore, the z transforms are easily related y 5 of z is half y 1 z plus y 1 minus z and there is a very similar relationship between the y 2 and y 6 put this back y 2 and y 6 are related by the same modulation let us write that down 2. So, we have y 2 is modulated to obtain y 6 and therefore, y 6 z is half y 2 z plus y 2 minus z. In fact, this jumping across the down sampler and the upsampler was useful because it brought us quickly towards the output. Now, we are only almost one step away from the output that step is also not very difficult to take. We just have 2 filters followed by a summer which is easy to do in the z domain. So, let us complete that exercise. So, now we are here we know what y 5 z is we know what y 6 z is y 5 z is acted upon by a filter with system function g 0 and therefore, the z transform at the output here after g 0 is the z transform of y 5 multiplied by g 0. Similarly, the z transform at the output of g 1 is y 6 z multiplied by g 1 z and in fact, let me take you one step even further. After all y z is obtained by adding y 7 z and y 8 z and therefore, we already have y z before us. Let me write down those steps quickly before you now. So, we have y 7 z is y 5 z times g 0 z and y 8 z is y 6 z times g 1 z where upon y z which is y 7 z plus y 8 z becomes you know let me put before you the expression for y 5 and y 6 once again. So, let us take y 6 as an example now you are going to involve y 2 z and y 2 minus z y 2 z if you recall is x z times h 1 z as an example. Now, when you take y 2 of minus z you would get x of minus z multiplied by h 1 minus z. So, in fact, let me put that down what I am trying to do is to identify a form of the expression. So, you know this y 2 of minus z has two terms embedded in it. So, let us focus let us say for example, on this term here y 8. So, y 8 z as I said is going to be y 6 z times g 1 z y 6 z is going to be related to y 2 z and then y 2 z is further going to be x z times h 1 z. Where upon y 2 minus z is going to be x of minus z times h 1 minus z. What I am trying to bring out from this argument or these equations is that each of these terms is going to have a contribution from x of z and a contribution from x of minus z. Now, later on we shall interpret these terms x of z and x of minus z, but for the time being all that we need to do is to identify that there is an x of z set of terms and x of minus z set of terms which we can together write down as follows. So, we will say y z in total is of the following form. It is going to have some system function multiplying x of z and some other system function multiplying x of minus z and using all the equations written so far we can write down these two system functions call them tau 0 z and tau 1 z. Indeed tau 0 z has the following form it is it just requires a little bit of algebra to get here. So, I would not actually do all the steps I am sure all of you can do them and now we write tau 1 z as well. So, tau 1 z would be g 0 z h 0 minus z plus g 1 z h 1 minus z. Now, you know it should be noted that in tau 1 z which is what multiplies x of minus z you involve h 0 of minus z and h 1 of minus z. So, you never involve g 0 minus z or g 1 minus z the z replacement by minus z is only for the analysis side. Anyway with this little observation we now write down y z once again for clarity. So, y z is a linear combination I mean in the z domain you know of x z and x of minus z. What is this mean? What you mean linearly combining x z and x of minus z you see if the x of minus z term were not to be there then we have a simple expression there y z is some function in z multiplied by x z. That is the good old linear shift invariant system for you with a system function and in this case if tau 1 z were to be absent the system function would be simply tau 0 z tau 1 z is the troublemaker here and we need to understand first what this x of minus z is what does it do spectrally what does it do in the time domain. So, let us understand that now what does x of minus z do and to answer this question we put z equal to e raise the power j omega as we always do to interpret things in the frequency domain. Now when you replace z by minus z you are replacing e raise the power j omega by well minus z is e raise the power plus minus j pi times e raise the power j omega for z equal to e raise the power j omega. Recall that e raise the power plus minus j pi is minus 1. So, now we have an interpretation for multiplication by minus 1 in the z domain. Essentially we are replacing e raise the power j omega by e raise the power j omega plus minus pi. In other words we are shifting on the omega axis by either pi or minus pi. Now it should be noted that shifting by pi and shifting by minus pi are the same thing that is because there is periodicity on the small omega or the normalized angular frequency axis. A periodicity with a period of 2 pi. So, there is no problem if we replace plus pi by minus pi there. Shifting by plus pi and shifting by minus pi are the same thing. With that little remark and observation what we have done in replacing z by minus z as far as the normalized angular frequency is concerned is to shift by pi whether plus pi or minus pi. And we would best understand what the shift implies if we took an example spectrum. So, let us take an example spectrum to complete this discussion. Take this spectrum consider an idealized spectrum like this essentially with lines line between minus pi by 2 and plus pi by 2 and 0 outside. So, this is the spectrum of some sequence. Let that sequence be x of n. So, this is the normalized angular frequency omega. This is capital X of strictly e raise the power j omega. But as you know in discrete time processing we sometimes abuse notation a little bit and we write just capital X of omega instead of capital X of e raise the power j omega which is more correct. But anyway I must emphasize that as far as we are concerned from the context capital X of omega and capital X of e raise the power j omega essentially mean the same thing. Now with that remark what happens when you shift by pi here. So, recall that actually this is what x e raise the power j omega is. So, we will do a bit of zoom here periodically repeat it with a period of 2 pi. This is what x of e raise the power j omega actually is. So, you can visualize if you shift this either forward or backward by pi it is going to give you the same thing and what is going to appear after shifting by pi is the following would therefore appear like this. Again we shall do a bit of zooming here and so on here and so on there. So, now your triangles are around the same around pi and then 3 pi and so on and here around minus pi and then minus 3 pi and so on. So, now again if you take the principle interval which is here this is what we get. Now, you know we must be a little more explicit in our relationships here. So, in x of e raise the power j omega if you look at the principle interval minus pi to plus pi. We notice there are 2 segments here for the positive side of the omega axis and the negative side of the omega axis. Let us call the segment for the positive side a and the segment for the negative side a bar and in fact there is a reason for this. You remember that the discrete time Fourier transform has conjugate symmetry for a real sequence. So, it is with that reminiscence that we are writing a and a bar. I agree that if the sequence is complex this conjugate symmetry would not be there, but very often we deal with real sequences and therefore, it is useful to put the symbols a and a bar there just for emphasis. Anyway, now what we will do is in x of e raise the power j omega plus minus pi we shall mark the a's and the a bars carefully. So, here again in the principle interval this was actually a and this was a bar is not it and therefore, this was a and this a bar and now what we need to do is to expand the principle interval for our convenience. So, expanding the principle interval this is what we get. We get an a bar here and we get an a there. Now, you know just for convenience I shall show in dotted on the same diagram what we had just for capital X. So, what I am saying is the solid lines here are x omega plus minus pi and I shall show in dotted x omega just to be clear. Again forgive the abuse of notation where we have replaced e raise the power j omega by just omega for clarity here. So, you know in x of omega you had a here and a bar there and now you have a bar here and a there. So, what has happened is in effect these so called negative frequencies between minus pi by 2 and 0 have now appeared between pi by 2 and pi. So, two things have happened the order of the frequencies has been reversed. So, for example in principle a frequency let us say of minus pi by 4 here is more than a frequency of let us say minus you know here you would have 0 pi by 8 pi by 4 3 pi by 8 and so on and the same on this side. So, if you take a minus pi by 8 frequency here and then a minus pi by 4 frequency there the minus pi by 4 frequency appears as a smaller frequency here one can see that because the order of frequencies from 0 to pi or 0 to minus pi by 2 has been now reordered between pi and pi by 2. So, increasing magnitude of frequency here becomes decreasing magnitude of frequency there. Secondly, the frequencies themselves change. So, you know actually this is exactly what happens in what is called Eliasing. Many of us will recall from the theory of sampling and Eliasing. This is something very fundamental in a course on discrete time signal processing or in the process of sampling a continuous time signal to get a discrete sequence these things happen. So, if we do not sample at an adequate rate we get a problem called Eliasing. What is Eliasing? Eliasing is a phenomenon where a sine wave assumes a false identity and there are two things that happen in Eliasing. One of them is of course that the frequency of the sine wave appears to change. The other is that when you increase the frequency of the sine wave the apparent sine wave or the sine wave produced by impersonation if you would like to call it that seems to have its frequency reducing. So, an increasing frequency and increasing actual frequency seems to appear as an apparently reducing frequency. These two things together make up the concept of Eliasing and what we are seeing here is just an instance of Eliasing. Why are we seeing Eliasing? It is not very difficult to understand. What we have done is to down sample. You know in the process of down sampling we have in fact introduced the possibility of Eliasing and this x of minus z term is bringing before you the consequences that would be there if Eliasing were allowed to remain. Think about it x of minus z is therefore called the Eliasing term because it tells you the contribution of possible Eliasing. In the two band perfect reconstruction filter bank which we shall soon see this Eliasing should be absent by perfect reconstruction I mean if y is to be an exact replica of x. As is the case for example in the Haar system when you have chosen the filters properly. So, you analyze or you decompose and then you synthesize or reconstruct and if the reconstruction is perfect there should be no Eliasing. So, this x of minus z term is a troublemaker term in general troublemaker in this sense. Let us make a note of this. So, the x of minus z term or equivalently the x of minus e raised to the power j omega or x e raised to the power j omega plus minus pi term is the consequence of Eliasing. What is the consequence of Eliasing? We should put it down very clearly. Eliasing does two things. One, one frequency manifested as another increasing actual frequency leads to decreasing apparent frequency. So, in fact just to emphasize let me put back before you and stress this point. As you increase the frequency from 0 to pi by 2 here the frequency appears to decrease from pi to pi by 2 there. The first thing we have to do if we want perfect reconstruction is to do away with Eliasing. So, we put down a condition for Eliasing cancellation. If we want y z to reconstruct x z we must first do away with Eliasing and how can we possibly do away with Eliasing? That essentially means we want tau 1 z to be equal to 0 or in other words we want g 0 z h 0 minus z plus g 1 z h 1 minus z equal to 0. And in fact if we wish to explicitly express the synthesis filters in terms of the analysis filters we could do that as well. Let us rearrange this equation to get g 1 z by g 0 z is minus h 0 minus z by h 1 minus z. And of course a very simple choice is g 1 z equal to the numerator let us say plus g 1 z is equal to the numerator or minus h 0 minus z and correspondingly g 0 z is minus respectively plus h 1 minus z. This is a very simple choice of synthesis filters from the analysis filters which can give us Eliasing cancellation. Now in fact we can even spend a minute in interpreting what we just said here in this very simple choice. I must of course emphasize this is a simple choice but definitely not the only choice. In general you should note that there would be a factor cancelled in the numerator and denominator. So, more general choice would be as follows. g 1 z is of the form plus minus some factor let us say r of z times g 1 z is of the times h 0 minus z and g 0 z is respectively minus or plus r z h 1 minus z. So, r z is you know in some sense the factor cancelled you know when you divide g 0 z by g 1 z some factor has been cancelled and what is left is h 0 and h 1 that is the way you should look at it that is the more general situation. Anyway now let us interpret what we had written here namely g 1 z this is a very simple choice of g 1 is h 0 of minus z and g 0 is plus or minus you know you just interchange plus or minus here h 1 of minus z. So, let us take the upper one g 1 z is h 0 minus z the other one follows similarly. You see ideally this is what the frequency response of h 0 should be it should be an ideal low pass filter with a cut off of pi by 2. So, this is what the frequency response should look like this is 1 the height here. So, what would h 0 erase the power omega j omega plus minus pi look like or in other words what is h 0 of minus z h 0 minus z with z replaced by e raised the power j omega is essentially of course, as you know h 0 e raised the power j omega plus minus pi and that as you can very easily infer looks like this again let us use the strategy of zooming and then contracting back again. So, I have pi minus pi there 2 pi 3 pi and so on this is what h 0 look like taking note of the periodicity remember this is minus pi by 2 there this is pi by 2 this would therefore be 3 pi by 2 and so on. So, this zoomed h 0 e raised the power j omega plus minus pi would look like this it would have an appearance like this and so on here these pass bands. So, to speak are now going to lie at the odd multiples of pi and you can continue that drawing. Now, once again we confine to the principal interval. So, the principal interval is here and when we do so and then zoom back to emphasize only the principal interval what do we get we get this low and behold from a low pass filter with a cutoff of pi by 2 we have a high pass ideal filter of course again with a cutoff of pi by 2. So, this falls into place very well in fact the equation g 1 z is h 0 minus z makes a lot of sense all that we are saying is that on the synthesis side if you had an ideal low pass filter with a cutoff of pi by 2 at h 0 you should put an ideal high pass filter with cutoff pi by 2 at the point g 1 and you know if you look back at the other one of the two namely g 0 you would make a similar inference g 0 z is h 1 of minus z with a minus sign. So, if you look at the magnitude sense again a high pass filter would become a low pass filter in fact I leave this to you as an exercise. So, exercise shows similarly that an ideal high pass filter h p f with a cutoff pi by 2 on replacing z by minus z becomes an ideal low pass filter with a cutoff of pi by 2 and that also makes a lot of sense for the other of the two requirements for alias cancellation. So, today we have looked at the condition for alias cancellation and we have interpreted the simplest of the conditions. Now, if you do not stick to the simple condition and if you have the factor of r z all that we need to do is to say that we are also modifying that filter a little beyond just this low pass to high pass and high pass to low pass conversion that r z factor would carry out that modification. So, we have taken one out of two steps today in building a perfect reconstruction two band filter bank we have taken the step of alias cancellation. In the next lecture we shall take the second step namely perfect reconstruction. So, we have done away with tau z I mean tau 1 z, but now we need to see what to do with tau 0 z which we shall do in the next lecture. Thank you.