Skip to content

Recent changes to corrections.py is dropping peaks too liberally #96

@dillancellier

Description

@dillancellier

Not sure why yet, but perhaps something to do with the new ordering of the functions in corrections.py

The first peak in this signal will not be returned in the final fit. This isn't because it's not getting a gaussian, but the peak is being dropped after corrections.py :

Image

Code to investigate:

time_range = (-0.2, 0.7)
nlv = 0.1
fs = 1000

# simulate ERP
erp_latency = [0.2, 0.32]
erp_amplitude = [0.5, 0.8]
erp_width = [0.04, 0.04]
erp_params = np.ravel(np.column_stack([erp_latency, erp_amplitude, erp_width]))
np.random.seed(42)
time, erp = simulate_erp(time_range, erp_params, nlv=nlv, fs=fs)

# Apply ERPparam
tfm = ERPparam(verbose=False, max_n_peaks=4)

tfm.fit(time, erp, time_range=[0, 1.0])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions