expyfun.stimuli.vocode#
- expyfun.stimuli.vocode(data, fs, n_bands=16, freq_lims=(200.0, 8000.0), scale='erb', order=2, lp_cutoff=160.0, lp_order=4, mode='noise', rate=200, seed=None, axis=-1, verbose=None)[source]#
Vocode stimuli using a variety of methods
- Parameters:
- dataarray-like
Data array.
- fsfloat
Sample rate.
- n_bandsint
Number of bands to use.
- freq_limstuple
2-element list of lower and upper frequency bounds.
- scalestr
Scale on which to equally space the bands. Possible values are “erb”, “log” (base-2), and “hz”.
- orderint
Order of analysis and synthesis. NOTE: Using too high an order can cause instability, always check outputs for order > 2!
- lp_cutofffloat
Frequency of the envelope low-pass.
- lp_orderint
Order of the envelope low-pass.
- modestr
The type of signal used to excite each band. Options are “noise” for band-limited noise, “tone” for sinewave-at-center-frequency, or “poisson” for a poisson process of band-limited clicks at the rate given by
poisson_rate
.- rateint
Average number of clicks per second for the poisson train used to excite each band (when mode==”poisson”).
- seedint | None
Random seed to use. If
None
, no seeding is done.- axisint
Axis to operate over.
- verbosebool, str, int, or None
If not None, override default verbose level.
- Returns:
- vocarray-like
Vocoded stimuli of the same shape as data.
Notes
The default settings are adapted from a cochlear implant simulation algorithm described by Zachary Smith (Cochlear Corp.).