-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description

And this happens more if I add filters like below:
convert list to aray
x = np.array(self.dataBuffer).T
set up mean and scaling coef
`
if self.chunk_idx == 0 or self.mean.size == 0:
self.mean = np.mean(x, axis=1).reshape(-1, 1)
x2 = copy.deepcopy(x) - self.mean
data_range = (np.max(x2, axis=1) - np.min(x2, axis=1) + 0.0000000000001).reshape(-1, 1)
self.scaling = self.channelHeight * CHANNEL_Y_FILL / data_range
self.scaling = np.clip(self.scaling, 0.05, 1e8)
`
rescaling and minus mean
x = x - self.mean x = x * self.scaling
bandpass filter
nyq = 0.5 * 1024
low = 1 / nyq
high = 50 / nyq
order = 5
b, a = signal.butter(order, [low,high], btype='band')
x = signal.filtfilt(b, a, x, axis=1)`
turn back to list
`self.dataBuffer = list(x.T)
This is the signal after filtering:

If there is any question regarding the issue, please feel free to ask me.
Metadata
Metadata
Assignees
Labels
No labels