Chunk size for real time filtering?
grahambriggs
Corvallis
I understand that I need to apply some filtering to the raw signal in order to plot meaningful EEG graphs.
The usual recipe seems to be bandpass and notch filter. The brainflow code examples show how this is done.
My question is: What is an appropriate 'chunk size' to pass to the filter for real time data? Should I be filtering the last 100 ms, 250ms, 1000 ms of data? I assume it might depend on the sample rate, so maybe I should send in a minimum of 12, or 25 or 50 samples?
My current thought is that I want to update the graph UI at 10Hz, so I would be using either 25 samples (for 250HZ sample rate on Cyton) or 12 samples (for 125 sample rate on Cyton+Daisy) for each pass through the filter. Is this enough data for the filter to work effectively?
If anyone can provide some guidance on how to do filtering for the purpose of displaying real time EEG plots, it would be much appreciated.
Thank you
Comments
Depends on how you want the graph to look and how fast you want real time updates. I suggest enough points to get a smooth line when displayed, so at least 100, Also, there will be a delay of chunk size time for each graph update, so too large a chunk will mean a longer wait to see each chunk of data in real time. About a second seems okay there. If you are not doing real time graphs, you can use a big chunk size, perhaps 10 seconds.
Remember you will need to trim the sides of the chunk to clean filtering artifact, so the chunks will need to overlap before trimming.