Commit 0d079472 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Test duty_cycle in vab_square_wave

Showing with 1 addition and 1 deletion
+1 -1
...@@ -345,7 +345,7 @@ class OhmPiHardware: ...@@ -345,7 +345,7 @@ class OhmPiHardware:
if duty_cycle < 1.: if duty_cycle < 1.:
durations = [cycle_duration/2 * duty_cycle, cycle_duration/2*(1.-duty_cycle)] * cycles durations = [cycle_duration/2 * duty_cycle, cycle_duration/2*(1.-duty_cycle)] * cycles
pol = [-self.tx.polarity * np.heaviside(i % 2, -1.) for i in range(cycles)] pol = [-self.tx.polarity * np.heaviside(i % 2, -1.) for i in range(cycles)]
polarities = [0] * (len(cycles) * 2) polarities = [0] * (len(pol) * 2)
polarities[0::2] = pol polarities[0::2] = pol
else: else:
durations = [cycle_duration / 2] * 2 * cycles durations = [cycle_duration / 2] * 2 * cycles
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment