function [pw,pwh]=plotcpower(x,fs,shiftm) % 30/April/2005 modification for Matlab v7.0 compatibility flm=4; % temporal resolution in ms flm=8; % 01/August/1999 fl=round(flm*fs/1000); w=hanning(2*fl+1); w=w/sum(w); nn=length(x); flpm=40; flp=round(flpm*fs/1000); wlp=fir1(flp*2,70/(fs/2)); wlp(flp+1)=wlp(flp+1)-1; wlp=-wlp; tx=[x(:)' zeros(1,2*length(wlp))]; ttx=fftfilt(wlp,tx); ttx=ttx((1:nn)+flp); tx=[ttx(:)' zeros(1,2*length(w))]; pw=fftfilt(w,tx.^2); pw=pw((1:nn)+fl); mpw=max(pw); pw=pw(round(1:shiftm*fs/1000:nn)); pw(pw3kHz) '); okid=1;