Search code examples
matlabfftwaveletfrequency-analysisdwt

Relation of Sampling frequency, Signal length (datapoints) and Time range of Discrete Wavelet Transform?


As above lets Fs is sampling frequency, L is signal's length and t is time range.

As using mdwtdec in Matlab in order to decompose multi-raw signal into specific frequency band, I just notice that decomposed signal's length at 1st level is split into half, and keep slit into half of 1st level signal at 2nd level.

Raw signal's time range calculation: t = 0 --> (L/Fs)

My question is in every decomposition level the Sampling frequency Fs is still the same? and at every decomposition level how I can calculate the time range of each Detail and Approximation coefficient.

Also as verify the frequency band of Discrete Wavelet Transform I applied FFT at each level following this post: https://jp.mathworks.com/help/matlab/ref/fft.html?lang=en

According to this post my first question need to be answered.

Thank you very much.


Solution

  • I'm pretty positive that in discrete wavelet transform, the time series data or signals, if we wish, would be downsampled by a factor of 2, which means that if we would be having 2^10 or 1024 datapoints in our original time series data, in the first level, it would be divided into 2 and our level one sampling frequency would be 2^9 or 512, in second level would decrease to 256, and so on.

    However, in continuous wavelet transform, it would most likely remain the same.

    enter image description here

    Based on the references, I copy some codes here that you might want to test and see, you might want to reduce the number of levels and Fs here and you can define your own x if you wish:

     Fs = 1e6;
     t = 0:1/Fs:1-1/Fs;
     x = cos(2*pi*50*t);
     [C,L] = wavedec(x,15,'db4');
     details = detcoef(C,L,'cells');
     d14recon = wrcoef('d',C,L,'db4',14);
     plot(d14recon,'k'); 
     d13recon = wrcoef('d',C,L,'db4',13);
     hold on;
     plot(d13recon,'r');  %look how small the amplitude is
    
     a13recon = wrcoef('a',C,L,'db4',13);
     plot(a13recon,'b');
    

    Useful Links:

    I'm not expert about it, you can likely read more about it and find out your desired information. There are also lots of YouTube videos about it.

    Discrete wavelet transform relation to sampling frequency of the signal

    Single-level discrete 2-D wavelet transform