function Cxy=coherence(x,y,L,over,win); %COHERENCE Coherence estimation using Welch's method. %---- %USAGE Cxy = coherence(x,y,L,over,win) % % The coherence 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 Sxy=crosswelch(x,y,L,over,win); Sx=welch(x,L,over,win); Sy=welch(y,L,over,win); Cxy=abs(Sxy).^2./(Sx.*Sy);