Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to put filter in SigVisualizer? #19

Open
iPsych opened this issue Jan 26, 2020 · 2 comments
Open

Is it possible to put filter in SigVisualizer? #19

iPsych opened this issue Jan 26, 2020 · 2 comments

Comments

@iPsych
Copy link

iPsych commented Jan 26, 2020

I am trying to put the filtering or PSD calculation in the middle of SigVisualizer.
In the paintwidget.py, where is the best place to put the some code lines using scipy.signal and mne.filter?

from scipy.signal import lfilter, lfilter_zi
from mne.filter import create_filter

window = 10
n_samples = int(self.sfreq * window)
#self.sfreq=params['metadata']['srate']
#n_chans=params['metadata']['ch_count']

self.data_f = np.zeros((n_samples, self.n_chans))
self.data = np.zeros((n_samples, self.n_chans))
self.af = [1.0]
self.bf = create_filter(self.data_f.T, self.sfreq, 3, 40.,
                            method='fir')
@Yida-Lin
Copy link
Member

Yida-Lin commented Mar 3, 2020

Hi @iPsych , looks to me like this should be added somewhere under the get_data() method of class PaintWidget(QWidget). @cboulay would you have any input on whether/how we could potentially put filters here?

@mkeute
Copy link

mkeute commented Jun 30, 2022

I tried to implement this in my fork, it seems to work well (at least as long as there is only one stream). I put the filter right into the DataThread.run method.
https://github.com/mkeute/App-SigVisualizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants