Skip to content

Commit

Permalink
Additional fixes based on review
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hurst committed Apr 28, 2021
1 parent 6aedaea commit b62e4cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/matlab_differences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Differences in Signal Detrending
--------------------------------

In the PREP pipeline, trends (i.e., slow drifts in EEG baseline signal) are
temporarily removed from the data prior to line-noise removal with CleanLine
temporarily removed from the data prior to adaptive line-noise removal
as well as prior to bad channel detection via :class:`~pyprep.NoisyChannels`,
which occurs at multiple points during robust re-referencing. This is done to
improve the accuracy of both of these processes, which are sensitive to
Expand Down
5 changes: 3 additions & 2 deletions pyprep/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,11 @@ def _eeglab_create_highpass(cutoff, srate):
"""
TRANSITION_WIDTH_RATIO = 0.25
trans_bandwidth = cutoff if cutoff < 2 else cutoff * TRANSITION_WIDTH_RATIO
HAMMING_CONSTANT = 3.3 # note: not entirely clear what this represents

# Calculate parameters for constructing filter
order = 3.3 / (trans_bandwidth / srate)
trans_bandwidth = cutoff if cutoff < 2 else cutoff * TRANSITION_WIDTH_RATIO
order = HAMMING_CONSTANT / (trans_bandwidth / srate)
order = int(np.ceil(order / 2) * 2) # ensure order is even
stop = cutoff - trans_bandwidth
transition = (stop + cutoff) / srate
Expand Down

0 comments on commit b62e4cf

Please sign in to comment.