Skip to content

Commit 673ee87

Browse files
committed
scipy 1.9 hanning window has been removed, use hann instead
1 parent f1ef941 commit 673ee87

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ibllib/ephys/ephysqc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _compute_metrics_array(raw, fs, h):
113113
detections = spikes.detection(data=destripe.T, fs=fs, h=h, detect_threshold=SPIKE_THRESHOLD_UV * 1e-6)
114114
spike_rate = np.bincount(detections.trace, minlength=raw.shape[0]).astype(np.float32)
115115
channel_labels, _ = voltage.detect_bad_channels(raw, fs=fs)
116-
_, psd = signal.welch(destripe, fs=fs, window='hanning', nperseg=WELCH_WIN_LENGTH_SAMPLES,
116+
_, psd = signal.welch(destripe, fs=fs, window='hann', nperseg=WELCH_WIN_LENGTH_SAMPLES,
117117
detrend='constant', return_onesided=True, scaling='density', axis=-1)
118118
return rms_raw, rms_pre_proc, spike_rate, channel_labels, psd
119119

@@ -220,7 +220,7 @@ def rmsmap(sglx):
220220
if last - first < WELCH_WIN_LENGTH_SAMPLES:
221221
continue
222222
# compute a smoothed spectrum using welch method
223-
_, w = signal.welch(D, fs=sglx.fs, window='hanning', nperseg=WELCH_WIN_LENGTH_SAMPLES,
223+
_, w = signal.welch(D, fs=sglx.fs, window='hann', nperseg=WELCH_WIN_LENGTH_SAMPLES,
224224
detrend='constant', return_onesided=True, scaling='density', axis=-1)
225225
win['spectral_density'] += w.T
226226
# print at least every 20 windows

ibllib/io/extractors/training_audio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def welchogram(fs, wav, nswin=NS_WIN, overlap=OVERLAP, nperseg=NS_WELCH):
8686
continue
8787
# compute PSD estimate for the current window
8888
iw = window_generator.iw
89-
_, W[iw, :] = signal.welch(w, fs=fs, window='hanning', nperseg=nperseg, axis=-1,
89+
_, W[iw, :] = signal.welch(w, fs=fs, window='hann', nperseg=nperseg, axis=-1,
9090
detrend='constant', return_onesided=True, scaling='density')
9191
# the onset detection may have duplicates with sliding window, average them and remove
9292
detect = np.sort(np.array(detect)) / fs

0 commit comments

Comments
 (0)