位相差の求め方
    16 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    sz
 el 12 de Nov. de 2021
  
    
    
    
    
    Editada: Atsushi Ueno
      
 el 12 de Nov. de 2021
            現在19ch×100のデータがあります。
これの位相差を求めたいです。
1chに注目した時の1chと1ch、1chと2ch、1chと3ch。。。。。1chと19ch
2chに注目した時2chと1ch、2chと2ch。。。。。2chと19ch
これを19chに注目した時までの位相を求めたいです
1chと2chだけの位相差であれば1chー2chをするだけなのですが、
これを全部書くことはかなり時間かかるのでforloopなどで簡単に出来るやり方がありましたら
スクリプトを送っていただきたいです。
よろしくお願いいたします。
下記スクリプトは全体ではないですが5chー10chの位相差のスクリプトになります
上の方のでα波取り出しとヒルベルト変換していますが、それぞれ全体の位相差部分のスクリプトだけで大丈夫です。
data=record(5,:);
samplerate=250;
length=231250;
t=(0:length-1)/samplerate;
srate=250;
locutoff=8;
hicutoff=13;
smoothdata1 = eegfilt(data,srate,locutoff,hicutoff);
y1=hilbert(smoothdata1);%ヒルベルト変換
p=angle(y);
hold on
data1=record(10,:);
length=231250;
p2=angle(y1); %位相
dif1=p-p2;%位相差(5-10ch) 
0 comentarios
Respuesta aceptada
  Atsushi Ueno
      
 el 12 de Nov. de 2021
        
      Editada: Atsushi Ueno
      
 el 12 de Nov. de 2021
  
      for idx1 = 1:19
    for idx2 = 1:19
        % 関数でangleを取ってからi番目のchに注目した時の位相差を処理してください
        % 19×100が19個出来ると思います。
        angle1 = get_angle(record(idx1,:));
        angle2 = get_angle(record(idx2,:));
        dif1{idx1,idx2} = angle1 - angle2;
    end
end
function p = get_angle(data)
    srate = 250;
    locutoff = 8;
    hicutoff = 13;
    smoothdata1 = eegfilt(data,srate,locutoff,hicutoff);
    y = hilbert(smoothdata1);%ヒルベルト変換
    p = angle(y); %位相
end
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre 離散データ プロット en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
