%% Wigner-Ville Distribution of Sinusoids
% Generate a signal consisting of a 200 Hz sinusoid sampled at 1 kHz for 1.5 seconds.

fs = 1000;
t = (0:1/fs:1.5)';
x = cos(2*pi*t*200);

%
% Compute the Wigner-Ville distribution of the signal.

wvd(x,fs)

% Add to the signal a chirp whose frequency varies sinusoidally between 250 Hz and 450 Hz. Convert the signal to a MATLAB® timetable. Compute the Wigner-Ville distribution.

x = x + vco(cos(2*pi*t),[250 450],fs);
xt = timetable(seconds(t),x);

wvd(xt)

% Set to zero the distribution elements with amplitude less than 0.

wvd(xt,'MinThreshold',0)

% Copyright 2018 The MathWorks, Inc.