This list details the bugs found in buggy_oddball.py.
For the correct version, see oddball.py.
normalize_distance_parameters()
-
Incorrect weights normalization, should be divided by
sum()rather thanmean(). -
The function returns only
weights, instead ofdistances, weights. -
The expression:
distances = np.array( [distances] if isinstance(distances, (int, float)) else list([distances]), dtype=int, )
should be fixed to:
distances = np.array( [distances] if isinstance(distances, (int, float)) else list(distances), dtype=int, )
generate_oddball_indices()
-
The line:
oddball_indices = oddball_indices[distances < duration]
Should be replaced with:
oddball_indices = oddball_indices[np.cumsum(distances) < duration]
infer_stimulus_timings()
-
n_clicksis undefined, should be calculated as:n_clicks = int(click_frequency * duration)
create_oddball_audio()
- Missing
click_durationandoddball_durationparameters in function signature. - Return value should be
click_train + oddball_train, rather thanclick_train, oddball_train. librosa.clicksaccepts aclick_freqparameter rather thanclick_tone.- The
oddball_traincreation should includelength=click_train.sizeto return an equally sized array.
generate_oddball_stimulus()
click_durationandoddball_durationshould be provided in seconds, rather than milliseconds.output_pathis not implemented.- The call to
create_oddball_audio()has a typo.
- General
typing.Listis imported but unused.