function Pxy = crosswelch(x,y,L,over,win) %CROSSWELCH Cross Spectrum estimation using Welch's method. %---- %USAGE Pxy = crosswelch(x,y,L,over,win) % % The cross spectrum of a process x and y is estimated using Welch's method % of averaging modified periodograms. % % x : input sequence % y : input sequence % L : section length % over: amount of overlap, where 0= 1) | (over < 0) error('Overlap is invalid'), end n1 = 1; n2 = L; n0 = (1-over)*L; nsect=1+floor((length(x)-L)/(n0)); Pxy=0; for i=1:nsect Pxy = Pxy + crossmper(x,y,win,n1,n2)/nsect; n1 = n1 + n0; n2 = n2 + n0; end;