sparkle.stim package

Submodules

sparkle.stim.abstract_component module

class sparkle.stim.abstract_component.AbstractStimulusComponent[source]

Bases: object

Represents a single component of a complete summed stimulus

amplitude(caldb, calv, atten=0)[source]

Calculates the voltage amplitude for this stimulus, using internal intensity value and the given reference intensity & voltage

Parameters:
  • caldb (float) – calibration intensity in dbSPL
  • calv (float) – calibration voltage that was used to record the intensity provided
auto_details()[source]

A collection of the parameter names that are available to be set using auto-paramter manipulation.

Subclasses should re-implement and add to this list

Returns:dict<dict> – {‘parametername’: {‘label’:str, ‘unit’:str, ‘min’:float, ‘max’:float},}
clean()[source]
static deserialize(stream)[source]
duration()[source]
explore = False
intensity()[source]
loadState(state)[source]

Loads previously saved values to this component.

Parameters:state (dict) – return value from stateDict
name = 'unknown'
protocol = False
risefall()[source]
serialize()[source]
set(param, value)[source]
setDuration(dur)[source]
setIntensity(intensity)[source]
setRisefall(risefall)[source]
signal(fs, atten, caldb, calv)[source]

Creates a signal representation of this stimulus, in the form of a vector of numbers representing electric potential. caldb and calv are used to determine the amplitude of the signal.

Must be implemented by subclass

Parameters:
  • fs (int) – Generation samplerate (Hz) at which this signal will be output
  • atten – actually just 0 for now?
  • caldb (float) – calibration intensity in dbSPL
  • calv (float) – calibration voltage that was used to record the intensity provided
stateDict()[source]

Saves internal values to be loaded later

Returns:dict – {‘parametername’: value, ...}
verify(**kwargs)[source]

Checks this component for invalidating conditions

Returns:str – message if error, 0 otherwise

sparkle.stim.auto_parameter_model module

sparkle.stim.reorder module

sparkle.stim.reorder.order_function(name)[source]
sparkle.stim.reorder.random_order(listofthings)[source]

sparkle.stim.stimulus_model module

Module contents

sparkle.stim.get_stimulus_editor(name)[source]