%% 3D STFT Visualization
% Generate two seconds of a voltage controlled oscillator output, controlled by a sinusoid sampled at 10 kHz.

fs = 10e3;
t = 0:1/fs:2;
x = vco(sin(2*pi*t),[0.1 0.4]*fs,fs);

%
% Compute and plot the STFT of the signal. Use a Kaiser window of length 256 and shape parameter \beta =5. Specify the length of overlap as 220 samples and DFT length as 512 points. Plot the STFT with default colormap and view.

stft(x,fs,'Window',kaiser(256,5),'OverlapLength',220,'FFTLength',512);

%
% Change the view to display the STFT as a waterfall plot. Set the colormap to jet.

view(-45,65)
colormap jet

%
% Copyright 2018 The MathWorks, Inc.