Pulse types¶
These classes are principly intended to be used as argument for stimulus.Train.
Pulse types for analog output¶
The following pulse types are defined for analog output.
- class picodaq.stimulus.Pulse(amplitude: Voltage, duration: Time)¶
A simple monophasic pulse
- Parameters:
amplitude – The amplitude of the pulse (relative to baseline), in units of voltage. The amplitude may be negative.
duration – The duration of the pulse, in units of time.
- class picodaq.stimulus.Square(amplitude: Voltage, duration: Time, amplitude2: Voltage | None = None, duration2: Time | None = None)¶
Representation of a square wave (biphasic pulse)
- Parameters:
amplitude – The amplitude of the first phase of the wave (relative to baseline), in units of voltage. The amplitude may be negative.
duration – The duration of the first phase of the wave, in units of time.
amplitude2 – The amplitude of the second phase of the wave. If omitted, defaults to the opposite of the polarity of the first phase.
duration2 – The duration of the second phase of the wave. If omitted, defaults to the duration of the first phase.
The full duration of the waveform is the sum of the duration of the two phases. There is never a delay between first and second phases.
For a traditional function-generator square wave with peak-to-peak amplitude A and frequency F, set amplitude = A/2 and duration = 0.5/F and leave amplitude2 and duration2 unspecified.
- class picodaq.stimulus.Sawtooth(start: Voltage, end: Voltage, duration: Time)¶
Representation of a sawtooth wave
- Parameters:
start – Voltage at start of the waveform, relative to baseline
end – Voltage at end of the waveform, ditto
duration – The duration of the ramp, in units of time.
For a traditional function-generator sawtooth with peak-to-peak amplitude A and frequency F, set start = −`A`/2, end = +`A`/2, and duration = 1/F.
- class picodaq.stimulus.Triangle(amplitude: Voltage, duration: Time, amplitude2: Voltage | None = None, duration2: Time | None = None)¶
Representation of a triangle wave
- Parameters:
amplitude – The amplitude of the first phase of the wave (relative to baseline), in units of voltage. The amplitude may be negative.
duration – The duration of the first phase of the wave, in units of time.
amplitude2 – The amplitude of the second phase of the wave. If omitted, defaults to the opposite of the polarity of the first phase.
duration – The duration of the second phase of the wave.
To create a traditional function-generator triangle wave with peak-to-peak amplitude A and frequency F, set amplitude = A/2 and duration = 0.5/F. A second phase with equal duration and opposite polarity will be added automatically.
To create asymmetric triangles, the parameters of the second phase may be specified explicitly. If amplitude2 is given but duration2 is omitted, the latter is calculated to keep the (absolute) slope of the wave constant.
Pulse type for digital output¶
- class picodaq.stimulus.TTL(duration: Time, active_low: bool = False)¶
Representation of a digital stimulus
- Parameters:
duration – The duration of the pulse, in units of time.
active_low – If true, the polarity of the entire stimulus is inverted, that is, the line is high outside the pulse and low inside.
This may only be applied to digital outputs. To send TTL pulses to an analog output, use the
Pulseshape with amplitude set to 5 V.