Skip to content

Commit

Permalink
assertion for sigma_ms too short according to srate in smooth function
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinGhibaudo committed Jun 18, 2024
1 parent 5f25b91 commit f6ecee4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion physio/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def smooth_signal(trace, srate, win_shape='gaussian', sigma_ms=5.0):
trace_smooth: np.array
The smoothed traces
"""

size = int(srate * sigma_ms / 1000.)
assert size > 0, 'sigma_ms is too short for srate = {}. sigma_ms should be at least {} ms'.format(srate, round(1000/srate,1))
if win_shape == 'gaussian':
times = np.arange(- 5 * size, 5 * size + 1)
kernel = np.exp(- times ** 2 / size ** 2)
Expand Down

0 comments on commit f6ecee4

Please sign in to comment.