 a very warm welcome to the sixth lecture on the subject of wavelets and multirate digital signal processing. In this lecture, we continue to build on the idea of connecting multiresolution analysis and a set of filters. And therefore, we shall call this lecture a lecture based on the Haar filter bank. Haar, if you recall, is the multiresolution analysis that we are discussing. And we have talked about filter banks earlier, a collection of filters with certain mutual and individual characteristics either with a common input or a common point of output summation. So, we are going to build up the connection between the Haar multiresolution analysis and filter banks as we understand them in the discrete domain. Now, towards that objective, let us go back to the example we brought up last time. Now, I shall highlight before you the example once again. So, let me reiterate the example. So, we consider a function y t belonging to v 1 as understood in the Haar multiresolution analysis. And remember the function v 1 that we were talking about yesterday, we said on the real axis, we would of course in principle define it over every half interval, but then we can be content with looking at a segment of this real axis between minus 1 and 3. And we will do exactly that. So, we have this segment between minus 1 and 3. And the values in the successive half intervals here starting from the half interval immediately next to minus 1, the piecewise constant values are 4, 7, 10, 16, 14, 11, 3 and minus 1. We said it is quite adequate for us to write down the piecewise constant values in each half interval. And that would define the function completely. In fact, as far as a function belonging to v 1 is concerned, it is these that constitute the coefficients of expansion. So, in fact, the sequence as we understand it is here. For example, y at the sequence corresponding to this would have y at minus 2 equal to 4, y at minus 1 equal to 7 and so on, y at 0 is equal to 10, y at 1 is equal to 16 and so on and so forth. And of course, the sequence could be used in constructing the function from the basis. So, we have y of t is summation n running from minus to plus infinity y of n phi 2 t minus n. Recall that phi of 2 t minus n look like this. It was 1 over a half interval defined by n by 2 to n plus 1 by 2. Now, after reflecting on this, we must now do exactly what we did. We put down a scheme yesterday for going from the function in v 1 to its components in v 0 and w 0. So, we said we could make an orthogonal decomposition of v 1. We said we could write v 1 as v 0 plus that is orthogonal sum w 0 and both v 0 and w 0 could be defined on the standard unit intervals. So, for example, for this particular function that we have here, let us put down explicitly the projection on v 0 and w 0. You see, we now use the word projection. We have made an orthogonal decomposition of v 1, the space v 1 into the spaces v 0 and w 0 and we have explained the meaning of v 0 and w 0 yesterday. We have also talked about their bases. We have also shown how to make this decomposition in each standard unit interval. So, for example, if we go back to this function which we were discussing a couple of minutes before, what we would now need to do is to take each standard unit interval. So, for example, the interval minus 1 to 0 and then the interval 0 to 1, 1 to 2, 2 to 3 and each of them we need to put down how the projection on v 0 would look and how the projection on w 0 would look. And recall for example, if you consider the interval from minus 1 to 0, the projection on v 0 would be piecewise constant on that interval and would take the value given by the average of 4 and 7 namely 4 plus 7 by 2. On the other hand, the projection on w 0 would be given by a multiple of the Haar wavelet located between minus 1 and 0 and with a coefficient 4 minus 7 by 2 associated with it. So, let us proceed to put down these two projections. So, we have the projection y on v 0 which we shall call y v 0 and y on w 0 which we shall call y w 0. Let us sketch y v 0 first. So, let me keep this for reference on top. Now, between minus 1 and 0 as we see the projection would be 4 plus 7 by 2. Between 0 and 1, the projection would be 10 plus 16 by 2. So, let us put down the values. I will keep this for reference on top and put down the values here. So, 4 plus 7 by 2 that is 11 by 2 here, 10 plus 16 by 2 that is 13. Between 1 and 2 it is going to be 14 plus 11 by 2 that is 25 by 2 and between 2 and 3 it is going to be 3 plus minus 1 by 2 that is 2 by 2 and that is 1. This is how the projection on v 0 would look, y projected on v 0 as a function of t, piecewise constant on the unit intervals and these are the piecewise constant values. Now, of course, I am not actually drawing the function here. It is easy to visualize the piecewise constant values, but let me now go to the projection on w 0. So, I shall once again use this as a reference here and I put down the values. This time I will explicitly indicate that we are using this basis. So, I have minus 1, 0, 1, 2, 3 and I am using a basis. So, between minus 1 and 0 I am going to use a proper translate of psi t with a height given by 4 minus 7 by 2. This height is going to be 3 by 2 of course, with a negative sign. Between 1 and 2 between 0 and 1 it is again going to have a negative sign and the height is going to be 10 minus 16 by 2 that is 6 by 2. So, of course, I am not drawing this to scale and just drawing it to be indicative. This height would be 3. Here between 1 and 2 you would have 14 minus 11 by 2 that is 3 by 2, but with a positive sign. So, you would have a multiple of psi t placed in this unit interval with a height of 3 by 2 and finally, in the interval between 2 and 3 you have a height of 1 and a positive multiple of psi t placed 3 by 2, 3, 3 by 2 and 1. So, this is the projection of y on the space w 0 as a function of t. Now, we can also write down the sequences. So, in fact, we should do that. If we go back to this projection so now, what we must do is to construct the sequences which describe these projections and in fact, by constructing these sequences we will also understand how the two discrete filters that we talked about in the previous lecture work. So, let us go back to this function, the projection on v 0. How about the sequence here? Look the sequence would be this 13, 25 by 2, 11 by 2, 13 marked at 0. This is the sequence and similarly, we can put down a sequence corresponding to the projection on w 0. So, the sequence here would be, well remember this is minus 3 by 2 at minus 1, minus 3 at 0 and so on. So, minus 3 minus 3 by 2 plus 3 by 2 and plus 1 with the minus 3 put at the point 0, that is the sequence. Now, we have also seen the filters that correspond to this. So, yesterday we noted that if we put down the sequence y n, let us now put it down in the language of discrete time processing. So, if you have the sequence y n, sequence corresponding to y t and if you pass it through two filters, the upper filter is described by the equation, well you know. Now, I cannot use y n for the output because I am using y n to describe this. So, I will use different input output notation here. I will say in these two discrete time filters, a is the input and b is the output. So, I have b n is a n plus a n minus 1 by 2 and here I have b n is a n minus a n minus 1 by 2 and then I have a decimation operation as I talked about yesterday, a down arrow followed by 2. So, this is the structure that gives me the sequence for v 0 here and the sequence for w 0 here. Let us write that down. The y v 0 sequence there and the y w 0 sequence here. In fact, what we should do is to describe these filters in terms of their system functions rather than describe them in the terms of time domain as we are doing here. Now, I shall just recapitulate a few concepts from discrete time processing to refresh our memories and enable our discussion. Recall that if we have a sequence y of n, its z transform is described by y of z. Normally, we use the small letter to denote the sequence in time and the corresponding capital letter to denote the sequence in the z domain or also in the frequency domain and y of z is summation n going from minus to plus infinity y n z raised to power minus n. Now, we must remember that this converges in a region of the z plane. It does not converge all over the complex z plane and that region in which it converges is called the region of convergence. So, a z transform is always defined by an expression and a region of convergence. Outside the region of convergence that expression has no meaning. Recall also that both of them are absolutely necessary to complete the z transform. If we only give the expression and do not specify the region of convergence, there is a possibility that two sequences could correspond to that expression, two or more in fact. And therefore, it is only after we specify the region of convergence that the z transform is completely specified. A few points that we noted in connection with the z transform. We are also familiar with several properties of the z transform. For example, when we shift a sequence, the z transform is multiplied by an appropriate power of z. So, let us recall that property of the z transform. So, if y n has the z transform and you know having the z transform, we shall denote by script z like this. So, when we write this, what we mean is that y of n has the z transform given by y of z with a region of convergence r. Maybe if you want to be specific, we could say the region of convergence of capital Y. So, if y of n has the z transform given by y z with the region of convergence r y, then y of n minus d has the z transform given by z raised to the power minus d y of z. And the region of convergence is at least r y if not more. Sometimes, the region of convergence might expand a little beyond r y. The z transform is a linear operator. So, if we take a linear combination of sequences, the same linear combination occurs in the z domain. As far as the regions of convergence go, the regions of convergence are at least the intersection of the regions of convergence of the individual sequences which are linearly combined if not more. So, when we have an operation being done on sequences and the corresponding z transform is recorded, it is possible the region of convergence might expand beyond the intersection of the regions of convergence of the sequences. Anyway, using this, let us transform the filters that we had a minute ago into the z domain. So, let me put down the two filters explicitly once again. I have the first filter given by b n is half a n plus a n minus 1, where a is the input and b is the output. If we take the z transform on both sides, we get what is called the system function of this filter. So, let us calculate that system function. We get b z is half a z plus z inverse minus a z plus z inverse minus a z plus z inverse a z, where upon b z by a z can be obtained and this is called the system function of the filter and the system function is easily seen to be half 1 plus z inverse. In a similar manner we can calculate the system function of the second filter that is described by b of n is half a n minus a n minus 1 and there the system function would be b z by a z given by half 1 minus z inverse. So, all in all we have a pair of filters followed by a pair of decimeters and the structure looks like this, half into 1 plus z inverse here, half into 1 minus z inverse there and a decimeter. So, here we have the sequence for y, here we have the sequence for y v 0 and here we have the sequence for y w 0 coming out here, here and here respectively. Now, this is what decomposes or analyzes the function y t into its components and therefore, this pair of filters followed by the decimation operations is referred to as the analysis filter bank corresponding to the higher multi resolution analysis. Now, we shall also bring out the synthesis filter bank for the same multi resolution analysis. In other words, if we have the projection on v 0 and the projection on w 0, how do we reconstruct the y t function? So, in other words if I have the sequences corresponding to y v 0, the sequences corresponding to y v 0 and y w 0 the projections on v 0 and w 0 and if we wish to reconstruct the sequence corresponding to y, what are the things that we need to do? Now, if we spend just a minute in reflecting, intuition tells us that this decimation needs to be out done when we reconstruct in some manner. What do we mean by out doing or doing away with that decimation? You see what has happened as a consequence of that decimation process. In some sense that decimation process has halved the n index. So, recall that that decimation process essentially brought the index 2 to the index 1, the index 4 to the index 2, the index minus 2 to the index minus 1 and so on and so forth. We need to restore the indices back to their original place that is at double the value. So, how do we do that? So, essentially if we wish to construct a synthesis filter bank or to synthesize y t from y v 0 t and y w 0 t, actually in time it is very easy, in continuous time it is very easy. In continuous time this is simply y t is y v 0 t plus y w 0 t simple, so simple you just add them, but that is in continuous time. When you want to do it in discrete time you have to work a little harder. So, in fact let me put back the sequences, you know let us write the sequences explicitly now. We what we will do is we write down the sequences at least in that region from minus 1 to plus 3 explicitly for y for y v 0 and for y w 0. So, let us write the sequences explicitly. So, for y the sequences essentially 10, 16, 14, 11, 3 minus 1 here and 7 for there and 0 marked here. Let us on the same reference write the sequence for y v 0 and y w 0 and then let us put them together. What I will do is to when I write the sequence for y v 0 I will need to do a little bit of work, you know y v 0 is going to look like this. So, in fact I have the sequence here let me just rewrite it explicitly. So, I have the sequence for y w 0 here I put it down explicitly. Now you see what I mean you see if you look at this sequence it has in the interval from minus 1 to 3 2 plus 2 plus 2 plus 2 plus to 8 values and if you look at these 2 they have only 4. So, somewhere we have to do an expansion and that expansion is required because each of those points in the sequence corresponding to y was actually over half an interval half a unit interval whereas, the sequence points in y v 0 and y w 0 are on a full unit interval. So, essentially what we need to do is to introduce spurious zeros here. So, let us first carry out what is called a process of interpolation or upsampling. So, let us define with the intent of out doing the operator of decimation to out to decimation. So, to speak to out to or overcome decimation let us define an operator which we shall denote by up and 2 up essentially means up sample and what does up and 2 do well up and 2 essentially introduces a 0 between successive samples. So, if you have x in as a function of n and you subject this to the action of up and 2. To produce x out as a function of n then x out of n shall be equal to x in at n by 2 for n a multiple of 2 and 0 else when n is not divisible by 2 or not a multiple of 2. So, let us illustrate this operator for example, suppose x in of n happens to be the following sequence. Let us take the very sequence that we have for y v 0. So, I have y v 0 n. So, you have 13, 25 by 2, 1 and 11 by 2 marked with 0. What will happen is that x in of n happens to be the x out n look like after up sampling by a factor of 2 firstly it will have 8 locations. So, it will be 11 by 2 then 0, 13 and then 0, 25 by 2 and 0 and 1 and 0 and 13 would of course come back to 0. So, this is how the up 2 sequence looks for the sequence y v 0. Similarly, we can construct y w 0 n up sampled by a factor of 2. Let us write that down explicitly. So, if we take y w 0 n and up sample it by 2 in the way we have done for y v 0 we get the following minus 3 by 2 0 minus 3 0 3 by 2 0 and 1 0 and 3 of course is looking for a factor located at 0. So, now we are in good shape you see what we now need to do if we think about it you see you want to reconstruct y of n from these 2 and for example, let us look at these 2 up sample sequences. So, this is the up sample sequence corresponding to v 0 and this is the up sample sequence corresponding to w 0. Now, how would we get the piecewise constant values from these 2 sequences? Well, let us take the example of the first 2 values here. The first value in the up sampled sequence of v 0 is 11 by 2. So, 11 by 2 and 0 and minus 3 by 2 and 0. So, if we simply added them you see you can see that if we simply added them let me put them together for reference you know. So, I will just suppress this for the moment and we just put them together just these 2 sequences. So, in these 2 half intervals now remember these actually correspond to half intervals here 11 by 2 minus 3 by 2 in other words when you add these that is 8 by 2 would give you the value of y t between minus 1 and half 4 and 11 by 2 minus of minus 3 by 2. In other words 14 by 2 would give you the value of y t in the interval from minus half to 0. So, what you need to do? You need to operate the sum filter this plus this for the first half interval. And this minus this for the second half interval let me write this down explicitly. So, you see it is interesting what we are doing here you must understand what is slightly different between the analysis in the synthesis filter banks. In the synthesis filter bank it is as if one filter operates for one sample and the other filter operates for the next sample and therefore, you could visualize a situation where you carry out both the filtering operations at once, but then allow this sample or the sample from the upper filter to pass in one instance and the sample from the lower filter to pass in the next instance and keep alternating in this way. How do we express this in the language of discrete time signal processing in the z domain? Well, let us draw the diagram first. So, what we are saying is this I have this sequence corresponding to v 0. So, y v 0 n and I have the sequence corresponding to w 0 y w 0 n I have up sampled them. Now, I also subject this this I subject to the filter 1 plus syrinverse remember this is the filter where the output b n and the input a n are related according to b n is a n plus a n minus 1 and here I subject this to the action of the filter 1 minus syrinverse. Well, I think it might be easier for us. So, you know what what we want to do? I think maybe it will be a little difficult to see this directly. Let me instead put it down as an operation of addition and subtraction directly. Let me make a little change in this. Let me say instead I have y v 0 n and y w 0 n here I upsample them add and subtract. So, now I get the outputs of upsampling. Now, I add and subtract. So, I have the sum of these outputs on one branch this plus this and this minus this on another this is the sum branch this is the difference branch and what I am saying is I pass the sum branch at one instance and I pass the difference branch on the next instance and remember this is operating at twice the rate you know. So, this upsampling operator needs to be located slightly differently we have to interpret this properly. We are saying essentially take the sum branch at the 2 nth point and the difference branch at the 2 n plus 1 point. So, let us write that down. Let us call this the 0.1 and the 0.2. Alternately take 1 and 2. Now, how do we express this using the upsampling operator that we have? Well, that is easy actually if we notice this upsampling operator can commute with this. So, you know it does not matter if you first upsample and then add and subtract or if you first add and subtract and then upsample. In fact, we would find it convenient to add and subtract and then upsample. So, let us replace this let us redraw this. So, we have a sum and difference branch here recall this is what we call a signal flow graph. In a signal flow graph we have nodes and we have edges. A signal flow graph is a convenient way of showing computation. You will recall that whenever you have a node at which you have multiple edges coming together the content of the edges is added together. It is as if each edge starts from its source node and goes to its destination node multiplying what it carries from the source node by the multiplier on the edge and deposits it at the destination node. So, the destination node any node which has edges coming into it is equal to the sum of all the deposits coming from the edges. And if many edges go out from a given node all of them carry the value of that node with them multiplied by the multiplier on the edge just the recapitulation of the signal flow graph notation. But coming back to this signal flow graph that we drawn here I have essentially these two nodes where two edges coming appropriately with multipliers. These are all multipliers of 1 and this 1 of minus 1 and now I put an up sampler of 2 here for convenience. And indeed what I want to do is to pass this as it is for the even instances, but this I wish to pass for the odd instances. So, how do I express that process of passing for the odd instances? I express that by delaying this by one sample on the up sample rate. So, here I need to put a delay operator in the z domain which is z to the power minus 1. What is the z to the power minus 1 do? It shifts this by one step forward. So, if you notice at the 2 nth point it is this which will come and this would come not at the 2 nth point, but at the next point the 2 n plus 1th point. And then you would have this together giving you the sequence that you desire the sequence corresponding to y which is y n. So, this is the synthesis process or the synthesis filter bank. It is interesting you know if you notice in the analysis filter bank we put down the filters explicitly and then had a down sampling operation. Here we seem to have the filters implicitly. So, you have a combination operation being done first essentially an add subtract kind of operation followed by an up sampler and then followed by some operation in the z domain. So, in fact what we have done without realizing it is also brought out an efficient way of implementing the synthesis structure. I told you somewhere earlier in this course that the hard multi resolution analysis and it is derivates that is the filter bank coming out of the hard and the other concepts that are illustrated from the hard illustrates several different ideas several different common concepts in multi resolution analysis very very lucidly. And this is one example here I have a beautiful decomposition of the synthesis filter bank into what is called its poly phase components lying ready for me right here. Now, this word poly phase we illustrate in greater detail later. What I am trying to say is that the structure that we have drawn here right here for the synthesis filter bank actually gives us an efficient way of computing or representing the computation of the synthesis filter bank. And if we will only take a minute to understand that this up sampling operation can jump back and forth you know can jump back and forth here. So, you know here when we drew this diagram we were not quite correct this is intuitively ok, but this needs to be corrected needs correction. In fact now we have the corrected version emerging from here and let us draw that corrected version by placing the up samplers back here remember the up samplers commuted with this operation here. So, if we do that we have the following structure y v 0 n y w 0 n up sample by 2 follow it with a sum difference operator, but remember there is a Z inverse there and this is what is added. So, you see if I if you like you can bring the addition here it does not matter. So, look at what is happening what is the operator acting on y v 0 what is the operator acting on this branch. This branch comes here with a transmission of 1 and this is the operator acting on like this and a transmission of Z inverse like this and this branch comes here with a transmission of 1 like this and a transmission of minus Z inverse like this. So, in other words what we have is the following structure with which we shall then conclude today's lecture and look more deeply in the next. The structure that we have is this we have an up sampler we have a 1 plus Z inverse operator coming there and a minus Z inverse plus 1 operator coming here and these are being added to produce y n. We shall delve further into this structure in the next lecture, but what we have just done a minute ago is to construct a synthesis filter bank for the Haar multi resolution analysis. We shall build this further in the lecture to follow. Thank you.