n>
0076     y=x(:,chan);            
0077     y=y-mean(y);
0078     
0079     <span class="comment">% Compute 'periodogram' (we divide by L^2, not L, see df line below)</span>
0080     L=length(y);
0081     <span class="keyword">if</span> mod(L,2) ~= 0
0082         y=y(1:end-1);               <span class="comment">% Ensure even length of y</span>
0083         L=L-1;
0084     <span class="keyword">end</span>
0085     p=1/L^2*abs(fft(y)).^2;
0086     p=2*p(1:L/2+1);                 <span class="comment">% Sin