diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py
index 88ea08957f9d822207702e0a4a3013862acd5637..e903bab26ee7352d3fbddc1d0717ad899a34a6cd 100644
--- a/ohmpi/hardware_system.py
+++ b/ohmpi/hardware_system.py
@@ -345,7 +345,7 @@ class OhmPiHardware:
         if duty_cycle < 1.:
             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)]
-            polarities = [0] * (len(cycles) * 2)
+            polarities = [0] * (len(pol) * 2)
             polarities[0::2] = pol
         else:
             durations = [cycle_duration / 2] * 2 * cycles