hello welcome to an introduction to the wavelet transform this video will give you a clear understanding of the mathematics of the wavelet transform as well as a clear intuition of how it works and its unique capabilities in signal processing but first i'll cover some more basic knowledge before we talk about wavelets so we'll start with the fourier transform as you may know the fourier transform provides frequency information of a signal that represents its frequencies and their magnitude it does not tell us when in time these frequency components exist so the transform is ideal for stationary signals stationary signals are ones that do not change with time so they have a constant frequency throughout so this fury transform lacks capability to provide frequency information for a localized signal region in time so the short time fourier transform scft was developed to overcome the poor time resolution of the fourier transform what it gives us is a time frequency representation of the signal with a short time fourier transform we assume some portion of the non-stationary signal is stationary we then take a fourier transform of each stationary portion along the signal and add them up so here we have a non-stationary signal we've divided the signal into its stationary parts so each frequency in these portions is constant okay so the signal increases the frequency but it has these stationary sections what we do with the scft is we take a window function of fixed length and move it along the signal from start to end and take a fourier transform at each stationary section okay like this our window function is a rectangle and we multiply it by a signal at each section so the window function is a function that's zero valued outside its given interval so when the waveform is multiplied by the function the product is zero valued outside that interval so when we multiply the signal by the rectangle only the overlap is included of our signal the rest of the signal becomes zero which allows us to take the third transform of that given section that is the stft this is what it looks like mathematically w is our window function okay which can be translated through time via our translation parameter tau comparing the sgft to the fire transform the only difference is the window function the signal was multiplied by the window function and then we take the fourier transform but now the output involves some time localization the fur transform only provided frequencies we now have frequency and time localization what does the stft look like as a 3d output well if we have a signal with four stationary sections of different frequency we then get a 3d output of amplitude of the frequencies the frequency and then the time they occur in the signal so we have four peaks located at different times depending on when these stationary frequency components occur in our signal these other four peaks aren't included in the signal so you don't have to worry about them but you can see that we do have a peak for each stationary section but they aren't singular definite peaks they're distributions in time and frequency so really there's an uncertainty in the frequency and time of the frequency of the components and the time at which they exist in the signal so this is a problem we have uncertainty this brings us on to limitations the window function is finite so the frequency resolution compared to the fourier transform is going to decrease the fixed length of the window means time and frequency resolutions will also be fixed for the entire length of the signal this comes off a main principle in physics in which we cannot know what frequencies exist at what time instance but we can know what frequency bands or frequency ranges is it exists at what time intervals and it's given by this equation if we have a higher time resolution or smaller time uncertainty the greater the frequency uncertainty is the lower the frequency resolution and it's bounded by one over four pi so this is a principle of physics we cannot escape from but we can improve on it so looking at the frequency time plane for um short time fourier transform we see that at all increasing times and higher frequencies the frequency and time resolution are fixed given by squares of equal area a narrow window will give good time resolution but bad frequency resolution on the other hand if our window is wide we get poor time resolution but good frequency resolution of our signal now this fixed frequency resolution for our short time fury transform isn't particularly good when we're looking at these two reasons low frequency components of sound and signals often last a long period of time so our time uncertainty is really small because they do last a long time so really we need a high frequency resolution that is required to resolve this correctly high frequency components on the other hand appear as short bursts and signals invoking the need for higher time resolution the sgft does not do this very well at all but the wavelet transform improves on this the wavelet transform results in analyzing a signal into different frequencies at different resolutions this is known as multi-resolution analysis so looking at the frequency time plane for wavelet transform we see that there is good time resolution but poor frequency resolution at high frequencies so up the frequency axis with high frequencies the vertical lines are much denser so that means good time resolution but there are barely any horizontal lines meaning low frequency resolution however at low frequencies we have better frequency resolution more horizontal lines but poor time resolution we literally have no vertical lines so what does the wavelet transform look like here it is it's a integral it is the continuous wave of the transform we still have our signal f of t but this time it's not multiplied by an exponential it's multiplied by the complex conjugate of psi psi is our wavelet which we'll come on to in a minute one of the parameters now is the scale parameter which is one over frequency so before we had tau and omega but now we have the inverse of frequency which replaces omega so what is the wavelet a wavelet is a small wave such as these ones and the wavelet is now our new basis function remember from the fourier transform the basis function was our sines and cosines but now for waver transform we use a wavelet and the wavelet acts as our window function so we can change the width of the wavelet and its central frequency as we move it across our signal by changing s this is called scaling so an expander wavelet is better at resolving low frequency components of the signal with bad time resolution which we looked at before this corresponds to large values of s remember s was the inverse of frequency shrunken wavelet is better at resolving high frequency components of the signal with good time resolution this corresponds to small values of s so now with the wavelet transform we can change the width of our window function which helps us to resolve high frequency components and low frequency components with good resolutions both so all the windows that are used are the dilated or compressed and shifted versions of the mother wavelet psi of t going back to our integral we see that the wavelet is translated across our signal using tau like our window function but it's also scaled by dividing by s so this stretches and compresses the wavelets large values of s correspond to lower wavelet frequencies so when the wavelet matches when the frequency of a wavelet matches part of the signal with very similar frequency we get high outputs of f f represents our wavelet coefficients approximation coefficients are wavelet coefficients but represent the low frequency of our signal detail coefficients represent the high frequency components of our signal which we'll look at more later an animation of the wavelet transform the wavelet is multiplied by a signal at each location and time and every time we do that we increase the scale so we go from high frequencies to low frequencies of the wavelet okay high frequency wavelets will pick up the high frequencies of our signal low frequency of the wavelet so pick up the low frequencies of a signal we end up with a 3d plot of s tau and amplitude so like before we have tau but now we have s one over frequency unlike the stft with plotted frequency so let's move on to the discrete wavelet transform calculating wavelet coefficients at every possible scale produces a lot of data if s and tau are chosen to be discrete then the wavelet transform won't generate huge amounts of data if s and tau are based on powers of two which is called dyadic then analysis becomes much more efficient and accurate so this is the discrete wavelet transform we have a representing tau and b is s we've gotten rid of the integral and replaced it with the sum which you'd expect for discreteness a and b are now as i said dyadic j is the scale index and k is our wavelet transformed signal index so computationally how is the discrete wavelet transform computed well this is computed by multi-level decomposition in this our signal is passed into low-pass and high-pass filters low-pass filters will pass our low frequency components of the signal but they're going to reject our high frequency components okay so a represents our approximation coefficients d represents our detailed coefficients so the low pass portions approximation coefficients are iteratively filtered by the same process each time so they keep going through the low pass filters to disregard the high frequency components at each level okay the high pass portions are the detail coefficients so the number of coefficients number of approximation and detail coefficients halve for each decomposition level this is called the decimated discrete wavelet transform so by the end of the process we end up with sets of approximation and detailed coefficients so in future videos we're going to look at the discrete wave of transform and multi-level decomposition in more detail as well as the approximation and detail coefficients i will also introduce you to station waver transforms because this all leads into my current research i'm doing at the moment which is on signal denoising of ecg and mcg signals which involves taking away the transform of a signal applying some thresholds and stuff like that and outputting a denoised ecg signal so i see you in the next videos