0001 function [xo, yo, fs] = ltpda_matchvectors(x, y, xfs, yfs)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 if yfs > xfs
0016 dv_disp('!!! vectors are not equal sample rates. Down-sampling y. !!!');
0017 y = resample(y, xfs, yfs);
0018 fs = xfs;
0019 end
0020
0021 if xfs > yfs
0022 dv_disp('!!! vectors are not equal sample rates. Down-sampling x. !!!');
0023 x = resample(x,yfs,xfs);
0024 fs = yfs;
0025 end
0026
0027 if xfs == yfs
0028 fs = xfs;
0029 end
0030
0031
0032 nx = length(x);
0033 ny = length(y);
0034
0035 if nx > ny
0036 dv_disp('!!! vectors are not equal lengths. Truncating x. !!!');
0037 x = x(1:ny);
0038 end
0039 if ny > nx
0040 dv_disp('!!! vectors are not equal lengths. Truncating y. !!!');
0041 y = y(1:nx);
0042 end
0043