I can create a swept / chirp signal using matlab / octave with the code below (also see spectrum taken). But how can I create a swept / chirp signal between a given starting audio signal and a given ending audio signal?
(One way to look at it is morphing one image into another image but using two audio signals) or a
sliding / chirp phase vocoder
clc,clear all swept_startfreq = 500; swept_endfreq = 225; fs = 8000; swept_dursec = 15; % duration of signal in seconds swept_t = (0:swept_dursec*fs)/fs; % Time vector if (swept_startfreq == swept_endfreq) swept_phase = swept_startfreq * swept_t; else swept_alpha = abs(log(swept_endfreq/swept_startfreq))/swept_dursec; swept_b = (swept_startfreq - swept_endfreq)/(1 - exp(-swept_alpha*swept_dursec)); swept_a = swept_startfreq - swept_b; swept_phase = swept_a*swept_t - (swept_b/swept_alpha)*exp(-swept_alpha*swept_t); endif swept_sig_out = .8* cos(2*pi*swept_phase); %equation used to create signal wavwrite([swept_sig_out'] ,fs,32,strcat('/tmp/swept_sig_out.wav')); % export file
So I would have an initial audio signal (use as the initial audio signal for testing) and an ending audio signal (use as the ending audio signal for testing). How can I do a "morphing" between these two signals?
Here's what an example of the final file would sound like example of final audio signal when processed (please not this isn't exact but it shows how the pitch gradually changes from the original signal to the end audio signal over time If you would like to know how I created the final file I used the initial signal and Audacity with the effect - Sliding Time Scale/Pitch Shift to get as close as possible to what the ending signal sounds like.
Added from comments: Start with the frequency with the largest amplitude in the initial signal and "morph" it towards the frequency with the largest amplitude found in the ending signal
It would sound like "one one one one one" gradually decreasing or increase in pitch depending on the ending audio signals largest amplitude frequency found.
Please note the Initial and ending audio signal may not be the same type of signal, the initial signal could be "one one one one" and the ending signal could be "two two two two"
Ps: I'm using Octave 4.0 which is like matlab