Skip to content
Snippets Groups Projects
Commit ca02baf8 authored by boa's avatar boa
Browse files

copy constructor

parent 4c7975cb
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,14 @@ class Waveform:
self.sample_len_min = 2 * sample_rate / np.gcd(int(sample_rate), int(freq_res))
assert (self.sample_len_min * freq_res / self.sample_rate) % 2 == 0, "frequency resolution requirement not met"
assert self.sample_len_min % 512 == 0, "sample length not integer multiple of 512"
def copy(self, other):
self.omega = other.omega
self.amplitude = other.amplitude
self.phi = other.phi
self.sample_rate = other.sample_rate
self.freq_res = other.freq_res
self.sample_len_min = other.sample_lem_min
def set_amplitudes(self, amps: np.ndarray) -> bool:
if np.sum(amps) >= 2**15 - 1:
......
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