Revision 216
(checked in by gdusek, 15 years ago)
|
Some new files updated and added
|
Line | |
---|
1 |
function HsConf=HsigConf(SM) |
---|
2 |
|
---|
3 |
%This is a modification of the DIWASP Hsig function used to calculate the |
---|
4 |
%95% confidence bounds for the significant wave height |
---|
5 |
% |
---|
6 |
%Added on 9/17/08 by G. Dusek |
---|
7 |
|
---|
8 |
df=SM.freqs(2)-SM.freqs(1); |
---|
9 |
ddir=abs(SM.dirs(2)-SM.dirs(1)); |
---|
10 |
S=SM.S; |
---|
11 |
numFreq=size(SM.freqs,1); |
---|
12 |
|
---|
13 |
|
---|
14 |
%the sig wave height degF will be different since we are summing over all of the |
---|
15 |
%frequency bands. |
---|
16 |
hsigDegF=SM.degF*numFreq; |
---|
17 |
|
---|
18 |
%Calculate the lower and upper confidence coefficients |
---|
19 |
chiUp=chi2inv(.975,hsigDegF); |
---|
20 |
chiLow=chi2inv(.025,hsigDegF); |
---|
21 |
|
---|
22 |
coeffUp=hsigDegF/chiLow; |
---|
23 |
coeffLow=hsigDegF/chiUp; |
---|
24 |
|
---|
25 |
%Calculate the upper and low conf bounds on the sig wave height |
---|
26 |
confUp=sqrt(coeffUp*16*sum(sum(real(S)*df*ddir))); |
---|
27 |
confLow=sqrt(coeffLow*16*sum(sum(real(S)*df*ddir))); |
---|
28 |
HsConf=[confLow,confUp]; |
---|
29 |
|
---|