%% Cross Wigner-Ville Distribution of Signals
% Generate two signals sampled at 1 kHz for 1 second and embedded in white noise. One signal is a sinusoid of frequency 150 Hz. The other signal is a chirp whose frequency varies sinusoidally between 200 Hz and 400 Hz. The noise has a variance of 0\ldotp 1^2.

fs = 1000;
t = (0:1/fs:1)';

x = cos(2*pi*t*150) + 0.1*randn(size(t));
y = vco(cos(3*pi*t),[200 400],fs) + 0.1*randn(size(t));

%
% Compute the Wigner-Ville distribution of the sum of the signals.

wvd(x+y,fs)

%
% Compute and plot the cross Wigner-Ville distribution of the signals. The cross-distribution corresponds to the cross-terms of the Wigner-Ville distribution.

xwvd(x,y,fs)

% Copyright 2018 The MathWorks, Inc.