Compute median frequency along the specified axes.

    Parameters
    ----------
    sig: ndarray
        input from which median frequency is computed.
    FS: int
        sampling frequency    
    Returns
    -------
    f_max: int
       0.50 of max_frequency using cumsum.

def median_frequency(sig,FS):
    """Compute median frequency along the specified axes.

    Parameters
    ----------
    sig: ndarray
        input from which median frequency is computed.
    FS: int
        sampling frequency    
    Returns
    -------
    f_max: int
       0.50 of max_frequency using cumsum.
    """
    
    f, fs = plotfft(sig, FS, doplot=False)    
    t = cumsum(fs)
    
    ind_mag = find (t>t[-1]*0.50)[0]
    f_median=f[ind_mag]
    return f_median