%% Align Two Signals Where the First Signal Lags by Three Samples
% Align signal Y with respect to X by delaying it three samples.
% Create two signals, X and Y. X is exactly the same as Y, except X has three leading zeros and one additional following zero. Align the two signals.

X = [0 0 0 1 2 3 0 0];
Y = [1 2 3 0];

[Xa,Ya] = alignsignals(X,Y)

% Copyright 2015 The MathWorks, Inc.