acoustic_data_science/processing/process_data.py
def calc_background_spl(df, background_window_mins=10):
    """
    Calculate 'background' sound level using moving average of normalised
    background SPL.
    """

    # Background window is in half second intervals.
    background_window = background_window_mins * 60 * 2
    df["background_spl"] = (
        df["broadband_spl"].rolling(background_window).mean()
    )

    # Start of data (duration of window) will be null so drop it.
    df = df.drop(df[pd.isnull(df["background_spl"])].index).reset_index(
        drop=True
    )

    return df

    Calculate 'background' sound level using moving average of normalised
    background SPL.
    
Calculate 'background' sound level using moving average of normalised
background SPL.
Calculate ' background ' sound level using moving average of normalised background SPL .
def calc_background_spl(df, background_window_mins=10):
    background_window = background_window_mins * 60 * 2
    df["background_spl"] = (
        df["broadband_spl"].rolling(background_window).mean()
    )
    df = df.drop(df[pd.isnull(df["background_spl"])].index).reset_index(
        drop=True
    )
    return df
def calc_background_spl ( df , background_window_mins = 10 ) : background_window = background_window_mins * 60 * 2 df [ "background_spl" ] = ( df [ "broadband_spl" ] . rolling ( background_window ) . mean ( ) ) df = df . drop ( df [ pd . isnull ( df [ "background_spl" ] ) ] . index ) . reset_index ( drop = True ) return df
Calculate 'background' sound level using moving average of normalised
background SPL.
Calculate ' background ' sound level using moving average of normalised background SPL .
"""
    Calculate 'background' sound level using moving average of normalised
    background SPL.
    """ # Background window is in half second intervals. # Start of data (duration of window) will be null so drop it.
df
background_window_mins