 Hello and welcome to this next lecture in the series on the topic of wavelets and multirate digital signal processing and the topic which deals with joint time frequency analysis in broader perspective. This particular lecture is titled as wavelets applications and we are going to run through few significant applications which makes wavelet transform extremely useful which makes the USP of wavelet transform. However, before starting that journey we are going to do a small recap of what we have done so far. In last three to four lectures we posed few significant questions and in a way we also try to answer those questions. Let us have a quick recap of what we have done so far and then we will start our journey towards solving few of the critical problems when it comes to practical applications of wavelet transform. So, quick recap we started our journey by saying that wavelet transform in a way decomposes signal into two separate series. A single series that would represent the approximations and that would actually emerge out of the underlying scaling functions phi of x and the double series to in a way represent the details the refined version of the signal and this is high pass filtering and this gets originated out of the underlying wavelet functions or psi of t or psi of x. However, the moment we started dealing with the two band Har filter bank structure we realized that it is very easy to move down the ladder because in a way we have to simply throw away the details and then we pose this challenge that can I build a framework using which I can think of moving up the ladder go on adding up the details and really go tantalizingly close to the actual signal or function under consideration for analysis. And we build that framework and that framework actually gave us power to actually move up the ladder and moving down the ladder is anyways pretty simple. So, now I can move in both the directions and in a way I can now say that now I indeed can zoom on or zoom out of any part of the underlying signal and this makes the entire analysis scalable and the scalability stems out of the underlying multi resolution framework. The whole framework in a way is based on this beautiful mathematical equation that we already seen this is a scaling equation of phi of t square root of 2 is the normalizing factor we are summing it over k where k is the translational parameter and h of k are the coefficients of scaling function. And then this function is at the heart of the entire framework of multi resolution analysis and that is because we realize that phi of t is indeed phi of 1 t and 1 essentially means 2 to the power 0 and then I can say this function belongs to a subspace v of 0. We also realized that on the right hand side we have phi of twice t minus k and twice t in a way indicates 2 to the power 1 and this function indeed belongs to a subspace v of 1 and that gave us this beautiful property and that tells us that v 0 is a subset of v 1 and so v 1 contains something that v 0 does not have and that additional part is indeed the details present in the signal and those details are in a way captured by the wavelet equation psi of t. And so we looked at psi of t and g of k are the coefficients of this psi equation and again we did the same analysis that phi of t has phi of 1 t and it indeed belongs to w of 0 and this function once again belongs to v of 1 because I have 2 to the power 1. And then this once again conveyed the same fact that indeed v 0 is a subspace of v of 1 and by virtue of adding these 2 factors by virtue of adding v of 0 and w of 0 by the way this is an orthogonal addition I can indeed move to v of 1 and this is something which is of great significance because this helps us move up the ladder. I can indeed find out the projections of the signal in w subspaces add those details into approximations and move into a higher subspace very important very significant. However, the same equations are recursive and the same equations can also be written down in this form for example, phi of t by 2 and then I have phi of t. So, I have t by 2 that is 2 to the power minus 1 and this would indeed belong to then v of minus 1 and phi of t minus 1 t minus k would then belong to v of 0 because I have 2 to the power 0. And correspondingly this would belong to w of minus 1 and this once again belongs to v of 0 and that conveys again the same underlying message the same current the same theme and I can once again go on adding up v of minus 1 and w of minus 1 orthogonally to generate projections in v of 0. What this essentially tells us is the strong framework composed of underlying nested subsets and these subsets can be represented like this. And now it does not really matter in which particular subspace I am starting my analysis for example, I can again think of starting in v of 0 by virtue of using this framework I can very easily move either down the ladder and that will make the whole presentation coarser and coarser and ultimately lead us to a null subset a tree well subset and I can also go on moving up the ladder and achieve the L 2 r norm as we have seen while studying the axioms of multi resolution analysis. This was the framework that we wrote down if j of x belongs to v of j and if my analysis scale that is analysis window is 1 upon 2 to the power j then in order to be able to span these subspaces I would require this particular basis function. And this factor 2 to the power j by 2 is used for normalization and now I can very well say that my orthogonal basis is now orthonormal. And I can very well find out f j of x which are the projections of underlying function f of x into that subspace v of j and it is a linear subspace. So, I can apply super position theorem and this addition over k which is my translational parameter would help me find out these projections. The main question is how do I find out alpha values which are the approximation values and I have this integration formula. So, integration between the function and the orthonormal basis and that will help me find out the alpha values which are the approximation values. Correspondingly we looked at the test signal because we wanted to indeed find out whether this actually works or not and we looked at this particular test signal f of x which exists only between 0 and 3 and between 0 and 3 f of x is equal to x and it is 0 elsewhere. And this signal looks like this a simple good looking linear function. And the moment we calculated the projections of this f into v of 0 we had the analysis window from 0 to 1 and we calculated the values of alpha 0 0 0 1 and 0 2 and correspondingly we were able to generate these projections. In the last to last lecture we also calculated the projections in W 0 which we named these projections as G 0 of x and we calculated corresponding beta parameters and once again the analysis window is of length 1. So, between 0 and 1 1 and 2 and then 2 2 3 and finally, we are able to do the orthogonal addition of projections in v 0 and W 0 to generate projections f 1 of x into v 1 of x v 1 and indeed these projections in v 1 are much much better much much finer compared to the projections in v of 0. And we know the reason the reason is we added these details in these projections in v of 0. So, this indeed worked and we also did MATLAB simulation we went on adding the details and then we realized that this is dyadic scale and I can go all the way till v of 10 or v of 20 and if I mean v of 20 the analysis window will be 1 upon 2 to the power 20. So, we are talking about a very very small window and to what value we can go we can actually move to any value of our choice. It boils down to how close we really want to go as far as the representation of the underlying signal is concerned and from the slides we can clearly sense that this is indeed moving very close. However, that led us to two important questions how do we go about selecting the mother wavelet and the scale of analysis and what is the procedure to calculate the scaling and wavelet coefficients. We in a way answered these questions we took the first question that how at all one should decide which mother wavelet should be used for what kind of an application for what kind of an analysis and to answer this question we invoked the very concept of vanishing moments and then we realized that vanishing moments they play very significant role in selecting the mother wavelet and we brought out this concept of vanishing moments through correlation and for that matter we revisited how exactly the Fourier transform works and then we realized in order to be able to find out the frequency content in any underlying signal a stationary signal like this we do correlation between the signal which is shown in red with the underlying basis function for example, the basis function shown is cos of 8 and it is all about finding out the correlation by the dot product. And the dot product gave us all positive values with very minimal negative values and when I integrate this green part green area then indeed I will generate a peak at a frequency of 8. So, we realize this concept of correlation is important and then we thought of bringing in this concept to define moments and we define moment of order m of given underlying function f of x on interval from a to b like this and this is once again a dot product between x to the power m and f of x a correlation dot product. And we realize that this indeed is of great importance and to bring out the significance of vanishing moments we looked at a particular example a particular application where we wanted to detect the hidden jump or hidden discontinuity. We started off with this function g of t and we can clearly sense that there is a discontinuity or a jump at t is equal to 0.5 and the function looks like this and at 0.5 there is a clear jump. However, such functions are easier to analyze the discontinuity can be sensed even with the naked eye. And so, we thought of complicating the matters little and we did the integration of this g of t and we generated h of t and then we realize that the clear jump has been converted into a cusp jump at time t is equal to 0.5 and now my h of t indeed looks like this and still there is this cusp jump. So, we thought of complicating the matters even further and we did the integration of h of t to actually find out f of t. And now this f of t is very smooth and at least with naked eye we cannot sense the presence of discontinuity or a jump. However, we realized that at second derivative of this function there exists a problem at t is equal to 0.5 and then we pose this question that can I select an appropriate mother wavelet to indeed find out that hidden jump or hidden discontinuity. And that is where the concept of vanishing moment really became very important because the moment you are doing integration or low pass filtering and the moment you say that my function now appears smooth. And if at all you want to find out the discontinuities it is a property that is associated with psi that is wavelet functions. Just a quick reminder that phi functions or the father functions are low pass filters and psi functions or wavelet functions are high pass filters because they do differentiation. And indeed if at all I want to find out this hidden discontinuity I will have to invoke the underlying psi function wavelet function, but which of them because once again we also saw in the last lecture that in case of Fourier transform the basis is known e to the power j of a variable it could be a frequency e to the power j omega. But when it comes to wavelet transform we have choice of selecting mother wavelet and so we pose this problem in the light of indeed finding out the hidden discontinuity. And then we realized that since the discontinuity lies at the second derivative I should at least select my mother wavelet with m 0 and m 1 getting vanished at least the zeroth moment and the first moment should get vanished. And that is because then I can think of doing the correlation for the second derivative and all the derivatives which are greater than order of 2. We invoked the wave menu the wavelet toolbox in matlab and then we realized in case of Haar wavelet which is dobash 1 this discontinuity is not sensed and that is because in case of Haar only the zeroth moment vanishes and so this discontinuity is not sensed. We did the same exercise with dobash 2 and since dobash 2 has m 0, m 1 these vanishing moments and which is badly needed to find out the discontinuity which is of the order of second derivative now we are able to sense and detect this particular discontinuity. We also did analysis with dobash 3 and then we realized that using dobash 3 the discontinuity was brought out even more prominently. From the slides we can once again see that we posed second important question. Once we realized that we have understood how to go about selecting the mother wavelet then the second important question is what should be the scale of analysis scale 1, scale 2, scale 3 and where exactly should I stop? Well honestly speaking there is no formal mathematical proof to this particular question. However, there is a thumb rule and the thumb rule says that the moment you lose more than 70 percent of the energy in your original signal one should typically stop doing the further analysis. That means you have lost enough information and probably you have brought out the approximations and details to a level where you can indeed find out the trends as well as the refinements. However, the third question was pending and from the slides we can once again sense the third question and the third important question was how to calculate the scaling coefficients and wavelet coefficients. This was one serious important question and we in a way answered this question. If you remember in the last lecture we said it is very easy to design your own wavelet but it is very difficult to design a useful wavelet. I can take a sine wave and I can cut it so that I am left with only the first period of that sine wave and that is a wavelet. I am letting that wave die out and so I have the restricted good compact support and it is a wavelet. It is hardly of any use. So, it is easy to design your own wavelet but it is very difficult to design a wavelet which is useful and so understanding how to find out the coefficients of scaling equation and wavelet equation is of great importance. We in a way rushed through this particular part in the last lecture. So, let us quickly also revisit that part and then we will move on to couple of important applications of wavelet transform. We have been using Haar mother wavelet and Haar scaling equation and we typically know how these two equations and functions they actually look and I can go about normalizing these values and this will be 1 upon square root of 2 minus 1 upon square root of 2. However, the important question is how Haar was able to find out these values. So, that is the important question and what properties these coefficients should obey so that they will be of some importance some significance. Now, referring back to the framework we can clearly sense that phi of twice t gives me phi of t as well as psi of t or in other words I can say once I calculate the coefficients of phi that is enough using these I can very well calculate coefficients of psi. So, this design of finding out the coefficients of phi and psi eventually boils down to just finding out the coefficients of phi because once I have these coefficients of phi I can very well calculate the coefficients of psi and it is quite evident from these two equations. So, the problem becomes the problem of searching for the scaling equation coefficients and then we can use this formula where once h of k are calculated g of k can be calculated like this minus 1 raise to k h of 1 minus k. It is very easy to actually show that this formula indeed holds true. So, now problem is very very clear we need to find out h of k values and then we pose this question that what different properties the coefficients of phi of t should have and then we also listed down those properties by virtue of looking at three important guiding theorems. The first guiding theorem essentially tells us that we are talking about the nested subsets and we are talking about the scaling equation which is indeed of finite duration. So, phi of x certainly has a compact support and outside this compact support it does not exist. So, theorem 2 in a way told us that for this phi of x which has a compact support I can very well find out finite value of this capital N that is the length of this phi of x and in a way this length is going to give me length of psi of x and length of psi of x is going to give me vanishing moments. So, this is of great importance and then we saw theorem number 3 which in a way talks about the discrete orthonormality of the sequences. So, this is of greater importance. Now, these were the properties that we derived last time 1, 2, 3 and then 4 to 6 and as first 4 properties 1, 2, 3 and the fourth one they predominantly are dependent on the normalizing factor. Property number 5 and 6 it emerges out of the fact that we are strictly talking about orthogonal and in fact orthonormal basis. And then we started our journey towards finding out these properties. For deriving property number 1 which is summation of all the scaling coefficients should be equal to square root of 2. We started once again with the scaling equation. We integrated both the sides and then we took out this summation part outside the integration and then we realize that this phi of twice t minus k can be written like this. One can substitute twice t minus k is equal to x for example and solve this. Very quickly we can show this and we actually showed this in the last lecture and then we use this normalization unit. We said when I integrate phi of t from minus infinity to plus infinity it should go to 1. Just a quick reminder if I am integrating psi of t that is my wavelet function it should go to 0 and that is the basic property of any wavelet. However, what phi of t should accumulate to this is called as normalizing factor and we can go about deciding this normalizing factor. And we have selected purposely this normalizing factor to be 1 because that gives us a constant of square root of 2 and square root of 2 traditionally has great significance. It is used in finding out the root mean square values. Square root of 2 also tells us roughly at what point the 70 percent energy would get consumed. So, this normalizing factor is also important in deciding the scale of analysis. Once we decided this normalization parameter then it was easy to actually plug in this into this formula. And then I already have the square root of 2 factor which comes out of the normalizing 2 to the power j by 2 parameter. And I can very well prove that summation of h of k should go to square root of 2. Now, deriving property number 5 was indeed challenging and we once again started of a scaling equation and by virtue of doing some mathematical jugglery that we did in the last lecture we will just skim through we will not go through each and every single step. And by virtue of doing this analysis we are able to finally prove that this would boil down to delta L 0. And this is indeed discretized version of orthogonality. And by the way not all the scaling functions are orthogonal in their nature. And we are going to see one example. But before that once we derived property number 5 it was easy to derive property number 4 because it is a specialized version of property number 5. And we are able to show this pretty quickly. Now, to find out property number 3 we did a small trick of dividing this equation into odd parts and even parts. So, twice k plus twice l as we saw in the last lecture is the even part and twice k plus 1 plus twice l is the odd part. And by virtue of having this going to be equal to 1 we are able to do the rest of the analysis. And because this is equal to 1 we could say let us say this even part goes to some constant let us say a. And this odd part goes to another constant let say b. And it was required to find out these two constants a and b. We have two constants and there is only one single common equation I can plug in a and b into this. And I would get 1 is equal to a square plus b square. So, this is one equation and there are two unknowns. And so we wanted one more equation. And we are able to generate that equation by looking at property number 1. And we once again split h of k into even and odd parts. And then we got the second equation a plus b to be equal to square root of 2. And this is a very special situation to be in because this is indeed equation of a circle. And this is equation of a straight line. However, they share a very special chemistry between each other. And then we saw last time that we are talking about a circle of radius 1. So, this is a unity circle. And this line is a tangent. And there is just one single point which is common. And that point exists at 1 upon square root of 2 and 1 upon square root of 2. So, both a and b values were calculated to be 1 upon square root of 2. And then once we plugged in the values of b and a, property number 3 and 2 were calculated. So, this is how we completed our journey. We did the verification of these properties in case of r. And first three properties were very easy to actually prove. Property number 4 was also comparatively easier to prove. However, property number 5 gave us great insight. And after solving through for property number 5, we realized that this is indeed the property that brings out discrete orthogonality. And like we said before, not all the functions are orthogonal. For example, if we see the roof scaling function whose formula goes like this. And if we apply the fifth property once again for the first translated version. So, we are taking a dot product between phi of x and phi of x minus 1, then this does not go to 0. And we can also see that graphically there is some amount of overlap. And because of this overlap, this dot product is not going to go to 0, because this overlap is in positive direction. And so, roof scaling function is not orthogonal. And it is very important to maintain the orthogonality, because only then we can claim that the two band MRA structures would be complements. And we can guarantee the power complementarity. And we can then also guarantee magnitude complementarity. So, in a way, we answered these three important questions. And now based on this, let us work out couple of applications of wavelet transform, which are of practical importance, practical significance. We have already seen one application, where we detected the hidden discontinuity. Now, that was the application where we relied heavily on the wavelet function. But if you remember, unirate DSP is all about designing filters and multirate DSP is all about designing filter banks. So, along with that high pass filter in psi function, we also have a low pass filter in phi functions. So, the second application is in a way dependent on the nature of phi function. So, from the slides, the second application is about suppressing the polynomials towards denoising the underlying signal. And in order to work out this particular application, we are going to invoke one MATLAB program. And it is a simple MATLAB program. So, we have specified the signal to noise ratio. We have also provided the initialization for the random seed. And then, we are generating a signal, which is the reference signal shown as x reference. And then, we are also adding noise, which is white Gaussian additive noise. And we are also generating x. So, x is the reference signal plus the added noise. And the noise is white Gaussian noise. And we are going to save this signal as test underscore signal underscore polynomial underscore noise. So, let us run this. So, this is how the original signal looks. And the moment you add noise on top of this, this is how the corrupted signal looks. And it is very difficult to actually see the underlying signal. The signal to noise ratio selected is 4. And so, it is good enough strength that in a way disturbs my underlying signal. And not all the details are visible. And there is a need to actually clean up this signal, so that I can bring out the underlying characteristics. How to do that? We have saved this signal with this name. So, let us once again invoke the wavelet toolbox. And once again, this is a one-dimensional application. We have signal, which is one-dimensional. And let us load the signal that we have generated. So, this is the signal. And this is how it looks. It is indeed noisy. We can see that. We can sense that. Now, typically a signal can be looked upon as a polynomial. And if the degree of the polynomial is 2, then it goes without saying that if I have a polynomial of degree 2, then db2 won't be able to do the neat analysis of that polynomial. And that is because we have already seen that the second derivative still exists. Or in other words, the moment corresponding to the second derivative does not vanish. I can very well do the analysis with db3. And then the second derivative is fine. I can also invoke the third derivative. And that is one serious important property that needs to be taken into account while doing the analysis. Now, let us start the analysis once again in db1. And db1 is indeed har as we know. And we know in case of har, only 0th moment vanishes. And as a result of that, if we focus our attention on d3, d4 and d5, well, hardly anything gets suppressed. From db1, we will move on to db2. And again, it is not very satisfactory. However, now if I invoke db3, now this is something which is of great importance. From at least d5 and d4, we can sense that things have started getting suppressed as far as the polynomial is concerned. And if this happens, then eventually what we will be left with is going to be suppressed. I am suppressing the whole of my polynomial. And I am left essentially with just the noise. And since this is an additive noise, I can also do the subtraction. And I can subtract this noise from the original signal to indeed retain back, generate back the original signal. So, let us do that exercise. And let us convince that indeed it will be possible to do denoising of the signal. We have once again selected db3. And the level selected is 5. We have selected the soft threshold. And now, if we denoise, then you can clearly sense that correspondingly, the residuals will be generated for the selected threshold values. And this is how we can get back the original signal. We started with this signal, which is indeed polluted. And we are able to generate back this signal. And many of the details are neatly restored, if you see here. To what level you want to restore your details, that is a matter of once again selecting the appropriate wavelet function and the corresponding father function or the scaling function. Now, once again from the slides, let us go back to another application that we want to study and understand. We have seen two one dimensional applications. And now, let us delve into adding up one more dimension. Let us look at a two dimensional application. And we will typically look at the compression and pattern recognition applications. As far as two dimensional or one dimensional signal or image analysis is concerned, typically the basis function that we try and generate should be of unitary nature. And only then we can guarantee two serious important qualities and properties. One is energy compaction. And second one is energy conservation. We should be able to preserve most of the energy. And whatever energy we have with us, we should be able to compactly represent. Only then we can achieve compression. Typically the formula of unitary matrix looks like this. And if I have a matrix which is A and if A inverse is equal to A transpose, let us keep it simple. Let us say I am talking about matrix which has all real entities and no imaginary part. Then A inverse is equal to A transpose in a way ensures that my matrix is unitary. And if my basis matrix is unitary, it guarantees decorrelation of the information. And once we decorrelate the information, we can guarantee energy preservation and also energy compaction. This is one example of 2D discrete cosine transform. This is a well known image of a cameraman. And by virtue of doing this kind of an operation where x is my input and c is my transformation matrix, then output y can be generated as y is equal to c into x into c transpose which is equal to c into x into c inverse, because this is now unitary. And there are only few coefficients which are non-zero. And essentially what I can do is, I can put a threshold value and I will retain only those coefficients which are significant and probably suppress all others. This will definitely bring out compaction, but this will also preserve most of my energy. Now, let us pose this important question. Can I preserve energy using wavelet transform W t? So, let us pose this question and let us try and answer this question quickly by using some sample signal x of n, let us say 3, 2, 5 and 1. So, there are only 4 elements and let us say this signal belongs to subspace V of 2. Now, I can very well calculate the approximations and let us call these approximations as a 1. And I can find out these approximations which would belong to V of 1 and I can also calculate the details and let us call them as d 1 and these d 1 details would belong to obviously W of 1 as we typically know. For doing the analysis, let us once again use Haar scaling and wavelet equation. And let us say we are using the normalized version. So, my h 0 is going to be equal to h of 1, it is going to be equal to 1 upon square root of 2. So, these are the coefficients of scaling equation. And as far as wavelet equation is concerned, let g 0 be equal to 1 upon square root of 2 and let g 1 be equal to minus 1 upon square root of 2. And then we know how to calculate a 1, there is a disseminator. So, I will have to do calculations between 3 and 2 and then 5 and 1. So, between 3 and 2, once again 3 into 1 upon square root of 2 plus 2 into 1 upon square root of 2. So, once I do that, I will end up with 5 square root of 2 divided by 2 and 3 square root of 2. And as far as details are concerned, I will have to make use of g 0 and g 1 and then I will be left with these two parameters. Now, if I calculate the energy in a 1, let us call it as E of a 1, then that is going to be 5 square root of 2 by 2 square plus 3 square root of 2 square. So, that will be equal to 61 by 2. And energy in details is going to be equal to, which is going to be equal to 1 by 2 plus 8. So, that is 17 by 2. And now, if we try and find out how much of energy is stored in details, if we pose this question, then that is going to be probably 17 upon 17 plus 61. And this is approximately 22 percent. So, almost 22 percent of the total energy in my underlying signal is stored in the details. And that is because this signal is fairly rough. There are transitions from 3 to 2 to 5 and then 5 to 1. So, fairly rough looking signal Now, as against this, if we consider a case of yet another signal, which is much more smoother, let us say x 1 of n, which looks like this 4, 6, 10 and 12. Then indeed, the details will be, let us say once again this belongs to V 2. And the details, these are the approximations. And the details will be, now these are same values. And that is because the difference between 4 and 6 is same as the difference between 10 and 12, as can be seen. So, this indeed gives us the detail values. And now, if I calculate E of A 1, it comes out to be 292. And if I calculate the energy stored in details, it comes out to be 4 plus 2 plus 2. So, basically 4. And now, if I want to calculate what is the percentage of energy stored in details with reference to the entire energy, then it boils down to 4 upon 292 plus 4. So, close to 1.4 percent. So, for smooth signals, most of the energy will be stored in approximations. And for fairly rough looking signals, where for example, you could be talking about a textured image, the energy distribution is in a way E 1. Although, most of the energy will always be retained in low pass quotient, which are the approximations, the details in case of fairly rough signals would also have fairly good amount of energy stored in them. Now, keeping this in our mind and realizing that indeed energy gets preserved in case of wavelet transform. Now, we can carry out two important tasks. The first task is going to be the task of denoising 2D toy image. And the sample image that we are going to play around with looks like this. It is some 4 by 4 part in the image. And let us say, I have her unitary matrix with me, which typically looks like this. So, 1 and 1 is my low pass part and 1 and minus 1 is my high pass part and this is for normalization. So, what we are going to do now is first of all find out. So, step number 1 will be to find out S in horizontal direction, which will be equal to S into A. And then 2, I am going to calculate S of H v horizontal and vertical direction, which will be equal to A into S of H. So, that is the plan that we have with us. And when we calculate S of H, which is equal to S into A, it turns out to be this fairly easy to calculate. For example, S into A, so we are talking about the row and the first column. So, 9 plus 7, because 9 into 1 plus 7 into 1, that is 16 divided by 2. So, that gave us the first element to be 8. So, that is how we calculated this. And then in order to find out S of H v, we have to do A into S of H. And this essentially gives us this matrix. And now, it is very interesting to understand how this typically looks. For example, if you sense these four coefficients 6, 1, 2 and 0. And if you see the original image and if you focus on these four elements 9, 7, 5 and 3, then indeed these four elements are responsible for generating this matrix. So, this matrix is a decomposed version of 9, 7, 5, 3. How? That is the question. It is very interesting to see what is really happening here. Keeping this in mind, we can clearly sense that indeed 6 is equal to 1 upon 4 into 9 plus 7 plus 5 plus 3. So, this is the low pass element. I can very well think of 2 to be like this. And what does this indicate? 9 minus 5 is 7 minus 3. That essentially indicates we are talking about the average of the differences in rows. Correspondingly, I can also say that 1 is indeed equal to 1 by 4 into 9 minus 7 plus 5 minus 3. So, this is an average of the difference in columns. And then 0 is equal to 1 by 4 into 9 plus 3 minus 5 plus 7. So, this is the average of difference between the diagonal elements. And so, these coefficients, they have great importance, great significance. And they are going to take us to how to build the final matrix and how to find out the final matrix when it comes to transforming the underlying image into a wavelet space. So, as far as finding out the transformed version is concerned, we can very well say from this particular matrix that we have already generated, I can very well sense that the analysis that we have done for this particular block is true for all the 4 blocks. And then 6, 4, 4 and 2, these are indeed the low pass coefficients. And I can bring them together. And probably I can say this is indeed going to look like a beautiful culmination of the thought process that we started with multi resolution analysis. I want to segregate the low pass and the high pass information. And then probably what I will say is if my S of i, so what we have done here is interesting. We have indeed calculated the transformed version of the original image that we wanted to analyze. And just like this particular matrix, we can also do a similar analytical understanding of the rest of the 2 by 2 matrices. And we will realize that 6, 4, 4 and 2, these are indeed the low pass values or the approximated values. Now if I want to take this analysis to next scale, then I will have to really focus on the approximation values 6, 4, 4 and 2. And let us do that. By the way, the reason as to why at all we want to do this is because if we have signal of x of n, then we have studied in multi resolution analysis that after doing low pass filtering and high pass filtering along with the decimation, we do not touch the high pass problem. Instead, we take this low pass branch because this contains maximum energy and then we split it up once again. So, we are going to segregate all the approximated values and we are going to call that as S of i. So, what I will have is 6, 4, 4 and 2. So, I am talking about only these values 6, 4, 4 and 2, only the approximated values. I am going to call this matrix a 2 by 2 matrix as S of i. And if I do multiplication of that with a and typically we know how 2 by 2 a would look, then it will be like this. Then what this product between S of i and a is going to give us? That is of great importance because that is indeed going to take me to next scale in my analysis. So, S of i into a is indeed going to give me and I will have to once again do because this is only in horizontal direction. So, I would call this as S i of h and then if I want to do it also in vertical direction, then a into this. So, a is like this into this matrix and this is going to produce 4, 1, 1, 0. And now using this information, if I want to finally write down how the matrix is going to look, then in the wavelet domain and let us call that matrix as w. This is the original signal that we wanted to analyze. And so I can very well write this down in an interesting manner. So, what I will do is the S i of h v that we have calculated. Now, I will have to distribute it back. So, I will distribute it back. So, that it will occupy only the approximation values and then I will have to fill in with the rest of the details. And where exactly do I get my details from? Well, I will still get my details from this. And so indeed I can fill in the rest of the details and it is going to look like this. So, this is the matrix that we have generated in wavelet domain. Now, let us say I want to do compression of this information. We have already realized from the energy point of view, my approximation values are of great importance. So, I cannot touch them. And let us say I come up with this philosophy that this particular portion in this matrix, I am going to make all the values go to 0. And we will call this as W of D. We will also realize why at all we are doing this. And so this is the difference between W and W D. And this is called as W D because we are saying that this is the denoised version. And using this W D, now we will calculate the inverse transform. So, what we will do is, we will first of all calculate B which is indeed equal to 4, 1, 1 and 0 because I am going to redistribute back these coefficients. And for that I will have to first of all find out the inverse on them. So, using the philosophy of A inverse B A inverse, I am going to calculate the inverse from the second level of analysis. We have already pointed out that A, if A is equal to this, then A inverse looks like this. And that indeed makes my transformation matrix A to be unitary. Now, if we carry out these operations, what we will generate is this. I will distribute back these parameters in order to generate S D of H V. And I can very well say S D, this is the denoised version of H V is going to look like this now. Where again 6, 4, 4 and 2 is going to be equal to it is coming from here. And now if we apply the same philosophy and if we try and calculate A inverse and finally, in order to generate S of D which I can calculate as and if we do that, then what we are going to get is S of D. And this S of D I can compare with the S that we started of our analysis with. And you can clearly sense that in the original signal or the original image that we started our analysis with, the first two rows were relatively smoother. However, for row number 3 and row number 4, there was problem, especially you have variations like 8 to 2, 2 to 4. So, you have opposite side slopes and again going from 4 to 0, then 6 to 0, 0 to 2 opposite side slopes. So, row number 3 and 4 are indeed bumpy. And we really wanted to denoise particularly these two rows. And you will realize that in a way we have solved the problem of the third row. The first two rows are even better now, they are smoother. But row number 3 is significantly better because this 0 has become 1 and this 4 has now become 3. So, it is better. However, problem with the last row still remains. But, we know what is the solution. We can go on pursuing this analysis for next couple of scales and probably instead of using Haar wavelet, we can think of using D B 2 wavelet which will have 3 vanishing moments because it has 4 coefficients. So, 3 vanishing moments and that will give us results much quicker. So, this is one application that clearly indicates the intricate calculations and how the two dimensional analysis actually takes place. The next important thing that we are going to quickly cover is an application that deals with pattern recognition. Well, pattern recognition is one interesting branch and there is a very popular saying by Bob Dogwin's and he says that any and every system can be mapped as pattern recognition system. The day to day decisions that we take right from there boiling down to very complex systems where you have to ultimately decide certain threshold values and by the end of the day what is at the heart of these systems is to take decisions. You have to take those decisions, you have to choose, you have to make your choices and that actually formulates the crux of pattern recognition. We are going to see one application quickly using wavelet transform, but predominantly this will be left as an assignment to the viewers of this lecture and I am just going to lay down the framework. Let us say we have two letters correspondingly letter L, letter C and also letter U. So, these are the three letters that we have with us and let us say I am going to map L matrix. Let us say it is an image, it is a 4 by 4 matrix and I am going to map it so that it indeed looks like L. So, it indeed looks like L. I am going to map C also so that it looks almost like C and correspondingly U. So, this indeed looks like a U and what needs to be done from hence onwards is calculate W of L using the same philosophy. Calculate W of C and also calculate W of U and then calculate mean squared error. The concept of mean squared error is well known. We can find out the difference between the corresponding elements for example, element 1 1 of the first matrix with the second matrix, the same element 1 1 and we can find out the difference and take the square of it and in the end find out the average. So, that is why it is called as mean squared error. You take the error which is the difference, square it up and finally find out the average value or the mean value. So, find out the mean squared error between L and C, C and U and then U and L and you will realize that indeed L and C are much, much closer than the distance between L and U and probably C and U. So, this is one exercise that is left to the viewers of this video lecture. With this we come to the end of this particular lecture and what we have seen in today's lecture is the decomposition of the signal into 2 series namely scaling series and the wavelet series gives us great depth. We can think of using them individually because the phi series is low pass filter can be used for applications like denoising and psi series is a high pass filter and can be used for applications like detecting certain patterns and together they have even more beautiful applications. I will leave it to the viewers to explore more and more applications of wavelet transform. We will stop here. Thank you.