I can pitch shift an entire signal using resample and I have tried the phase vocoder code here.
I've also tried repmat and interpolation and I looked into fft and interp1
How can I incrementally / gradually change the pitch of a signal over time? I've included an example of the Original Signal and what I'm trying to get the Processed Signal to sound like (I created the processed signal using Audacity and using their effect Sliding time scale / pitch shift
) But would like to create this signal in Octave 4.0.
If you listen to the Processed Signal you can hear the pitch of the file gradually increasing but the file is the same length in (seconds) as the Original Signal file.
I'm using Octave 4.0 which is like Matlab
Here's The code which can change the pitch of the entire signal and keep the same length of the original signal in seconds, but I'm not sure how to have it gradually change the pitch of a signal over time. Thanks goes to rayryeng for getting me this far.
clear, clc
[ya, fs, nbitsraw] = wavread('/tmp/original_signal.wav');
num_per_sec=2.4; %// Define total number of times we see the signal
%// Get total number of integer times we see the signal
num_whole = floor(num_per_sec);
%// Replicate signal
yb=repmat(ya,num_whole,1);
%// Determine how many samples the partial signal consists of
portion = floor((num_per_sec - num_whole)*length(ya));
%// Sample from the original signal and stack this on top of replicated signal
yb = [yb; ya(1:portion)];
%interpolation
xxo=linspace(0,1,length(yb))';
xxi=linspace(0,1,length(ya))';
yi_t=interp1(xxo,yb,xxi,'linear');
wavwrite([yi_t'] ,fs,16,strcat('/tmp/processed_signal.wav')); % export file