Skip to content
Snippets Groups Projects
Commit 0bdd109b authored by camera computer's avatar camera computer
Browse files

QOL functions for waveform class

parent dcab6225
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,19 @@ class Waveform:
self.sample_len_min = 2 * sample_rate / freq_res / 100 # !!! this only works for sample_rate = 614.4e6 !!!
def set_amplitudes(self, amps: np.ndarray) -> bool:
if np.sum(amps) >= 2**15 - 1:
print("warning: amplitudes too high")
return False
self.amplitude = amps[:len(amplitude)]
return True
def set_phase(self, phase: np.ndarray) -> bool:
self.phi = phase
return True
def create_static_array(wfm: Waveform, full=False) -> np.ndarray:
"""
create a static-array-generating waveform with user set number of samples
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment