added more docstrings and moved chirpsim

This commit is contained in:
weygoldt 2023-01-12 09:04:51 +01:00
parent ce1c0fa319
commit 3af4426a26
2 changed files with 8 additions and 6 deletions

View File

@ -171,10 +171,11 @@ def main(datapath: str) -> None:
ident = np.load(datapath + "ident_v.npy", allow_pickle=True) ident = np.load(datapath + "ident_v.npy", allow_pickle=True)
# set time window # <------------------------ Iterate through windows here # set time window # <------------------------ Iterate through windows here
window_duration = 60 * 5 # 5 minutes window window_duration = 60 * 5 * data.samplerate # 5 minutes window
window_overlap = 30 # 30 seconds overlap window_overlap = 30 * data.samplerate # 30 seconds overlap
raw_time = np.arange(data.shape[0])
window_starts = np.arange( window_starts = np.arange(
time[0], time[-1], window_duration) raw_time[0], raw_time[-1], window_duration - window_overlap / 2)
embed() embed()
exit() exit()

View File

@ -17,13 +17,14 @@ def bandpass_filter(
rate : float rate : float
The sampling rate The sampling rate
lowf : float lowf : float
The low frequency cutoff The low cutoff frequency
highf : float highf : float
The high frequency cutoff The high cutoff frequency
Returns Returns
------- -------
np.ndarray : The filtered data np.ndarray
The filtered data
""" """
sos = butter(2, (lowf, highf), "bandpass", fs=rate, output="sos") sos = butter(2, (lowf, highf), "bandpass", fs=rate, output="sos")
fdata = sosfiltfilt(sos, data) fdata = sosfiltfilt(sos, data)