how to do digital filter on this EEG data

Hi! I recently recorded an EEG signal at 50K Hz sampling rate. The signal was band passed at 1-500Hz before it was digitalized. Now I wanted to do a digital fitlering to this data, which is a low pass filter to cut off bands with frequency larger than 10Hz. But I found it hard to achieve. My code was like this:
filter_n=20*sample_rate;
cutoff=10; %cutoff frequency
lowpass=fir1(filter_n,cutoff*2/sample_rate,'low');
y_lowpass=filter(lowpass,1,y);
But I found the low-passed signal still had much power in bands larger than 10Hz. Can someone help me out? Thanks!

 採用された回答

Honglei Chen
Honglei Chen 2012 年 7 月 25 日

0 投票

Is your sample_rate 50K? If so, your filter is huge at the order of 1 million. This is way too long.
fir1 uses window method so you need to first pick a window. By default, a Hamming window is used. In addition, for your particular case, you have a 50 kHz sample rate and you are trying to low pass it to 10 Hz, this is not a very effective design. You may want to down sample it first.
if you want more attenuation, you may want to change the window to something like Chebyshev or Taylor. You could see your filter response by using
fvtool(lowpass,1)

2 件のコメント

Haoran Xu
Haoran Xu 2012 年 7 月 26 日
Thanks! I wonder if I want to do a down sampling, what sample rate should I use on this specific purpose? How to calculate that?
Honglei Chen
Honglei Chen 2012 年 7 月 26 日
That's a decision you need to make. To restore something at 10Hz, you need to make sure that the resulting frequency is at leat 20 Hz. Beyond that, it's your call for different tradeoffs.

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

その他の回答 (1 件)

Wayne King
Wayne King 2012 年 7 月 26 日

0 投票

I think Honglei has given you good advice. And I do think you should consider downsampling your data with decimate.m, or resample.m, provided you have enough data.
50 kHz is way oversampled for EEG data. Usually most of the interesting features in the EEG are below 100 Hz.

2 件のコメント

Haoran Xu
Haoran Xu 2012 年 7 月 26 日
Thanks!
Another question: is there any effects if I do a power spectrum on the original 50K data to see 0-32Hz band, without doing the low pass in advance?
In other words, whether a low pass fitering is a must when I want to check the low-frequency band signal.
Honglei Chen
Honglei Chen 2012 年 7 月 26 日
To see the power spectrum, you don't have to do the low pass filtering. Unless the noise in the high frequency band is too strong and makes it difficult for you to identify what you want to see.

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

カテゴリ

ヘルプ センター および File ExchangeEEG/MEG/ECoG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by