Skip to content

Commit a0f216f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent ae4372d commit a0f216f

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

physioqc/metrics/chest_belt.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ def romanosqi(
153153

154154
# get the sample frequency down to around 25 Hz for respiratory waveforms
155155
rawresp = operations.interpolate_physio(rawresp, target_fs=targetfs)
156-
timeaxis = np.linspace(0.0, rawresp.data.shape[0] / targetfs, num=rawresp.data.shape[0], endpoint=False)
156+
timeaxis = np.linspace(
157+
0.0, rawresp.data.shape[0] / targetfs, num=rawresp.data.shape[0], endpoint=False
158+
)
157159

158160
# A. Signal Preprocessing
159161
# Apply third order Butterworth bandpass, 0.01-2Hz
@@ -201,9 +203,7 @@ def romanosqi(
201203
rmsnormderiv = (normderiv - einferior) / (esuperior - einferior)
202204
if debug:
203205
plt.plot(timeaxis, rmsnormderiv)
204-
plt.title(
205-
f"Normalized derivative of {label} signal after envelope correction"
206-
)
206+
plt.title(f"Normalized derivative of {label} signal after envelope correction")
207207
plt.show()
208208

209209
# B. Detection of peaks in sliding window
@@ -242,8 +242,16 @@ def romanosqi(
242242
"lowpass",
243243
order=respfilterorder,
244244
).data
245-
thedist = int(targetfs * distfrac/ peakfreqs[i])
246-
segpeaks += ((operations.peakfind_physio(filteredsegment, thresh=0.05, dist=thedist).peaks + segstart) / targetfs).tolist()
245+
thedist = int(targetfs * distfrac / peakfreqs[i])
246+
segpeaks += (
247+
(
248+
operations.peakfind_physio(
249+
filteredsegment, thresh=0.05, dist=thedist
250+
).peaks
251+
+ segstart
252+
)
253+
/ targetfs
254+
).tolist()
247255
filteredsegment -= np.mean(filteredsegment)
248256
if i < numsegs - 1:
249257
respfilteredderivs[

0 commit comments

Comments
 (0)