您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 管理学资料 > matlab脑电信号处理
matlabÄÔµçÐźŴ¦Àít=0.001:0.001:1;x=load('C:\Users\yxzhang\Desktop\rest_close.txt');%¶ÁÈ¡Îļþy=load('C:\Users\yxzhang\Desktop\audio_close.txt');xx={};%ÿ¸öµ¼ÁªµÄÊý¾Ý´æ´¢yy={};n=1000;%Êý¾ÝÊýÄ¿sc=7;%С²¨°üµÄ·Ö½â³ß¶Èfori=1:1:8%µ¼ÁªµÄÊý¾Ý·ÖÀëxx{i}=x(:,i);yy{i}=y(:,i);endfori=1:1:8%»³öÔʼÐźÅͼÏñfiguresubplot(2,2,1)plot(t,xx{i})axis([min(t)max(t)1.1*floor(min(xx{i}))1.1*ceil(max(xx{i}))])title('restcloseÔʼÐźÅ')ylabel('·ùÖµ')subplot(2,2,2)plot(t,yy{i})axis([min(t)max(t)1.1*floor(min(yy{i}))1.1*ceil(max(yy{i}))])title('audiocloseÔʼÐźÅ')ylabel('·ùÖµ')%fft_ÔʼÐźŵÄƵÆ×·ÖÎöxx1=fft(xx{i},n);pxx1=xx1.*conj(xx1)/n;yy1=fft(yy{i},n);pyy1=yy1.*conj(yy1)/n;%»³ö0-30hzÄڵŦÂÊÆ×ͼÏñn=60;f=1:n/2;subplot(2,2,3);plot(f,pxx1(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('rest_close¹¦ÂÊÆ×')subplot(2,2,4);plot(f,pyy1(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('audio_closeµÄ¹¦ÂÊÆ×')%·Ö½âÐźÅÑ¡Ôñ·Ö½â³ß¶ÈΪ7£¬Í¬Ê±Öع¹ÐźÅwpt=wpdec(xx{i},sc,'db7','shannon');%С²¨°ü·Ö½âÐźÅxx80=wprcoef(wpt,[sc,0]);%Öع¹ÐźÅxx81=wprcoef(wpt,[sc,1]);xx82=wprcoef(wpt,[sc,2]);xx83=wprcoef(wpt,[sc,3]);wpt=wpdec(yy{i},8,'db7','shannon');yy80=wprcoef(wpt,[sc,0]);yy81=wprcoef(wpt,[sc,1]);yy82=wprcoef(wpt,[sc,2]);yy83=wprcoef(wpt,[sc,3]);%»³öÖع¹ÐźÅfiguresubplot(2,1,2);plot(yy80);title('audioclosedelta');ylabel('·ùÖµ');subplot(2,1,1);plot(xx80);title('restclosedelta');ylabel('·ùÖµ');figuresubplot(2,1,1);plot(xx81);title('restclosetheta');ylabel('·ùÖµ');subplot(2,1,2);plot(yy81);title('audioclosetheta');ylabel('·ùÖµ');figuresubplot(2,1,1);plot(xx82);title('restclosealpha');ylabel('·ùÖµ');subplot(2,1,2);plot(yy82);title('audioclosealphta');ylabel('·ùÖµ');figuresubplot(2,1,1);plot(xx83);title('restclosebeta');ylabel('·ùÖµ')subplot(2,1,2);plot(yy83);title('audioclosebeta');ylabel('·ùÖµ');n=1000;%fft_Öع¹ÐźŵÄƵÆ×·ÖÎöxx180=fft(xx80,n);pxx180=xx180.*conj(xx180)/n;xx181=fft(xx81,n);pxx181=xx181.*conj(xx181)/n;xx182=fft(xx82,n);pxx182=xx182.*conj(xx182)/n;xx183=fft(xx83,n);pxx183=xx183.*conj(xx183)/n;yy180=fft(yy80,n);pyy180=yy180.*conj(yy180)/n;yy181=fft(yy81,n);pyy181=yy181.*conj(yy181)/n;yy182=fft(yy82,n);pyy182=yy182.*conj(yy182)/n;yy183=fft(yy83,n);pyy183=yy183.*conj(yy183)/n;%»³öÖع¹ÐźŵŦÂÊÆ×ͼn=60;f=1:n/2;figuresubplot(2,1,1);plot(f,pyy180(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('restclosedeltaµÄ¹¦ÂÊÆ×');subplot(2,1,2);plot(f,pyy180(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('audioclosedettaµÄ¹¦ÂÊÆ×');figuresubplot(2,1,1);plot(f,pxx181(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('restclosethetaµÄ¹¦ÂÊÆ×');subplot(2,1,2);plot(f,pyy181(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('audioclosethetaµÄ¹¦ÂÊÆ×');figuresubplot(2,1,1);plot(f,pxx182(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('restclosealphaµÄ¹¦ÂÊÆ×');subplot(2,1,2);plot(f,pyy182(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('audioclosealphaµÄ¹¦ÂÊÆ×');figuresubplot(2,1,1);plot(f,pxx183(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('restclosebetaµÄ¹¦ÂÊÆ×');subplot(2,1,2);plot(f,pyy183(1:n/2));ylabel('¹¦ÂÊÆ×·ùÖµ£¨mv^2)');title('audioclosebetaµÄ¹¦ÂÊÆ×');end
本文标题:matlab脑电信号处理
链接地址:https://www.777doc.com/doc-7302232 .html