Search code examples
matlabdwt

Matlab dwt across specified dimension


I have a dataset Sig of size 65536 x 192 in Matlab. If I want to take the one-dimensional fft along the second dimension, I could either do a for loop:

%pre-allocate ect..
for i=1:65536
   F(i,:) = fft(Sig(i,:));
end

or I could specify the dimension and do it without the for loop:

F = fft(Sig,[],2);

which is about 20 times faster for my dataset.

I have looked for something similar for the discrete wavelet transform (dwt), but been unable to find it. So I was wondering if anyone knows a way to do dwt across a specified dimension in Matlab? Or do I have to use for loops?


Solution

  • I presume you're using the function from the Wavelet Toolbox: http://www.mathworks.co.uk/help/toolbox/wavelet/ref/dwt.html

    The documentation doesn't seem to describe acting on an array, so it's probably not supported. If it does allow you to input an array, then it will operate on the first non-singleton dimension or it will ignore the shape and treat it as a vector.