function D = mlm(r1,r2,alpha1,alpha2,dirs) %MLM Maximum Likelihood Method calculation for directional distribution function % D = mlm(R1,R2,ALPHA1,ALPHA2,DIRS) calculates the directional distribution % function for a 2D spectrum for NDBC parameters using the Maximum % Likelihood Method as outlined by Oltman-Shay & Guza (1984 - JPO). The % inputs are defined on http://www.ndbc.noaa.gov/measdes.shtml - R1 and % R2 are the two spreading parameters (NOTE: 0 Eq. 6 in O-S & G. D = zeros(1,length(dirs)); for ii=1:length(dirs) for n=1:3 for m=1:3 D(ii) = D(ii) + M(n,m) * G(ii,n) * conj(G(ii,m)); end end D(ii) = 1/D(ii); end D = D/sum(D);