find.ERP.range | R Documentation |
Estimates ERP range in a signal
find.ERP.range(data,cutoff)
data |
Vector (should be an averaged, standardised signal) in which to find ERP |
cutoff=2 |
Minimum value of point to be included in ERP. |
index |
Vector of indexes containing estimated ERP |
Rose Connolly connolr3@tcd.ie
find.ERP.range<-function(data,cutoff=2){ z <- abs(data) z <- z - cutoff index<-which.max( z ) zi <- z > 0 left.side <- rev( zi[1:index] ) t <- which( left.side == FALSE ) low <- index - min(t) + 1 right.side <- zi[index:length(data)] t <- which( right.side == FALSE ) high <- index + min(t) - 1 return( low:high ) } #mysignal<-noise(200,10,250)+peak(200,10,250,7,115) #av_signal<-signal.averaging(mysignal,200,10) #hats<-est.sig.hat(av_signal) #stan_signal<-(av_signal-hats[2])/hats[1] #erp_is<-find.ERP.range(stan_signal,cutoff=1.6) #mydata<-data.frame(av_signal,col="black") #col<-rep("black",200) #col[erp_is]="red" #plot(av_signal,col=col)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.