Commit 6b87faa6 authored by Olivier Kaufmann's avatar Olivier Kaufmann
Browse files

Fixes a bug in vab_square_wave

Showing with 2 additions and 1 deletion
+2 -1
......@@ -153,7 +153,7 @@ class OhmPiHardware:
def vab_square_wave(self, vab, length, sampling_rate, cycles=3, polarity=1):
self.tx.polarity = polarity
self._vab_pulses(vab, [length]*cycles, sampling_rate)
self._vab_pulses(vab, [length]*2*cycles, sampling_rate)
def _vab_pulse(self, vab, length, sampling_rate=None, polarity=None, append=False):
""" Gets VMN and IAB from a single voltage pulse
......@@ -183,5 +183,6 @@ class OhmPiHardware:
else:
polarities = [-self.tx.polarity * np.heaviside(i % 2, -1.) for i in range(n_pulses)]
self._clear_values()
print(f'Polarities: {polarities}') # TODO: delete me
for i in range(n_pulses):
self._vab_pulse(self, length=lengths[i], sampling_rate=sampling_rate, polarity=polarities[i], append=True)
\ No newline at end of file
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