Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 21, 2025
1 parent ae4372d commit a0f216f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions physioqc/metrics/chest_belt.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ def romanosqi(

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

# A. Signal Preprocessing
# Apply third order Butterworth bandpass, 0.01-2Hz
Expand Down Expand Up @@ -201,9 +203,7 @@ def romanosqi(
rmsnormderiv = (normderiv - einferior) / (esuperior - einferior)
if debug:
plt.plot(timeaxis, rmsnormderiv)
plt.title(
f"Normalized derivative of {label} signal after envelope correction"
)
plt.title(f"Normalized derivative of {label} signal after envelope correction")
plt.show()

# B. Detection of peaks in sliding window
Expand Down Expand Up @@ -242,8 +242,16 @@ def romanosqi(
"lowpass",
order=respfilterorder,
).data
thedist = int(targetfs * distfrac/ peakfreqs[i])
segpeaks += ((operations.peakfind_physio(filteredsegment, thresh=0.05, dist=thedist).peaks + segstart) / targetfs).tolist()
thedist = int(targetfs * distfrac / peakfreqs[i])
segpeaks += (
(
operations.peakfind_physio(
filteredsegment, thresh=0.05, dist=thedist
).peaks
+ segstart
)
/ targetfs
).tolist()
filteredsegment -= np.mean(filteredsegment)
if i < numsegs - 1:
respfilteredderivs[
Expand Down

0 comments on commit a0f216f

Please sign in to comment.