# How do you change pitch with wavelet transforms in MATLAB?

I'm trying to increase the pitch of a wav file using MATLAB. (I don't expect it to sound very good, but I'm trying to figure out how wavelets in MATLAB work.) Here's what I'm doing:

scales = {2.34375,0.5,21};
result = cwtft(b5,'scales',scales);
result.scales = 2*scales;
b5high = icwtft(result);

(b5 is just the opening of Beethoven's Fifth, but it could be any sound file. It happens to have a sample rate of 48 kHz.)

To my thinking, I'm doing a wavelet transform of b5 using a Morlet wavelet. The scales that I'm using capture the human-audible frequencies for a 48-kHz signal. I then double the scales vector--resulting in a shift upward of 1 octave, and then convert back into a signal. However, when I play b5high, it sounds exactly like b5 - no pitch shifting at all.

What's wrong with my logic?

Thanks.

I haven't implemented a pitch shifter using wavelets, but I am currently learning about them. From what I understand scales are the inverse of frequency, therefore to get your desired result you'd have to divide the scales instead of multiplying.

Furthermore, according to 'Applications of the Continuous Wavelet Transform in the Processing of Musical Signals', you also have to update the phase as adjusting the scales isn't enough. The algorithm outlined in the paper is:

semitone = 12;
pitchFactor = 2^(semitone/12);

wt = cwtft(input);

mag = abs(wt.cfs);
phase = angle(wt.cfs);
unwrapped = unwrap(phase);

wt.cfs = mag.*exp(1i*unwrapped*pitchFactor);
wt.scales = wt.scales./pitchFactor;

result = icwtft(wt);


• That helps a bit—thanks—but if I'd flipped the meaning of scales, I should still hear a lowering of pitch, which I don't. There's still something wrong with my logic, that I'm trying to understand. – Adam Smith Jun 24 '14 at 20:45