 A warm welcome to the 21st lecture on the subject of wavelets and multirate digital signal processing. Let us recall in a few words what we discussed in the previous lecture and put the lecture today in perspective. In the previous lecture, we had brought in the idea of the time frequency plane. We could think as we saw of the time frequency plane as a floor if you please, a two-dimensional surface and you used functions to put tiles on that surface, analyzing tiles or synthesizing tiles. What the uncertainty principle told you was the smallest size that a tile could have. When I say size, I mean the smallest area that a tile could have. Of course, depending on the units that one uses, one would have different values for that smallest area and all those limits ultimately come from the fact that the product of the time variance and the frequency variance must be greater than or equal to 0.25 or one-fourth. Now what we intend to do today and that is captured in the title that I have given the lecture today is to build two kinds of transforms in a more generalized way based on this idea of tiling namely the short time Fourier transform and the wavelet transform in general. So we wish to look at both of these from the perspective of tiling the time frequency plane. With that background let us go straight away to the first of these two transforms namely the short time Fourier transform. In fact, in some sense to replicate how things proceeded historically. You know when people realized in analyzing signals or in dealing with two domains simultaneously as we are trying to do that there is a basic uncertainty that hits you when you try to do something like that. The first thing that they thought of was the simplest namely if you cannot find out frequency components at a particular time you could probably find them out over an interval of time and the obvious way to do that is to chop to break the signal into parts into pieces take the Fourier transform of each piece. That is exactly what the short time Fourier transform proposed. Let us explain this mathematically. So when people talked about the short time Fourier transform they said they said well choose first a window function. Let us call that window function vt and we shall define the characteristics that we desire out of the window function. So essentially what we would want out of the window function is a finite time variance and a finite frequency variance. So let us write that down in mathematical terms. Finite time variance which essentially means you want t times vt to belong to L2r needless to say vt belongs to L2r that is taken anyway and we also want finite frequency variance and that means we want the derivative of vt to belong to L2r given of course that vt belongs to L2r. Let me just write that down for completeness. Now if we use this definition of a window function the most common window or the simplest window that we have encountered so far disqualifies. So the so called rectangular window the rectangular pulse in place of vt which we have been using as the scaling function in the R multi resolution analysis is disqualified. However, we shall take it as an extreme case an extreme case where one of these is not satisfied the other is. So in the hard multi resolution analysis we are using a so called window function for the scaling function or for that matter even for the wavelet function which has an infinite frequency variance. So it disqualifies from the point of view of frequency variance but it definitely qualifies from the point of view of time variance. Now with that little background we could also take other windows let us take a couple of examples just to give an idea. So last time we looked at the time frequency product of the triangular function that could be a possible window. So examples of windows could be the triangular window I will just sketch it the Gaussian window again let me sketch it a so called raised cosine window which looks something like 1 plus cos t over a limited interval that would have an appearance like this a raised cosine mind you at the two ends it would be 0 and it would have a maximum of 2 in between what you do notice commonly among all these windows is that there is a limit in time in spread and a limit in frequency in spread. Now for the raised cosine case I have not proved explicitly about this limit in frequency but in fact I leave it to you as an exercise to calculate the sigma t squared sigma omega squared product for the raised cosine window. So with that we have chosen a window and we as I said allow that extreme poor case of the rectangular window with which we built our concept of multi resolution analysis as well anyway with that background let us now use as tiles translates and modulates of this window. So what we do is to construct a continuum of the following kinds of dot products we have a function x t belonging to L to R and we have chosen a window v t the short time Fourier transform of x t so the short time Fourier transform is abbreviated often by s t f t. So let us use this abbreviation now onwards the short time Fourier transform or s t f t of x with respect to v as we shall call it s t f t of x with respect to v. So we have two arguments the function whose short time Fourier transform is being constructed and the window with respect to which it is being constructed now this is essentially the set of arguments which determine what short time Fourier transform we are constructing but there is also a pair of arguments for this transform which are the translation and the modulation arguments. So these are I would call the so called primary arguments of the short time Fourier transform and these one should call the secondary arguments to explain this idea of primary and secondary arguments let us take for example the Fourier transform. In the Fourier transform the primary argument is the frequency the angular frequency capital omega the secondary argument is the function whose Fourier transform is being calculated. So when you calculate the Fourier transform of x t the secondary argument is the function x the transform is the whole operator it takes this function x as a secondary argument and the primary argument is the angular frequency. So with that little explanation let us go back to the short time Fourier transform of x with respect to the window v evaluated this is how we would read it the short time Fourier transform of x with respect to the window v evaluated at the translation tau 0 and the modulation omega 0 let us write that down it would be essentially a dot product of the following a dot product or inner product of x t with v translated by tau 0 and modulated with e raised to the power j omega 0 t and how would this dot product look let us write it down x t multiplied by v t minus tau 0 bar e raised to the power j omega 0 t bar dt and if you please we could simplify this. Now a couple of words here if v t is a real function as we have been considering all this while whether it is the Gaussian or whether it is the raised cosine or the triangular function or if you like the extreme case of the rectangular window this complex conjugation is redundant it is not required if you look at it what we are doing here in an alternate sense is to first multiply x t by a window appropriately translated. So tau 0 is the location of the window essentially what we are trying is to extract information of x t around the point t equal to tau 0 and then we are taking a Fourier transform that is another way to interpret this. So short time Fourier transform is essentially a process of piecing or breaking the function into pieces followed by a Fourier transformation. Here we are assuming a continuous tau 0 and a continuous capital omega 0 and therefore we are talking about the continuous short time Fourier transform. Now let us invoke passable theorem to get a different perspective on the same expression here. So let us go back to the expression here we have taken a dot product of x t with a translated version of the window and then a Fourier transformation on this product. So for example if v t were to be a triangular window essentially it would extract the information of x t around the point tau 0 with some waiting done by the rectangular by the triangular function or the rectangular function. In the rectangular function there is no waiting in the raised cosine or the triangular or the Gaussian function there is a waiting different weights given to different points around tau 0 followed by a Fourier transformation. So looking at the frequency content in a certain region now if we invoke passable theorem on this what does it give us? Passable theorem says this is also the inner product of the Fourier transforms of x and v translated by tau 0 and modulated by capital omega 0. Therefore we need to calculate the Fourier transform of this quantity that is the task that we need to do. The Fourier transform of v t minus tau 0 e raised to power g omega 0 t can easily be seen to be the following. So it is minus to plus infinity v t minus tau 0 e raised to power minus well j omega 0 t multiplied by e raised to power minus j omega t integrated with respect to t. Now let us simplify this. So of course we employ the standard process of replacement of arguments. So let us replace the argument t minus tau 0 and noting that for a fixed tau 0 when t runs from minus to plus infinity lambda also runs from minus to plus infinity this would become integral from minus to plus infinity v lambda e raised to power j now of course collecting terms this is omega 0 minus omega times t which is lambda plus tau 0 d lambda. And now of course we have a simple answer there we can rewrite this a little bit taking out common terms. So you will notice that when we expand this product we have the term e raised to power j lambda not minus or rather omega not minus omega times tau 0 and e raised to power j omega not minus omega times tau 0 is independent of lambda. So I could bring it outside the integral. So I am saying this becomes e raised to power j omega not minus omega times tau not and the rest of it inside. And now let me see what remains inside what remains inside is v lambda e raised to power j omega not minus omega times lambda d lambda. So let me write that part down. So now here I shall write only the integral I have left out the other term that integral is essentially v lambda e raised to power I will rewrite it as minus j omega minus omega not times lambda d lambda which is easily seen to be the Fourier transform of v but evaluated at omega minus omega not instead of at omega. So all in all we have the following. We have the Fourier transform of v t minus tau not e raised to power j omega not t is the Fourier transform of v evaluated at omega minus omega not multiplied by e raised to the power j omega not minus omega times tau not and we shall substitute this in the passable theorem expression. So we have the short time Fourier transform secondary arguments of x with respect to the window v evaluated at tau not and capital omega not is essentially the following inner product with a factor of 1 by 2 pi remember. So it is x cap omega v cap omega minus omega not e raised to power j omega not minus omega times tau not d omega with this all complex conjugated. And let us simplify that in once again let us note that when we expand this we get two terms e raised to power j omega not tau not and e raised to power minus j omega tau not out of which only the second depends on capital omega the first does not the first can be brought outside the integral. So what we have in effect is e raised to power minus j omega not tau not times the following 1 by 2 pi just the constant x cap omega v cap omega minus omega not e raised to power j omega not j omega tau not d omega this is complex conjugated here here the complex conjugate has been taken care of as it is. And now we have a very beautiful interpretation for this this looks very much like an inverse Fourier transform if you think about it. It is the inverse Fourier transform evaluated at the point tau not inverse Fourier transform of what of the Fourier transform of x multiplied by the Fourier transform of the window shifted to lie around omega not. So now this makes a lot of sense the short time Fourier transform as we expected has an interpretation a very similar interpretation both in time and frequency. Let me put back before you the frequency interpretation first and then we will see how it is similar to the time interpretation that we had a few minutes ago. So the frequency interpretation is like this you know if you look at it this is essentially a constant term its magnitude is 1 this is again a constant 1 by 2 pi. So one need not pay too much of attention to these two terms essentially it is this integral which is important. In this integral what are we doing we are multiplying the Fourier transform of the function which is being analyzed that is x the Fourier transform is x cap of capital omega by the Fourier transform of the window shifted to lie around capital omega not. So we are trying to analyze the content of the Fourier transform around omega equal to omega not and we are doing so at the point t equal to tau not if you please because we are taking the inverse Fourier transform here. If you will just go back a few steps we had the expression for the short time Fourier transform in time let me put back that expression for you that expression is here what did we do there we did exactly a dual thing in time. So we had this is you see if you before we calculated we had this essentially as a time expression and with this time expression what we did was the following we multiplied xt by a translate. So we extract the information of xt around the point t equal to tau not and then took a Fourier transform at the point omega equal to omega not. This completes the beauty of duality in the interpretation we are doing exactly the dual of what we have done in time in frequency that is what we have said the operation is very similar in time and frequency it extracts a region of time and it also simultaneously extracts a region of frequency. So in a certain sense the short time Fourier transform was a very good idea when it came although when they use the rectangular window it was a bad idea and the rectangular window was not sufficient for that reason you had to taper off the window at both ends to make the function continuous. In fact all this is also the basis of the idea of windowed FIR filter design in discrete time signal processing people talk about designing finite impulse response filters using windows. Now the ideas that we have talked about here are also replicated there in a slightly different context but let me not go into that for the moment come back to this point. So short time Fourier transform is one way of tiling the time frequency plane. What are the tiles doing in the short time Fourier transform you must try and visualize them. So in the STFT we have shape types you may call them that fixed shape types tau naught is a movement along time and simultaneously omega naught is a movement along frequency or angular frequency if you please. So in fact I think it will be best to understand this graphically. What we are saying is we have this time frequency plane as we construct the last time and in fact the time frame is indexed by tau naught and the frequency frame the frequency region is indexed by capital omega naught different values. So at a particular tau naught and omega naught what the short time Fourier transform does is to extract information in a region of the time frequency plane spread around tau naught and omega naught where this is indicative of the time spread or twice the time spread of v and this is indicative of twice the frequency spread of v and what we are saying is we can visualize this think of this as a tile now and visualize this tile as being moved along this two dimensional plane you know. So forget about these axis for the moment just visualize that tile just visualize the plane underneath as the time frequency plane and this tile moving around for different tau naught and omega naught that is what we are doing. The shape is unchanged that is important we should mark here shape unchanged. Now in the same spirit let us look at the continuous wavelet transform. So we now going to introduce a more general version of the wavelet transform. So far we have been seeing a very specific kind of wavelet transform what we call the dyadic discrete wavelet transform. Then the scale parameter is changed in powers of 2. The translation parameter is changed by uniform steps the step depends on the scale. So if you look at the harm multi resolution analysis of course the scale is changed dyadically that means in powers of 2 and the translation is changed in steps of unity when you take the basic or the middle so called subspace v0 and as you go towards higher subspaces in that ladder the step size becomes smaller in powers of 2 steps as you go lower in that ladder the step size changes again by factors of 2 becomes bigger and bigger anyway. So we need to understand this from a time frequency plane perspective. So in general what is the continuous version of the wavelet transform the continuous version of the wavelet transform is essentially a dot product again. It is an inner product of xt now this time instead of a window we have a wavelet a translate and a dilate of a wavelet. So we take the wavelet psi we translate it by tau 0 and we dilate it by a factor s0. Psi is a wavelet now what on earth do we mean by that what in general is a wavelet in fact we shall indirectly postpone the answer to that question for a while until we complete this discussion on the continuous wavelet transform. So what qualifies as a wavelet is a question that we need to answer well we know examples of functions that qualify as wavelets with tongue in cheek we will say the Haar function qualifies as a wavelet I said tongue in cheek because actually it has an infinite frequency variance. So we have trouble there but anyway as I said tongue in cheek but we know better examples of wavelets we know the dobash wavelets for example may be more difficult to construct but nevertheless there for us and we have a whole family there of the dobash wavelet. So we have examples of wavelets you know which are restricted in time and restricted in frequency. So one thing that we very clearly understand is that the wavelet function needs to be restricted in time and restricted in frequency it needs to be a window function in some sense but just any old window function are that we shall take some time to answer anyway. So for the moment leaving open the question of what qualifies as a general wavelet let us come back to this inner product here we are taking to construct a continuous wavelet transform and inner product of xt with this wavelet function dilated by s0 and translated by tau 0 of course s0 must be non-negative. So the way to write it is s0 belongs to R plus this plus means that s0 is a positive real number excluding 0 and excluding all negative real numbers. Let us write that inner product down for ourselves so we are saying this now again here we need to exercise a little bit of caution you see if we use this as it is then we have what is called the problem of normalization this problem of normalization did not come in the short time Fourier transform because when we modulated and when we translated in time the norm of the function was unchanged but here when we dilate then the norm changes and we need to take care of that. So we need to normalize and that I leave to you to prove can be done by multiplying by a factor of 1 by square root of s0. So if we take 1 by s0 positive square root times psi t minus tau 0 by s0 then it is normalized alright it has a norm equal to the norm of psi t. So this has the same norm as psi t without the translation and dilation anyway. So let us construct this dot product the dot product becomes integral x t psi t minus tau 0 by s0 dt with a complex conjugate on this. Now of course if psi t is real then the complex conjugate is redundant and that is what we have been doing in all the real wavelets that we have been using ignoring that complex conjugate. Now let us interpret this also in the frequency domain sets what are we doing there let us use passable theorem again this is also equal then to the inner product of x cap omega with the Fourier transform of psi t minus tau 0 by s0 and let us evaluate this the Fourier transform of t minus tau 0 by s0 of course normalized with this and here again although I did not need it inside the integral sign I should keep the 1 by s0 to the power of half outside the integral sign. So I must bring in the factor here for completeness let us evaluate this. Now the Fourier transform of 1 by s0 square root psi t minus tau 0 by s0 can be calculated as false we will do it in two steps we will first go from psi t to 1 by square root s or square root s0 psi t by s0 and we will make use of the property of the Fourier transform pertaining to scaling the independent variable. So we make use of that property. So it is very easy to see that the Fourier transform of 1 by s0 to the power half psi t by s0 becomes s0 to the power of half psi cap s0 omega. So because of the normalization the 1 by square root of s0 here and the 1 by s0 becomes square root of s0 here and s0 there and of course remember s0 is positive in real. So we do not we do not need to worry about the sign a modulus is not required. Now if you wish to find the Fourier transform of 1 by s0 square root psi t minus tau 0 by s0 all that we are doing is to replace t by t minus tau 0 and that amounts to multiplying in the Fourier domain by e raise to the power minus j omega tau 0. So we will do exactly that therefore we have the Fourier transform of psi t minus tau 0 by s0 into 1 by s0 square root is square root of s0 psi cap s0 omega multiplied by e raise to the power minus j omega tau 0 and we put this back in the expression that we had for the continuous wavelet transform. Remember the continuous wavelet transform is a continuous function of the translation tau 0 and the scaling s0 s0 is only positive real tau 0 is both negative and positive real let us emphasize that. So let us write both of these down and let us introduce notation here the continuous wavelet transform which we shall abbreviate by cwt and here again it has primary and secondary arguments. So cwt will have the secondary arguments x and psi and the primary arguments tau 0 and s0 and this reads as the continuous wavelet transform of the function x which presumably belongs to L to R with respect to the wavelet psi evaluated at the translation tau 0 and the scale s0. So this quantity cwt of x with respect to psi evaluated at tau 0 and s0 is either if you wish to look at it that way the dot product of xt with psi t minus tau 0 by s0 normalized with 1 by s0 either this or as we have just seen using passable's theorem the following of course with a factor of 1 by 2 pi. So let me keep that factor of 1 by 2 pi here this is of course complex conjugated. So I need to rewrite this a little bit there is a complex conjugate here in general I have taken care of the complex conjugate here by replacing the minus pi of plus. Now this has a very interesting interpretation provided we recall the nature of the Fourier transform of psi from the examples that we have seen so far. You will recall that if we considered the Haar wavelet for example psi t was a band pass function. In fact just to recall let me put down the magnitude pattern of the Fourier transform of psi t in the Haar case recall the Haar case it had a magnitude Fourier transform which looks something like this it had the first null at 4 pi and subsequent nulls of side lobes at all multiples of 4 pi beyond and the main loop essentially was a band between 0 and 4 pi. So it was a band pass function by a band pass function I mean it did not have a non null Fourier transform at 0 as omega tends to infinity again the Fourier transform b k is towards 0. So the Fourier transform magnitude is 0 at 0 0 at infinity and maximum somewhere in between it emphasizes a band of frequencies we saw that explicitly in the case of the Haar function. I encourage all of you to explicitly calculate the Fourier transform of the Dabash 4 wavelet for example to be interesting to do it has to be done numerically and verify that that would also have this band pass character. So we see the trend in these so called wavelet functions they have a band pass character and if we allow that interpretation then what we have written here has a beautiful meaning it means that we are multiplying the Fourier transform of x with a band pass function scaled in the Fourier domain by the factor s naught and we are calculating the inverse Fourier transform of the same of course this factor of square root of s naught is here to normalize. Now if you accept that psi is a band pass function then what you are doing here is essentially to extract a region of frequencies in the Fourier transform of x which lies around the appropriate dilate of the Fourier transform of psi and you are calculating the inverse Fourier transform the inverse Fourier transform this integral after multiplication by e raised to the power j omega naught omega tau naught with respect to omega essentially means the output after doing this work in the frequency domain. So what we are saying in effect is the following we are saying that in effect if we accept that psi is a band pass function then the interpretation is as follows in the continuous wave let transform we are taking x we are passing it through a band pass filter whose impulse response is essentially 1 by s naught square root psi t by s naught well if you like one should complex conjugate this because you are doing a complex conjugation there as well so you complex conjugate this and strictly you should also put a minus sign here because this is this would be the inverse Fourier transform when you complex conjugate in frequency and then scale by s naught the output is the C w t as a function of tau naught the scale s s naught. So at every scale there is a different filter you have a continuum of filters indexed by s 0 for every scale s 0 there is a different filter it extracts information in x cap around the center frequency appropriately scaled by s 0 and the band is also scaled remember when you scale the center frequency you also scale the band recall all this discussion in the hall now we are doing it for a general band pass function and that inverse Fourier transform is operated by tau naught. So you are calculating the output at each point tau naught this is the interpretation of the continuous wave let transform. Now based on this interpretation and based on what we understood as the interpretation of the short time Fourier transform we shall go to the inversion of these two transforms in the next lecture. So with that then we come to the end of this lecture where what we have seen is essentially the definition and the interpretation of the short time Fourier transform and the continuous wave let transform. Thank you.