hi, i am trying to plot my eeg dataset with and without filter.The plots which i got after applying butterworth filter is in an amplified form.i am attchng image (with filter) and code for plotting eeg(without filter).pls help me

3 次查看(过去 30 天)
%without filter
clc;
clear all;
Fs=256;
cd('E:\Thesis EEG\MIT_EEG_Database\P1');
ea=dir;
for i=3:5
ea(i).name
s=load(ea(i).name);
x=[s.val];
[r,c]=size(x);
for j=1:2
window=x(1,(j-1)*256+1:j*256);
figure;
plot(window);
end
end

回答(1 个)

Kris Fedorenko
Kris Fedorenko 2017-8-8
Hi Nirmal!
I do not have a lot of domain knowledge in this area, but based on the documentation page for the "butter" function , using the [z,p,k] syntax might be more numerically stable than using [a,b] syntax.
You should be able to use this syntax as follows:
[z,p,k] = butter(n, Wn);
[b,a] = zp2tf(z,p,k);
Y = filter(b1, a1, x');
I have reproduced your code and tried it on a few EEG data files from this database .
Using [z,p,k] syntax for the "butter" function results in filtered data of similar magnitudes as the original data, while using [a,b] syntax made filter data appear amplified. So I hope this helps!
Kris

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by