function alpha = alpha_rice(B)
    // Empirical formula for calculating the alpha parameter
    // of Rice's distribution of peaks of a band-filtred 
    // random noise.
    // 
    // Usage:
    //       alpha = alpha_rice(B)
    // where
    //       alpha: Rice's parameter
    //       B:     Relative bandwidth of bandpass filter
    //
    // NOTE: Rice's parameter is defined as alpha = (z/2/m)^2
    //       where z is the number of zero-crossings per unit
    //       time and m is the number of maxima per unit time. 
    //       The formula implemented here works up to B = 20. 
    //       For larger B it yields incorrect results since it 
    //       predicts a a minimum value of 0.555 while alpha 
    //       actually tends to 0.
    // 
    // Reference:
    // Rice, Stephen O. (1944). Mathematical Analysis of Random
    //       Noise. Bell System Tech. Journal, 23(3), 282–332.
    //       doi:10.1002/j.1538-7305.1944.tb00874.x        
    // -----------------------------------
    // Author: Federico Miyara
    // Date:   2020-01-30
    
    // Empirically adjusted parameters
    a  =  1.2;
    b  =  7/9;
    c  =  2/9;
    K  =  3.044842;
    
    Q = K*log10(B/1.16);
    
    // Empírical formula
    alpha = b - c*((Q+1)/%pi .* atan((Q+1)/a) - ...
                   (Q-1)/%pi .* atan((Q-1)/a));

endfunction
