clc,clear,close all
fr=fopen('C:\Users\qq\Desktop\EEG-double.dat','r');
[A,ls]=fread(fr,'double');
fclose(fr);
figure(1)
plot(A(1:1000))
title('the original signal ');
figure(2)
Y = fft(A,1024);
Pyy = Y.* conj(Y) / 1024;
f = 1000*(0:512)/1024;
plot(f,Pyy(1:513));
title('Frequency content of A');
xlabel('frequency (Hz)');
figure(3) %filtered figures
[b,a]=butter(6,30/250,'low'); %butterworth filter, 250 is half of sampling frequency
AA=filtfilt(b,a,A);
subplot(2,1,1)
plot(A(1:1000))
title('the original signal ');
subplot(2,1,2)
plot(AA(1:1000));
title('the filtered signal with 30Hz of AA');
figure(4)
[b,a]=ellip(6,3/250,'low'); %butterworth filter, 250 is half of sampling frequency
AA1=filtfilt(b,a,AA);
[b,a]=ellip(6,1/250,'high'); %butterworth filter, 250 is half of sampling frequency
delta=filtfilt(b,a,AA1);
[b,a]=ellip(6,7/250,'low'); %butterworth filter, 250 is half of sampling frequency
AA2=filtfilt(b,a,AA);
[b,a]=ellip(6,4/250,'high'); %butterworth filter, 250 is half of sampling frequency
theta=filtfilt(b,a,AA2);
[b,a]=ellip(6,13/250,'low'); %butterworth filter, 250 is half of sampling frequency
AA3=filtfilt(b,a,AA);
[b,a]=ellip(6,8/250,'high'); %butterworth filter, 250 is half of sampling frequency
alfa=filtfilt(b,a,AA3);
[b,a]=ellip(6,14/250,'high'); %butterworth filter, 250 is half of sampling frequency
beita=filtfilt(b,a,AA);
subplot(4,1,1);plot(delta(1:5000));title('the original delta');
subplot(4,1,2);plot(theta(1:5000));title('the original theta');
subplot(4,1,3);plot(alfa(1:5000));title('the original alfa');
subplot(4,1,4);plot(beita(1:5000));title('the original beita');
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
eeg.zip (1个子文件)
eeg.m 2KB
共 1 条
- 1
我虽横行却不霸道
- 粉丝: 75
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0