<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Ahmad,<div><br></div><div>I suggest you look up the following article which has code snippets to compute CSP in Matlab (page 9).</div><div><br></div><div><a href="http://sccn.ucsd.edu/~arno/mypapers/Delorme_BCITools10.pdf">http://sccn.ucsd.edu/~arno/mypapers/Delorme_BCITools10.pdf</a></div><div><br></div><div>Best,</div><div><br></div><div>Arno</div><div><br><div><div>On Sep 15, 2011, at 11:40 AM, ahmad hasanpour wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div dir="ltr">please help me my friends,i see csp code in bci lab ,let me describe for you understand i get it; first
create k fold with 10,and then take set of trials different for obtain
good spatial filter?(i cant understand this section please describe it)<br>
<br>after u obtain good spatial filter u apply it on test trails.<br><br>i do this steps on datasetIIIa but i cant get good result(2 classes).<br><br><span style="font-family:courier new,monospace">cov1=cov(signals(1:400,:)); %Class 1</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">cov2=cov(signals(803:1203,:)); %Class2</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"><br>[W D]=eig(cov1,cov1+cov2);</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"><br>filter=W(:,[1:3 56:59]);</span> % M first and end W<br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"><br>sig1=signals(1:400,:)*filter;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"><br>sig2=signals(803:1203,:)*filter;</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> log(var(sig1))</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> -4.2778 -3.6758 -2.9707 -0.1514 -0.1446 -0.1144 -0.0163</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">log(var(sig2))</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> -0.0140 -0.0257 -0.0526 -1.9627 -2.0050 -2.2249 -4.1225</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">sig3=signals(402:802,:)*filter; <b>%Class1 for Test</b></span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">log(var(sig3))</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> 0.0388 -0.9152 0.1855 -0.2021 -0.0560 -0.8266 -1.8903</span><br><br>i dont have good result;why?<br></div>
_______________________________________________<br>Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>To unsubscribe, send an empty email to <a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a></blockquote></div><br></div></body></html>