waveform¶
See the How-To guide for complete instructions on defining new user waveforms.
-
class
wavgen.waveform.Superposition(freqs, mags=None, phases=None, sample_length=None, amp=1.0)[source]¶ Bases:
waveform_base.WaveformA static trap configuration.
-
Waves¶ The list of composing pure tones. Each object holds a frequency, magnitude, and relative phase.
- Type
list of
Wave
Hint
There are now 3 relevant amplitudes here:
Output Voltage Limit,Waveform Amplitude, & theamplitudes of each pure tonecomposing a superposition. Each one is expressed as a fraction of the previous.See also
even_spacing()An alternative constructor for making
Superpositionobjects.
-
__init__(freqs, mags=None, phases=None, sample_length=None, amp=1.0)[source]¶ Provides several options for defining waveform duration.
- Parameters
freqs (list of int) – A list of frequency values, from which wave objects are automatically created.
mags (list of float, optional) – Vector representing relative magnitude of each trap, within [0,1] (in order of increasing frequency).
phases (list of float, optional) – Vector representing initial phases of each trap tone, within [0, 2*pi] (in order of increasing frequency).
sample_length (int, optional) – Length of waveform in samples.
amp (float, optional) – Amplitude of waveform relative to maximum output voltage.
-
get_magnitudes()[source]¶ - Returns
Value of
Magnitudefor each pure tone, in order of increasing frequency.- Return type
list of float
-
set_magnitudes(mags)[source]¶ Sets the
Magnitudeof each pure tone.- Parameters
mags (list of float) – Each new magnitude, limited to ([0, 1]), ordered by ascending frequency).
-
-
wavgen.waveform.even_spacing(ntraps, center, spacing, mags=None, phases=None, sample_length=None, amp=1.0)[source]¶ - Wrapper function which simplifies defining
Superpositionobjects to describe equally spaced traps.
- Parameters
ntraps (int) – Number of optical traps.
center (int) – Mean or center frequency of the traps.
spacing (int) – Frequency spacing between traps.
mags (list of float, optional) – Vector representing relative magnitude of each trap, within [0,1] (in order of increasing frequency).
phases (list of float, optional) – Vector representing initial phases of each trap tone, within [0, 2*pi] (in order of increasing frequency).
sample_length (int, optional) – Length of waveform in samples.
amp (float, optional) – Amplitude of waveform relative to maximum output voltage.
- Returns
- Return type
- Wrapper function which simplifies defining
-
class
wavgen.waveform.Sweep(config_a, config_b, sweep_time=None, sample_length=16000000)[source]¶ Bases:
waveform_base.WaveformDescribes a waveform which smoothly modulates from one
Superpositionto another.-
WavesA, WavesB Basically full descriptions of 2
Superpositionobjects; i.e. 2 lists of pure tones, including each frequency, magnitude, & phase.- Type
list of
Wave
-
Damp¶ Expresses the change in
Amplitudeas the waveform modulates from initial to final configuration.- Type
float
Warning
Sometimes, roughly 1 out of 8 times, the calculation of a
Sweepobject will silently fail; resulting in correct number of data points, except all 0-valued. To avoid the uncertainty of re-calculation, be sure to saveSweepobjects to named files. Also, check calculations withSweep.plot().-
__init__(config_a, config_b, sweep_time=None, sample_length=16000000)[source]¶ Allows for defining the duration in terms of milliseconds or samples.
- Parameters
config_b (config_a,) – These play the initial & final configurations of the Sweep form, going from A to B respectively.
sweep_time (float, optional) – The time, in milliseconds, that the waveform will spend to complete the entire modulation. Overrides sample_length
sample_length (int, optional) – Otherwise, one can simply fix the length to an integer number of samples.
-
-
class
wavgen.waveform.HS1(pulse_time, center_freq, sweep_width, duration=None, amp=1.0)[source]¶ Bases:
waveform_base.WaveformEmbodies a Hyperbolic-Secant Pulse.
-
Tau¶ Characteristic length of pulse; expressed in samples.
- Type
float
-
Center¶ The frequency at which the sweep is centered about; expressed as oscillations per sample.
- Type
float
-
BW¶ Bandwith or width of the range the frequency is swooped across; expressed as oscillations per sample.
- Type
float
See also
- B Peaudecerf et al 2019 New J. Phys. 21 013020 (Section 3.1)
Relevant context. Used to verify functional form.
- M. Khudaverdyan et al 2005 Phys. Rev. A 71, 031404(R)
Slightly more relevant…yet less useful.
-
__init__(pulse_time, center_freq, sweep_width, duration=None, amp=1.0)[source]¶ - Parameters
pulse_time (float) – Sets the characteristic time.
center_freq (int) – The frequency sweep is centered about this value.
sweep_width (int) – How wide, in frequency, the sweep swoops.
duration (float, optional) – Used to fix the waveform duration, while the pulse width itself is unaffected. Otherwise, we follow a recommendation from the first reference above.
amp (float, optional) – Amplitude of waveform relative to maximum output voltage.
-