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_clicks
is undefined, should be calculated as:n_clicks = int(click_frequency * duration)
create_oddball_audio()
- Missing
click_duration
andoddball_duration
parameters in function signature. - Return value should be
click_train + oddball_train
, rather thanclick_train, oddball_train
. librosa.clicks
accepts aclick_freq
parameter rather thanclick_tone
.- The
oddball_train
creation should includelength=click_train.size
to return an equally sized array.
generate_oddball_stimulus()
click_duration
andoddball_duration
should be provided in seconds, rather than milliseconds.output_path
is not implemented.- The call to
create_oddball_audio()
has a typo.
- General
typing.List
is imported but unused.