Chirp after T seconds
how to create signal with constant $f_1$ frequency after T?


Find the instantaneous phase at the end of the $T$ interval and keep adding it to the phase that makes the $\sin()$ "go round".

A plain simple oscillator at some frequency $f$ has its phase increasing at a constant rate. 

Here is an example (in GNU Octave but easily transferable to other platforms as well):

Fs = 44100; % Sampling frequency in Hz
T = 1; % Total duration of the signal in seconds
f = 120; % Frequency of the oscillator
t = 0:(1./Fs):(T - (1./Fs)); % Time vector
p = 2.0 .* pi .* t; %Phase vector
y = sin(f.*p);


Now y contains our 120 Hz sinusoid sampled at 44.1kHz.

Notice here that phase (p) is a "straight line" that grows at a constant rate of $\frac{2 \pi f}{Fs}$.

When the oscillator is "chirping", the rate of change of the phase is variable. For example:

Fs = 44100; % Sampling frequency in Hz
T = 1; % Total duration of the signal in seconds
f0 = 1; % Start chirp at
f1 = 120; % end chirp at (Better keep f1&gt;f0)
t = 0:(1./Fs):(T - (1./Fs)); % Time vector
p = 2.0 .* pi .* t; %Phase vector
y = sin(f0.*p + 2.*pi.*(((f1-f0)/(2.*T)).*t.^2));


Now, this looks like:



And the rate of change of the phase of the $\sin$ is:



Now, from the first example, the phase "step" is f.*p(2)-f.*p(1) == 0.017097 and from the second example, after doing:

s = diff(f0.*p + 2.*pi.*(((f1-f0)/(2.*T)).*t.^2)); % Get the first derivative of phase to find the **rate of change**.


The "last" rate of change is s(end) == 0.017097.

So, to have the oscillator stay at the chirp's concluding frequency, keep accumulating the phase at the constant rate you are after from the last known value of the chirp's phase (to avoid phase jumps). For example:

r = f0.*p + 2.*pi.*(((f1-f0)/(2.*T)).*t.^2);  % The phase as above.   
z = r(end) + cumsum(ones(1,T.*Fs).*0.017097); % A running sum of duration T.*Fs (samples).


Now, if you feed the combined result of r, z into the oscillator y with something like y = sin([r,z]); it would look like:



...with a rate of change of:



Hope this helps.