 A warm welcome to the 45th session on the subject of wavelets and multirate digital signal processing. In this session, we continue the scheme of tutorial discussions that we have initiated in the last few sessions. You will recall that in the previous session we had placed before your tutorial, a tutorial on the two-band filter bank from the point of view of the time domain. We wanted to understand in depth how a signal progresses through the different stages of a two-band filter bank and emerges with perfect reconstruction. Of course, subjected to a delay and if we have not taken care of then the constant multiplication as well. Today we shall take up from the question or the exercises that we had put before you in the previous session on the frequency domain analysis of the two-band filter bank. We had introduced the questions that we would like to deal with in the session today. Namely, how do you see the sinusoid being treated by different stages of the two-band filter bank? What does the two-band filter bank do in the frequency domain and how can be illustrated by the use of a sine wave? The time domain and the frequency domain are of course as we all very well know two alternate domains for looking at a two-band filter bank. Each of them has its advantages and limitations. The advantage of the time domain approach or perspective is to understand precisely what the filter bank does to the signal in the natural domain. What would happen when the signal is passed through the filters? How would it look at different stages is what one answers when one looks at it in the time domain or the natural domain. However, when we have persistent signals, when we have long term behavior in mind and we wish to look at the sinusoidal content both at the input and the output, it is the frequency domain characteristic of the two-band filter bank which comes into play and is of importance. So, therefore, we must in these tutorial sessions look at both of these domains in fairness, appreciate the role of both of the domains in their entirety and appreciate also the distinctions between the way in which we deal with the two domains. Therefore, today we shall take up the frequency domain. By frequency I mean sinusoidal frequency domain and look at the two-band filter bank with some example prototype inputs studying the outputs at different points. So, coming then to the tutorial session, what we intend to do today is to look at a typical filter bank. So, we have again the same good old two-band filter bank. However, we shall not assume it is the standard ideal filter bank this time. So, for example, let us take a variant of the two-band filter bank to understand why we need so called half-band filters and what would happen if the filters were not half-band. So, suppose you happen to choose a low pass filter here on the upper branch with a cutoff of 2 pi by 3 instead of pi by 2 and you choose on the lower branch a high pass filter again with a cutoff of 2 pi by 3. So, we are trying to see what happens if we deviate from the norm. So, of course, we have the standard down sampler following it and let us say this constitutes the analysis side. Following this, we shall have the synthesis sides. These are points let us say A and B and on the synthesis side, we have let us assume the same two filters of course, following an up sampler. We of course, succeed that by an addition and this is what we are calling synthesis here although I must emphasize the words analysis and synthesis here are only notional. So, we will call the input signal x and the output signal y and we will remember that we are talking about the sinusoidal frequency domain here. So, in other words, we are working with the discrete time Fourier transforms or DTFTs of the signals at every point. Now, what is the deviation from the ideal 2 band filter bank here? The deviation is that the low pass and high pass filters have a different cutoff. In the ideal 2 band filter bank, the cutoff was pi by 2 and we call them half band ideal filters. Now, we are trying to study the effect of well ideal low pass and high pass filters, but with a non ideal cutoff. So, we are not taking the cutoff to be pi by 2, but 2 pi by 3 and in some sense there is a complementarity. I mean what we are trying to study is even if there is complementarity between the two filters. In other words, what one filter passes the other stops and what one filter stops the other passes. Even so, are we going to have reconstruction, are we going to suffer some kind of distortion if so, what distortion will occur. So, with that background, now let us take a prototype discrete time Fourier transform again to study the behavior of this 2 band filter bank. So, we will take the so called prototype x erase the power j omega which should look like this. So, 0 phase x erase the power j omega. Needless to say, I am representing the discrete time Fourier transform between minus pi and pi and this is repeated at every multiple of 2 pi. So, around 2 pi you would have the same pattern around minus 2 pi, around minus 4 pi, around 4 pi and so on so forth. Now, let us again mark the different points on the original filter bank. So, we had here the analysis side. On the analysis side let us mark them as usual with y 1 here, y 2 here, y 3, y 4. So, we have 4 points on the analysis side and of course, y 3 and y 4 are respectively a and b again. So, we have y 3, y 4 back here on the synthesis side and this gives you y 5 here, y 6 here, y 7 here and y 8 here and we shall call the output y 0 if you please just to keep a subscript there as well. Now, what we intend to do first is to look at these points y 1, y 2 followed by the points y 5 and y 6. We remember the reason why it is easier first to look at what happens across both the down sampler and the up sampler and later to jump across the up sampler. In other words to come from y 5 to y 3. So, let us put down, let us recall the relationships that govern the discrete time Fourier transforms at different points here. So, this is the prototype, the prototype. You know why this is called a prototype? Well, it is because when we put this as the input each frequency has a different amplitude here. So, in some sense there is a one to one relation between omega and the amplitude. So, in some sense this is the simplest kind of a spectrum where each frequency has a distinct amplitude and we have done away with phase for simplicity. Now, let us look at what happens at the points y 1 and y 2. So, of course, y 1 is easy. What we should do is to plot three periods at a time. So, in general it is always, it is always a good idea to consider three successive periods of 2 pi and those three without any loss of generality could be minus 3 pi to minus pi, minus pi to plus pi and plus pi to plus 3 pi and doing so, we first start with the prototype spectrum again. So, the prototype spectrum looks like this in these three standard periods. Now, at the point y 1 we would be passing everything between 0 and 2 pi by 3 and rejecting the rest. So, what we would see at the point y 1 is as follows. Let us mark these points once again and let us mark the point 2 pi by 3 here and minus 2 pi by 3 here and there we are. If this height be 1, this height would be 1 by 3 that is easy to see and of course, this is repeated. As I said it is always a good idea to draw three periods. This is minus 2 pi. So, I will just mark the critical points. This is minus pi here. So, minus 4 pi by 3 and minus 8 pi by 3 here. So, this is of course, well minus 2 pi by 3 plus 2 pi. So, you know it is when I write minus 2 pi by 3, it is 2 pi minus pi by 3 that I mean actually. So, this would be 4 pi by 3 here and this is 8 pi by 3 here. So, please correct. Let us correct these markings here. So, of course, this point is 1. This point is 1 by 3 here. This is simple. Similarly, for y 2, I strongly recommend that in the tutorial sessions the student should work with the instructor. In the tutorial sessions, the whole idea is that the instructor solves something on a virtual blackboard or a virtual whiteboard here and the student works with the instructor. So, that is the reason why I am going through every step because I expect the listener or the participant to be working with me. Anyway, coming back to this tutorial. So, here we have here what emerges out of y 2 is this. So, of course, this point is 1 by 3 here and this is repeated here and as expected this point is 2 pi by 3. So, we mark a few of them and of course, these are negative of those points. So, you have minus 4 pi by 3 there and minus 8 pi by 3 here. So, so much so for y 2 now comes the interesting part. You see we need to worry what happens with the down and the up sampler together. So, let us write the equations down in the z domain first. In the z domain, if we have let us say g in here and a down sampler of 2 followed by an up sampler of 2 to produce g out and if they are respective z transforms are g in z and g out z then we have the very simple relationship g out z is half g in z plus g in minus z and we know how to interpret this in the frequency domain. When we put z is equal to e raise to the power j omega what we would get is g out e raise to the power j omega or the discrete time Fourier transform g out is half g in e raise to the power j omega plus g in minus z and we know how to interpret this in the e raise to the power j omega plus minus pi. We have done this before essentially multiplication by minus 1 of the variable z amounts to a translation of pi. Just to complete the discussion I would like to complete that one step which proves this. So, remember g out z has two terms one is the original DTFT multiplied by half plus half time what is called the alias DTFT and the alias DTFT is obtained by replacing z by minus z or e raise to the power j omega by minus e raise to the power j omega and minus e raise to the power j omega is essentially e raise to the power plus minus j pi e raise to the power minus j omega or rather j omega which gives us a shift of pi. Using this let us go across the down and up sampler together on both of the branches. So, we will come to y 5 and y 6 first let us do the easier one first let us do y 2 to y 6 first. So, we have y 2 followed by a down sampler and then an up sampler to result in y 6 and of course, y 6 e raise to the power j omega is obtained as half y 2 e raise to the power j omega plus y 2 e raise to the power j omega plus minus pi and we will solve this graphically to get y 6 e raise to the power j omega looks like this again to draw three periods. So, we had this here this was the original DTFT this point is 2 pi by 3 this one minus 2 pi by 3 and of course, the others are as usual the only thing one must remember is this is what y 2 look like. So, let us first draw y 2 shifted by pi. So, when you shift it by pi you could shift forward or backward it does not matter because this is periodic with period 2 pi. So, if we shifted backward for convenience we would get the following we will show the aliased ones in dotted remember this is again periodically repeated here. So, when we bring it backwards we are going to see these aliases too they only catch is that there is also a factor of half if you recall there is a factor of half and therefore, it is not one third here it is one sixth now these are the original spectra y 2 e raise to the power j omega as it is and these are the aliased spectra essentially obtained by a shift of pi. Now, it is easy to see what will happen when you subject this to the action of the high pass filter with the cut off of pi by 3. So, here if we notice or rather 2 pi by 3. So, when we subjected to the action of high pass filter we can see that in the primary period that is between minus pi and pi essentially the black solid lines are retained and these dotted lines are destroyed. So, the high pass filter with the cut off of pi by 3 as expected retains the original spectrum and destroys the aliases. So, this is the good part of the filter bank in the sense it does what we expected after passing through the down and the up sampler we have retained whatever was there of the original spectrum and destroyed the aliases. Now, we need to see what happens on the low pass branch and I said that is the more difficult one. So, difficult one because that is where there is going to be aliasing in the first place. So, we are going to have some trouble. So, let us look at first what happens at the point well you know we had y 1 e raised to power j omega subjected to a down sampler by a factor of 2 and then an up sampler and that gave us y 5. So, we had y 5 e raised to power j omega as before is half y 1 e raised to power j omega plus half y 1 e raised to power j omega plus minus pi. This is the original and this is the aliases and here the aliases will really aliases on the original spectrum as we will see in a minute. So, here we are 2 pi by 3 here minus 2 pi by 3 there of course, 2 pi minus 2 pi by 3. So, you have 4 pi by 3 here 8 pi by 3 there minus 4 pi by 3 here and minus 8 pi by 3 here and you have the spectral components which look like this. This is essentially the original spectrum as it were and the aliased spectrum would be obtained by translating this by pi the only catch is that now we are going to have an overlap. So, first let us draw the aliased spectra the aliased spectra would be from would be around pi of course. So, you would have you see 0 to pi by 3 you will bring this from pi to 5 pi by 3 here. So, there we are at pi it will be 1 I can of course, complete the other drawing, but let me focus just on the region between minus pi and pi. So, let me first complete this part. So, I have this being brought to rather this you see we shifted this forward. So, we will shift this forward as well. So, we have this coming here this is where we are and now we need to be a little careful about the amplitudes once again this was originally an amplitude of half, but now rather it was an amplitude of 1, but now with a factor of half you have an amplitude of half here and so to here this would be one third ordinarily, but it is becoming one sixth now because of the factor of half. So, now we have to pay particular attention to the region between pi by 3 and 2 pi by 3 where there is a aliasing in that region we have sums of straight lines. So, at this point for example, this point has the amplitude half this point has the amplitude 1 by 6 this point has the amplitude in between them. So, this is 3 by 6 1 by 6 this will be 2 by 6 and 2 by 6 and 1 by 6. So, you go back to half there that is interesting. So, you are adding this back here. So, what we get on adding so this you see these are the aliases the dotted lines are the aliases and these are the original spectra and we have to add them. So, when we add what we are going to get is a pattern like this and I will show only the region between minus pi and pi now because that will tell us everything about the rest. So, between minus pi and pi let me expand the figure I have pi by 3 here the trouble region is between pi by 3 and 2 pi by 3 and of course, similarly on the negative side. So, of course, from 0 to pi by 3 it is easy it drops from half to 1 by 2 by 2 by 6. So, 1 by 3 now from here there is a discontinuity. So, as you can see the spectrum goes from half linearly down to essentially 1 by 3 here actually it should be 2 by 3, but because of the factor of half it comes down to 1 by 3 here and at this point a discontinuity arises because of the addition of this spectrum here. So, this contributes another 1 by 6 here. So, this goes back to half and continues up to half continues at the at the height of half up to this point here. Subsequently again it drops and then rises up to half. So, this is how the spectrum looks goes back to half here drops and rises back tricky, but not too difficult to understand once we work out the details these are all at half and this is at 1 by 3 and of course, this is replicated on the other side. So, this is the spectrum at the point y 5 and now it is very easy to see what happens at the point y 7 and at the point y 8. Of course, y 8 we have seen before. So, when we subjected to the action of a high pass filter with cut off 2 pi by 3 we essentially got back everything without aliasing, but here we have a slight difference of situation. You see here we are going to get now remember when we cut off at a cut off of 2 pi by 3 we are going to get this and this. So, what we are going to get is the following at y 7. Again let us draw only the period from 0 to pi for the moment to emphasize matters and here of course, this is nulled this is at the point y 7. Essentially by subject to the low pass filter with cut off of 2 pi by 3 and now it is easy to reconstruct y 0, y 0 is essentially y 7 plus y 8. So, let us complete the discussion by reconstructing y 0 not really reconstructing the true sense, but trying to reconstruct as it were and again it should be satisfactory for us to look only at the period from minus pi to pi. This is what y 0 looks like. So, now it illustrates very clearly in the frequency domain what the consequence of the non ideal cut offs is. Although the two filters looked to be complementary because one of the filters did not obey the requirement of aliasing or rather had a pass span beyond pi by 2 you see the aliasing taking place there. As expected the aliasing takes place to the extent that we have exceeded the pi by 2 band. The excess was from pi by 2 to 2 pi by 3 and therefore, you have aliasing between pi by 2 and 2 pi by 3 that is you know 2 pi by 3 minus pi by 2 on one side of pi by 3 as also on the other. So, aliasing occurs on both sides of pi by 2 in the same band extent. The band extent is pi by 6 2 pi by 3 that is 4 pi by 6 minus 3 pi by 6. So, the what we have tried to illustrate here is that pi by 2 comes here. So, this is the point pi by 2. Mark it this pi by 2 here and of course, similarly on the other side, but you have an equal band on both sides a band of pi by 6 on either side where there is a aliasing. Let us make a note of that aliasing has occurred in a band of extent 2 pi by 3 minus pi by 2 which is pi by 6 on either side of pi by 2. So, much so then for an example of a frequency domain behavior where we are not adhering to the actual requirements of cutoff. Now, let us look at some of the variants of the 2 band filter bank. This time in fact, not just the 2 band filter bank, but also hybrid filter bank where we have a 3 band and a 2 band combination. So, in some sense what we were trying to do here was to bring in a hybrid, but the down and up sampling factors was still 2. Now, let us bring in a hybrid where we also change the down and up sampling factors. So, for example, suppose I wanted to get an effective down sampling factor of 2 by 3. In other words, I wanted to bring down the rate by a factor of 2 by 3 instead of half what could I possibly do? So, what I mean is is it conceivable that we have a low pass filter with a cutoff of 2 pi by 3 and a down sampling factor of 2 pi by of 2 by 3 or rather down 3 by 2 which means the rate goes by a factor of 2 by 3. Is this possible? Of course, we will have to reflect on what this would actually mean in terms of components. You see, one way to interpret this is to think of this as an upsampling of 2 and a down sampling of 3. So, perhaps we could interpret a down sampling by a factor of 3 by 2 as a down sampling by a factor of 3 followed by an upsampling by a factor of 2. The only problem is that when you down sample by 3 something is already lost. You have already lost two thirds of the information and upsampling does not retrieve information. One must remember that upsampling is invertible, down sampling is not. So, perhaps it might be a better idea to upsample first and then down sample. Why so? Because this does not cause loss of information. There is no loss of information here and whatever loss we are prepared to incur should be incurred in the end, incur a loss only in the end and let us see what this does spectrally. In fact, suppose we were to take this very same spectrum. So, we have this prototype spectrum once again and we subject it to the action of a low pass filter with cutoff 2 pi by 3. What would we get? We would get this. Now, let us see what happens when we subject it first to an upsampler. So, when we subject it to an upsampler, we know there is essentially a creation of images. So, let us call this spectrum, let us mark the spectrum and different points. So, we will assume that we have x here. We subject it to an upsampler by a factor of 2 to get y 1. Perhaps we need to do some filtering here and then we would down sample by a factor of 3. So, let us call the filter output y 2 e raise the power j omega and the output ultimately y o. Now, again y 1 e raise the power j omega would appear like this. Now, it is easy for me to draw only the interval from minus pi to pi because I have got used to seeing the other two copies at 2 pi and minus 2 pi. I can visualize them in my mind and I can put down the appropriate segment that appears between minus pi and pi. So, let me project before you once again the output at the point y 1 after we have subjected x here to the action of a filter. So, of course, here I thought instead of taking x, let us take the filtered x here. Filtered x means filtered so that it has a spectral component only up to 2 pi by 3. So, this is the spectrum of the filtered x. Maybe we will give it a name. We will call it x tilde. So, now you can visualize. When we subject this to an upsampler by a factor of 2, this pi would come to pi by 2 and at pi you would have what is present at 2 pi. So, therefore, at the point y 1 on this sequence here on this graph, I would get well pi by 2 there, pi here minus pi by 2 minus pi. So, only this part needs to be brought here. So, what was originally at 2 pi by 3 will now come to pi by 3 and here to we need to bring only this part. This is 1 by 3 here. So, 1 here, 1 by 3. Now, we understand the role that the filter needs to play after y 1. So, we have a filter. Let us call that filter f 1 here. The role that this filter needs to play is to take away these images. So, f 1 removes these images. Now, it is very easy to see that after these images are removed, what we have is something that we can reconstruct or we can allow to be down sampled by 3 without any loss of information. So, what f 1 needs to be is an ideal filter low pass filter with cut off pi by 2 and that would do the job. With that then, what we would have left in the interval between minus pi and pi is essentially just this. So, this goes from 1 to 1 by 3 here and the rest of it is blanked out. Now, when we subject this to the action of a down sampler by 3, we would essentially get back the original spectrum, but expanded to fill the entire interval. So, when we down sample this by 3, what would emerge is essentially the following at y 0. Not 1 here, but 1 by 3 and not 1 by 3 here, but 1 by 9. Essentially, the same spectrum informed, but changed in amplitude. So, what we have done here is to create an effective down sampler by a factor of 3 by 2 and we needed to do it by combining a down sampling and up sampling operation. With that then, we come to the end of this tutorial session where we have tried to illustrate a few variants of frequency domain analysis of the filter bank. In the first part, we brought in a variant of the two-band filter bank. In the second part, we brought in a variant of the down sampling factor. We look forward to more sessions in the future with other kinds of explanations and discussions. Thank you.