My answer does not give exactly the same result as the one you published, but I think it is interesting and simple enough to give you important concepts of stretching a step. I did not find the method that I propose elsewhere on the Internet, but I cannot imagine that no one had thought of this before, so it may have a name.
, , , , , , (, ), , (, ).
, , , , ( (1/2Pi) * dPhi/ dt rad/s).
, , " " " ".
, . :
function y = add_linear_pitch( x, fs, df )
%
% y = add_linear_pitch( x, fs, df )
%
% x, fs: audio signal (1-dimensional)
% df: the amplitude of frequency offset, in Hz
%
% See also: hilbert
%
x = x(:);
n = numel(x); % number of timepoints
m = mean(x); % average of the signal
k = transpose(0:n-1);
h = hilbert( x - m ); % analytic signal
e = abs(h); % envelope
p = angle(h) + df*pi*k.^2/fs/n; % phase + linearly increasing offset
y = m - imag(hilbert( e .* sin(p) )); % inverse-transform
end
, " " ( ) 2Pi ( ). , :)