2
$\begingroup$

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.

$\endgroup$

1 Answer 1

1
$\begingroup$

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);

Sadly, that's all I can offer until I learn more.

$\endgroup$
2
  • 1
    $\begingroup$ Whoever negative voted, can you explain why. $\endgroup$
    – John Bale
    Jun 23, 2014 at 16:05
  • $\begingroup$ 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. $\endgroup$
    – Adam Smith
    Jun 24, 2014 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.