function buoyDistFine()
    fn = '../../waveData/xy029p101_201903020000-201903032359';
    [r,stepError] = readBuoyFile(fn);
    fs = 1.28;
    N30 = 60*30*fs;
    Ns = size(r,1);     % number of samples.
    Ng = floor(Ns/N30); % number of 30 minute groups of samples.
    Nfft = 128;         % the rest assumes N30/Nfft is an integer.
    Ne = N30/Nfft;      % number of FFT's in a 30 minute ensemble. 
    eta = reshape(r(1:Ng*N30,3)/100,Nfft,Ne,Ng);
    eta = eta - mean(eta,1); % remove mean from each column.
    error = sum(reshape(stepError(1:Ng*N30),N30,Ng));  
    dist_E = NaN(Ne,Ng);
    n_p = 8;  % The index of the peak amplitude in the fft, f_8 = 0.07 Hz;
    for ng = 1:Ng
        if error(ng)==0
            H = fft(squeeze(eta(:,:,ng)));
            H_peak = H(n_p,:);
            dist_E(:,ng) = (2/(Nfft*fs))*abs(H_peak).^2;
        end
    end 
    mu = mean(dist_E);    
    u  = reshape(dist_E./mu,1,[]);      
    u_bin_edges = 0:0.25:9;
    histogram(u,u_bin_edges,'Normalization','pdf')
    hold on
    x = 0:0.1:10;
    plot(x,exp(-x));
    texText('$u$ [-]','x')
    texText('probability density','y')
    hold off
    graphToPDF('distFine.pdf',4,3)
    
end