%% STFT of Quadratic Chirp
%
% Generate a quadratic chirp sampled at 1 kHz for 2 seconds. The instantaneous frequency is 100 Hz at t=0 and crosses 200 Hz at t=1 second.

ts = 0:1/1e3:2;

f0 = 100;
f1 = 200;

x = chirp(ts,f0,1,f1,'quadratic',[],'concave');

%
% Compute and display the STFT of the quadratic chirp with a duration of 1 ms.

d = seconds(1e-3);
win = hamming(100,'periodic');

stft(x,d,'Window',win,'OverlapLength',98,'FFTLength',128);

% Copyright 2018 The MathWorks, Inc.