Skip to content

Commit ba50c3b

Browse files
committed
autotune: downsample previewed signal to improve fluidity
1 parent 7c669e7 commit ba50c3b

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

autotune/data_selection_window.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,20 @@ def loadZData(self):
9090
def refreshInputOutputData(self, axis=0):
9191
if self.file_name:
9292
self.axis = axis
93-
(self.t, self.u, self.y, self.v) = getInputOutputData(self.file_name, axis)
93+
(t, u, y, _) = getInputOutputData(self.file_name, axis)
94+
95+
if(len(t) > 10e3):
96+
# Downsample to speed up plotting preview
97+
downsampling_factor = int(len(t)/10e3)+1
98+
self.t = t[:-downsampling_factor+1:downsampling_factor]
99+
self.u = u[:-downsampling_factor+1:downsampling_factor]
100+
self.y = y[:-downsampling_factor+1:downsampling_factor]
101+
102+
else:
103+
self.t = t
104+
self.u = u
105+
self.y = y
106+
94107
self.plotInputOutput(redraw=True)
95108

96109
def plotInputOutput(self, redraw=False):

0 commit comments

Comments
 (0)