Skip to content

Signal lines break #22

Description

@Papazola43

Untitled
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:
image

If there is any question regarding the issue, please feel free to ask me.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions