Scaling a function (wavelet)
Show older comments
Hi there,
I got a function descriped as follows:
t = linspace(-3, 3 1024); % Time vector from -3s to 3s with 1024 points
y = (1./(1+t.^(2.^4))).*cos(20*t); % Enveloped cosine function
Now this is a wavelet, that I need to use as a mother wavelet. I now need scaled versions of it. Meaning Half duration, double frequency for each scale. Like this:
Scale: Freq: Duration:
1 20 -3.0:3.0 [s]
2 40 -1.5:1.5 [s]
3 80 -.75:.75 [s]
...etc
You probably get the point now. I tried this:
wavDur = 3/2^(m-1); % Half duration [s]
t = linspace(-wavDur, wavDur,round(2*wavDur*fs)); % Time vector
wavelet = (1./(1+t.^(2.^4))).*cos(20*t*2^(m-1)); % Scale dep. wavelet
Where m is the scale going from 1:12 atm. However this does not work. Most likely it has something to do with the envelope not scaling accordingly. Is there an easier way of scaling a signal the way I would like to? Basically its just a compression in time for each scale step.
1 Comment
Jakob Sørensen
on 16 May 2013
Answers (0)
Categories
Find more on Continuous Wavelet Transforms in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!