Bandpass filtering EEG data

32 ビュー (過去 30 日間)
Pavlov
Pavlov 2014 年 11 月 21 日
編集済み: Star Strider 2014 年 11 月 21 日
Hey guys,
I am currently messing around with ways to filter EEG data I have recorded. I am currently trying bandpass filtering my data, but the data after filtering looks funky. The raw data I record is measured in mV, and has mostly "small" values, mainly <0.5 but occasionally >1. After using the bandpass filter below, data look funny, with values become "huge" (y axis goes from -400:400). I am hoping someone can give me some basic pointers on what filter parameters I need to change.
Fstop1 = 0.1; % First Stopband Frequency
Fpass1 = 0.2; % First Passband Frequency
Fpass2 = 95; % Second Passband Frequency
Fstop2 = 100; % Second Stopband Frequency
Astop1 = 60; % First Stopband Attenuation (dB)
Apass = 1; % Passband Ripple (dB)
Astop2 = 80; % Second Stopband Attenuation (dB)
match = 'stopband'; % Band to match exactly
% Construct an FDESIGN object and call its BUTTER method.
bpfilt = fdesign.bandpass(Fstop1,Fpass1,Fpass2,Fstop2,Astop1,Apass,Astop2,Fs);
Hd = design(bpfilt, 'butter', 'MatchExactly', match);
eegdata = filter(Hd,eegdata);
I have attached images on the data plotted before and after using this filter.

採用された回答

Star Strider
Star Strider 2014 年 11 月 21 日
I can’t run your code because I don’t have ‘Fs’. I almost always use the second-order-section implementation of a filter, since those tend to be stable when transfer functions are not.
Before you actually use your filter, be sure to look at the filter passband with freqz. This will tell you how stable it is and what the passband actually looks like.
  2 件のコメント
Pavlov
Pavlov 2014 年 11 月 21 日
Also, can you explain what 'second-order-section implementation' and 'transfer function' mean?
Star Strider
Star Strider 2014 年 11 月 21 日
編集済み: Star Strider 2014 年 11 月 21 日
Second-order sections are a bit much to explain here, so I’ll refer you to the documentation on tf2sos. I don’t see an automatic option for second-order section implementation in fdesign. I’m not that familiar with it, since I use the lower-level functions to design my filters.
A ‘transfer function’ is the frequency response of a filter (or network, control system, etc.), usually displayed as a Bode plot with amplitude and phase.
Noted for later:
Fs = 4KHz
It’s the end of my day as well.

サインインしてコメントする。

その他の回答 (1 件)

Pavlov
Pavlov 2014 年 11 月 21 日
Thanks, I will try this tomorrow as I am heading home for the night. Fs = 4000 in my case.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by