so [Music] okay let me show you the contents of this video which i will cover uh first i will introduce the topic and then i will explain that what type of wavelet transform i should choose i mean either cwt or dwt then i will explain the wavelet properties which are very important that will help us to select the appropriate wavelets and then i will explain how to choose the wavelets for feature extraction then wavelets for denoising then wavelets for compression and then wavelets for detection of the change point or the discontinuity detection and in the last i will explain the wavelets for a few other applications such as analysis of variance water marking ash detection ecg signal feature extractions and ocr so let's go ahead but before going ahead i strongly recommend you to watch following my two videos the first one is about the introduction to the wavelet theory and its applications so here you can find the cwt dwt filter banks realization different wavelet types and wavelet applications so it's a almost a complete package about the basics of the wavelet so this video you can find on link which is given in the description and then second video is about the continuous wavelet transform of 1d signals using python and matlab so here i have shown the both types of implementation using python and matlab and here you can see how to plot this kilograms i mean the cwd coefficients and i have taken one example of the discontinuity detection so this is also very good uh video to understand the basics of the wavelets so this again you can find on link which is given in the description so now let's see how to choose a night favorite so this comes in everyone's mind whenever someone starts working on the vivid first time that which wavelet or which wavelet transform i should choose for my application uh the answer of this problem is not always clear but the few properties of the wave rates uh give actually the clear indication and help us to select the right wavelet and right wavelet transform so now let's go uh uh to understand that which wavelet transform i should choose okay so first we will uh go for the basic properties of the transform and then we do a comparative analysis and on the basis of that we will derive our conclusion so we have the two basic wavelet transform one is the cwt other is a dwt i mean continuous and the discrete form of transform the cwt actually is redundant in nature that's why known as the undecimated transform it generates a huge amount of coefficients while the dwt has actually the two form uh one is non-decimated uh which is uh as an example known as ammo dwt i mean the maximally overlapped discrete variable transform ah this generates more coefficients while the other form is the decimated form whose example is the mri i mean the very popular multi-resolution analysis so that generates the fear coefficients the cwt is not computationally efficient as i said it generates a huge amount of coefficients while the dwt is more computationally efficient and particularly the decimated one uh is more efficient because it generates a very less amount of wavelet coefficients and the cwt is a shift invariant that is one good thing about cwt but the decimated dwt i mean such as mra is not shift invariant because we go for the dwt down samplings while the non-decimated form such as ammo dwt is a shift in variant because we do not go for down sampling of the coefficients the cwd cannot be implemented with the filter bank so there is a drawback you cannot implement this in fill hardware uh while the dwt both the decimated and undecimated forms can be implemented with help of the filter banks i mean the low pass and high pass filter so this is one good thing you can implement this gwd in hardware with help of the integrated circuits uh the inverse operation icwd i mean the inverse transform is not much accurate and it's a very last stable numerical operation for continuous failure transform while inverse dwt is more accurate reconstruction and say stable numerical operation with precision so on the basis of these properties we can conclude the following points so if our application is to obtain the fastest possible signal representation for such as compression denoising uh or let's say signal transmission then dwt is a clear choice so if our application requires an orthogonal transform i mean the energy preservation then dwt uh with orthogonal wavelet filters is a obvious choice now if our application requires a shift in variance uh transform but we need the perfect reconstruction also then the non-decimated form of dwt such as m or dwt or dual tree complex transform ah is a choice and if inverse transform is not required then one can go for cwt and if our primary goal is a detailed time frequency scale analysis uh or precise localization of some signal transient then ccwt is a good choice we have few examples such as discontinuity detection frequency break etc and for other applications which are important of course such as denoising compression feature extraction uh studying some statistical properties of the vibrate coefficients the dwt is definitely a good choice so now let's see a few example of the cwt so here you can see that if you want to go for the time frequency analysis of some signal then c is wt is a obvious choice so in this case you can see that we have a hyperbolic chirp signal it has a combination of the two signals and here you can see that with the time the frequency is increasing and this is the cwt plot i mean this kilogram of this chirp signal so you can see these uh two uh highlighted uh lines of yellow color so that is clear indication of increment in the frequency so if you progress in the time there is a increment in the frequency okay so this is a very good representation of the signal property so this is uh the similar operation which you uh generally do with a fourier transform and it's a spectrum analysis but here the advantage is that uh in fourier transform we get only the frequency versus magnitude but here we get the three axis uh the frequency magnitude as well as the time so that is uh the more advantage in the wavelet based time frequency analysis and take one another example for the discontinuity detection so here the cwt coefficients for this signal shown so you can see that these two discontinuities are well uh represented by these cwt coefficients at these time moments and this is another example of frequency break so here with the cwd coefficients you can easily uh see that uh something happened at this time i mean there is a sudden change in the frequency so here the frequency is less and here frequency is more so that started at this time moment around 500 uh number of samples and now let us see uh what is scaling function phi t actually this is a very important uh aspects of the wavelet analysis which i uh somehow missed in my previous video so i'm taking it in this video so it will also help you uh for the proper selection of the wavelets so let's see what is the scaling function if you remember in the previous video i have included this that a signal as t can be decomposed using the wave rate with the mra i mean the multi resolution theory that was given by the asmalat and male with help of the digital affiliate filters as shown in this figure so here you have one signal as let's say it has a thousand samples so it passed through a high pass filter which is derived from actually the wave rate and then output is down sampled by 2 and here we get the 500 dwt coefficients which are of nature high frequency so these are known as the detail coefficients generally represented by the cd and when this signal is passed through the low pass filter uh and then down sampled by 2 we get the 500 coefficients which are of low frequency nature so this is known as approximation coefficients represented by ca so this is how we achieve the wavelet coefficients uh with help of the filters but the question is that how these filters are obtained so this hpf is obtained by the wavelet function psi t while this lpf i mean the low pass filter is obtained by the scaling function phi t so that is a combination of fighting anxiety so few wavelets such as uh db heart simulate coil flat uh and by orthogonal wavelets they have their corresponding scaling functions not all wavelets has this phytics id combination okay so that we will see uh in the properties uh part later in this video so this is a quite important aspect of the wavelet so as an example uh i have taken the simulate4 so here i have shown the scaling function of this sim net force so this is the 5t side combination you can see so this is similar for wavelet and this is its scaling function and here you can see all the four filters uh these two are for decomposition so these lpf uh one for decomposition and one for reconstruction so these lpfs are derived from this scaling function uh while the hpf uh one for decomposition and one for reconstruction these two filters are derived from the wavelet function so this is the role of the scaling function now let's go through the wavelet properties so the first one which is very important that is the vanishing moment so let's see what is this vanishing moment the vanishing moment is a criterion about how a function ft decays decades towards the infinity so we can estimate the rate of the decay by the following integration so if we can do this operation and we achieve the 0 it means this k indicates the rate of decay okay so here uh we can take one example uh suppose my function f t is uh sine t upon t square so i can do uh the same operation for this function so integrating from minus infinity to plus infinity t power k f t or i mean the sine t upon t square uh i mean sine t upon t square dt so if i choose let's say k equal to 0 so my remaining function will be the same that that is sine t upon t square dt and if i do this integration of course i will get 0 and if i choose k equal to 1 then this integration will be from minus infinity to plus infinity and this is t uh sine t upon t square so this t2 t cancels only we get sine t upon t so this equals to pi so i mean this integration converges and if i chew choose k equal to 2 then this will be the integration from minus infinity to plus infinity t square sine t upon t square so this is the integration of the sine t so that will not converge so here we can see that for k equal to 0 1 for these two values this integration converges so we'll say that number of vanishing moments for this function will be the two the same you can apply for a wavelet function psi t also so a wavelet function will have the n number of vanishing moments if this satisfies this integration where k is uh equal to 0 let's say 1 2 3 and less than n okay the same thing which i have shown you here so this is a very important property which actually uh shows that how a wave rate function or how fast a wavelet function decays in time so on the basis of that we have the few observation so uh the fourier transform of both phi t and psi t i mean the scaling function and the wavelet function uh they have their first n minus derivative derivatives uh which are 0 at omega equal to 0 and the fourier transform h5 which is the first transform of the wavelet filter which is obtained by the scaling function phi t so of course this is lpf so this fourier transform and its first n minus 7 derivatives will have the zero value at omega equal to pi and from this information or the number of vanishing moments we can construct uh the polynomial of the degree k like this and a wavelet with n vanishing moments is orthogonal to the polynomial of degree n minus 1. so here we have one important observation that number of vanishing moments and the oscillations of of the wavelet have that loose relationship so as the number of vanishing moment grows the wavelet oscillations also grows so this you can see in this figure so we have the three wavelets for comparison so it has number of vanishing moment two it has number of vanishing moments four it has vanishing number eight so you can see the as uh n is increasing i mean the number of vanishing moments is increasing the oscillation of the wavelet is also increasing so it has a less oscillation uh then you can see that db8 has a highest oscillations so actually the names of many wavelets are derived from the number of vanishing moments so for example the name of davishi family and the simlet family is derived from their corresponding vanishing moments so for example if you take the db6 wavelet it means it has a six number of vanishing moments and for sim three it has the three vanishing moments uh for koif n uh this is uh slightly different uh for coif and the number of vanishing moments are actually 2n so for a quive 3 the number of vanishing moments will be 6. similarly we have uh the nomenclature for by orthogonal wavelet but here we get the two numbers uh instead of one uh such as a buy or three point five actually two numbers because uh these are two different vanishing moments uh by orthogonal wavelets are different than normal wavelets they have different wavelet functions for analysis and reconstructions okay so for example in case of bio 3.
5 the 3 is actually representing the vanishing moment for the wavelet which is used for synthesis i am in the reconstruction and the five is representing the number of vanishing moments for the wavelets which is uh i actually use it analysis i mean the decomposition so that is how we get the names of different wavelets for from their number of vanishing moments and now the second important one is the support size so actually the size of the support indicates the length of the fire filter and with the number of samples in their impulse response so if an affir filter has n number of samples in uh their impulse response h n then support width for that wavelet is known as n minus one uh for the wavelet's heart db and sim the number of vanishing moment of course is n as uh clear by their name and their corresponding filter length is 2n and the support width is known as a 2n minus 1 and for quay flat the number of vanishing moment is 2n and the length of the filter is obtained by 6n so here is one example of the similar 4. so simnet 4 means the number of vanishing moments are 4 and here you can see that the support width is 2n i mean the length of the filter is 2 1 so that means 4 into 2 means 8. so here you can see that there are total 8 samples in all these filters from 0 to 7 okay so this is how the length of the filter is related with the number of vanishing moments so more vanishing moments is clearly meaning that the length of the filter will be more and the third one is the regularity that is another very important one so the regularity is related to how many continuous derivatives a function has so uh intuitively the regularity can be considered as a measure of the smoothness of the wavelet function so available the more vanishing moments will be more regular so this we can see with this example uh so we have taken two examples one is of db2 and db10 so this is the scaling function of db2 and this is a wavelet function of db2 and here you can see for db10 so now see which one is more regular of course this is more smoother i mean the db10 scaling function and wavelet function are more smoother than the scaling functions and wavelet function of the db2 so you can compare their corresponding vanishing moment so for db2 the vanishing moment is 2 and for db 10 vanishing moment is 10 so more vanishing moments means more smoother and more regular wavelet and now let's see the symmetry another very important one the symmetry actually concerns whether the wavelet filter characteristics have the linear phase or not so a db i mean the dom sheet is not a symmetric wavelet is a symmetric wavelet so it exhibits the non-linear phase angle while the simulate coefficient they are also not symmetric but they are near symmetric so we get almost a linear phase from them and bio-orthogonal is symmetric so we get the linear phase angle from the by orthogonal wavelet family so this you can understand with this example so we have taken the davishi 4 scaling function and this is the blue one is showing its phase angle in the frequency domain so you can see that this is non-linear uh so as i said that db is a symmetric wavelet uh so it uh gives the nonlinear phase and now see the by orthogonal 3.
5 scaling function which is used for reconstruction so you can see in time domain also that this is not symmetric while this is quite symmetric and also in frequency domain you can see that we are getting a perfect linear phase for by orthogonal wavelet so that is important property and that will be used uh later in the selection for appropriate wavelet for different applications so that what i will explain in the uh later slides and the next one is orthogonality that is that is also very important one so if wavelet is orthogonal uh the wavelet transform uh preserves the energy i mean you can get uh the perfect reconstruction so you don't lose uh actually the information during the analysis and synthesis part so the strict orthogonality is actually the beneficial to achieve the accurate reconstruction of the signal from its coefficients so the scaling function phi t and wavelet function psi t are orthogonal so we have this family heart db sim coif mere de mayor battle email these all are orthogonal wavelets while bio and river spire they are bi-orthogonal while the other remaining wavelets are not orthogonal so we have to choose carefully on the basis of this orthogonality and now let's see the properties of the wavelet summary so this is a table which actually representing the summary of all the properties and few other are also added so here i have taken all major wavelets and in this column you can see all the uh properties so the first one is the infinite regularity and here you can see that wavelets which support this are highlighted by this green color so in finite regularity i mean the wavelets which can be differentiated infinitely are supported by the marlite mexican hat mare etc and the arbitrary regularity supported by the batolemia db simulator flat and by orthogonal wavelet and now these are the wavelets with the compact support these are orthogonal with the compact support and this is by orthogonal with the compact support and these are the wavelets which show the symmetry property except this group db simulator and koi flat as i already explained that db is isometric while the coil flat and simlet are near symmetric okay the existence of a scaling function so these wavelets have their corresponding scaling functions so these are the other properties uh such as uh these wavelets supports orthogonal analysis and these wavelets also support uh the by orthogonal analysis exact reconstruction i mean the inverse transform is supported by this wavelet except uh these uh they support actually the near exact reconstructions not perfect one and the fire filter support so these group of wavelet actually support the realization using the digital fire filters and these wavelets are useful in cwt analysis while these wavelets are useful in dwt analysis the fast algorithm is available to compute the wavelet coefficients for this group and this is a group which is widely used for wavelet applications so and also it is supported by the f air filters so these type of wavelets are implemented largely in form of the hardware with integrated circuits and in the last explicit expression it means uh these wavelets have actually the exact mathematical representation while others do not have and this is another table which uh classify the different types of wavelets so the two major categories i have shown here the one with the filters and one without the filters so one with the filters uh further divided into two with compact support with non-compact support and then further divided into orthogonal and by orthogonal so the db heart sim coif these are the wavelets which are orthogonal with the compact support and without wavelet filters and this is the group mayor de mer battle emir they are orthogonal but they do not show the compact support but can be realized with the filters and here in this group we have the two divisions real and complex wavelets so this group gaussian mexican hat modulate their real wavelet functions while these uh wavelets are the members of the complex uh wavelet functions and now let us see uh how to choose the wavelets for different applications on the basis of these properties we have just uh understood so for this purpose i am taking the first example that is the wavelets for feature extraction so if we want to find the closely spaced features then we should choose the wavelengths with a smaller support such as heart db2 sim2 you should not go for the higher vanishing moments wavelet such as db10 or buyer 6. 8 or something uh because this uh support of the wavelet uh is small for example the heart has only the two samples in its uh impulse response of the wavelet filter so if this support is small then it is able to actually distinguish the closely spaced features so wavelets with larger support will create the difficulty in detecting the closely spaced features and available with last support will generate the coefficients from which it will be very difficult to distinguish the individual features so this we can understand with this example so here i have taken one signal as which has these closely spaced uh samples i mean the near to each other so i have decomposed this with the the wavelet heart of course that is uh the less support and here if you see these wavelet coefficients detailed coefficients at level 1 you can see that these features which are closely spaced are well distinguished or well represented by these wavelet coefficients at level 1. so this is a one good example and same signal you can see that what happens if it is decomposed with the wavelets with higher support i mean the dv6 so db6 means there will be the 12 samples in the filters corresponding filters so here you can see if you visualize this d1 and compare with the previous one so here you can see that these features are not well represented uh by these coefficients okay so this is how you can select a low support wavelet and the field wave rate which has the less number of samples in its filters for such closely spaced features okay so that that is useful for both signals and images in case of images uh there can be a fine edge patterns where there is a close placement of edges so you should go for lower support wavelets and now other one is the wavelets for denoising so this is uh just example just for demonstration a noisy and denoised version so an orthogonal wave such as the simulate and domestic wavelet it's a good choice for the noising signal the by orthogonal wavelet is also very good for image processing because the bio-orthogonal wavelet filters have the linear phase and that linear phase is very critical for image construction because this linear phase will not introduce any visual distortion in the images so the simulate photo is a good choice for signals uh denoising i mean for one-dimensional and for images the buyer 4.
4 is a good choice okay and now let's see waivers for the compression so we should consider the by orthogonal wavelets particularly the buyer 4. 4 and reverse buyer 3. 9 for compression because uh they are symmetric and they have the linear phase uh so the wavelets actually with higher vanishing women should also be selected because such wavelets produce the fewer significant coefficients uh during the decomposition so therefore the majority of the coefficients can be neglected while keeping this the lesser significant coefficient so that will achieve the image compression also the higher vanishing moments uh causes the more regular wavelets i mean the more smoother wavelet therefore the smooth reconstruction of the image will be achieved so here in this example you can see the difference this is my original image and this is the outcome of compression with the heart and this is outcome of compression with a buyer 4.
4 so here in this image you can see that this discrete effect i mean pixel art effect because of this heart and if you choose a buyer 4. 4 you get more smoother reconstruction because of this more regular wavelet so in the compression we should choose uh the wavelets which are symmetric which have a linear phase and which have the higher vanishing moments okay and now let's see the wavelets for the change point or discontinuity detection so to detect the instances uh where a signal has changed its value uh the wavelet with the higher vanishing moments i mean the more regular wavelet should be selected so this we can understand with this example so here i have my signal uh which has actually the change in its value at this moment so initially it is flat and then it its value uh increases so let me show you that how you can detect this uh time instant so here you can see the two uh figures in first uh i have shown the detailed coefficients at label one uh which is obtained by uh decomposition using db1 i'm in the heart and the second one is showing the detailed questions at label one using the db3 so there is a clear uh difference in these two uh figures that uh this second one is giving the better representation of this change in the value at this time moment while this is not a good representation so this gives the idea that the higher vanishing moments wavelets are more uh suitable for obtaining such change point detection in the signals and next you can take another example of the frequency break so here i have a signal which changes its frequency certainly at the 500 so these are the detailed options at label one which are obtained by the hard decomposition and now compare this with uh this uh figure here these are the detail coefficients at label one which are obtained by the db10 so you can see that this is a very good representation of uh to know that uh something happened at the 500 in comparison with this one so obviously it is showing that you should choose the wavelets with the more vanishing moments for such discontinuity detection and now let's see the other applications one is analysis of variance so if our goal is to conduct actually an analysis of variance i mean you want to see the change in a trend of a signal uh then maximum overlap discrete wavelet transform i mean the ammo dwt is suitable so the ammo dwt actually conserves energy in the analysis uh by use of some orthogonal wavelengths such as db simulate etc and the amor dwt partitions the variance across the scales so therefore it is very much suitable for analyzing some financial data series or some other series ah for change point detection so here you can see uh in this example uh that this is the graph of the usgdb from 1947 to 2008 here if you look this graph you will not have any idea that what happened in 1982 after 1982 so if you go through the wave rate decomposition these are the wavelet coefficients at level 1 detail coefficients so you can see this that there is a change in the trend after 1982. so this is how you can use this ammo dwt to analyze the variance and let's see other applications such as image water marking so for amaze water marking uh wavelets with the higher vanishing moments i mean the more regular and symmetric wavelets i mean having the linear phase should be selected such as the buyer 6.
8 and for edge detection this is of course a similar to the feature detection which i have already covered in the first example so here the wavelets with a smaller support i mean the less vanishing moment should be selected uh such as har db 2 bio 1.