diff --git a/code/chirpdetection.py b/code/chirpdetection.py index 889004f..603c20b 100644 --- a/code/chirpdetection.py +++ b/code/chirpdetection.py @@ -171,10 +171,11 @@ def main(datapath: str) -> None: ident = np.load(datapath + "ident_v.npy", allow_pickle=True) # set time window # <------------------------ Iterate through windows here - window_duration = 60 * 5 # 5 minutes window - window_overlap = 30 # 30 seconds overlap + window_duration = 60 * 5 * data.samplerate # 5 minutes window + window_overlap = 30 * data.samplerate # 30 seconds overlap + raw_time = np.arange(data.shape[0]) window_starts = np.arange( - time[0], time[-1], window_duration) + raw_time[0], raw_time[-1], window_duration - window_overlap / 2) embed() exit() diff --git a/code/modules/filters.py b/code/modules/filters.py index 499a3dc..5192cdc 100644 --- a/code/modules/filters.py +++ b/code/modules/filters.py @@ -17,13 +17,14 @@ def bandpass_filter( rate : float The sampling rate lowf : float - The low frequency cutoff + The low cutoff frequency highf : float - The high frequency cutoff + The high cutoff frequency Returns ------- - np.ndarray : The filtered data + np.ndarray + The filtered data """ sos = butter(2, (lowf, highf), "bandpass", fs=rate, output="sos") fdata = sosfiltfilt(sos, data)