Continuous wavelet transform pitch shifting

406 views Asked by At

I have implemented a wavelet based pitch shifting in matlab. It seems to work fine but there is a problem with phase of the output signal. I don't have any idea how to fix this. I tried several methods for phase shifting but neither worked properly. Maybe it's some other problem. Phase shift is different for different values of c. Anyway here is the code:

[input fs nbits] = wavread('sinus.wav');
f = input(:,1);
c = 0.6; % pitch factor 
wlet = 'morl';
coefs = cwtft(f, 'wavelet', wlet);
absc = abs(coefs.cfs).*c; %mag
phac = angle(coefs.cfs); %phase
phac = phac.* c;
phac_unwrap = unwrap(phac);
coefs.cfs = absc.*exp(1i*phac_unwrap); %coefs_shifted
coefs.scales = coefs.scales./c; %scales_shifted
f_shifted = icwtft(coefs);
result = f_shifted;
maxx = max(abs(f));
maxy = max(abs(result));
result = (result/maxy)*maxx;
wavwrite(result, fs, nbits, 'sinusup');
0

There are 0 answers