est.sig.hats: Estimate Hats

est.sig.hatR Documentation

Estimate Hats

Description

Estimates mean and standard deviation of noise part of signal

Usage

est.sig.hats(data,peak_postion,buffer_pc)

Arguments

x

Data on which to estimate from, should be averaged first

peak_position

Position of center of peak, if known, default is the index of max(data)

buffer_pc

Percentage of data on each side of peak_postion to exclude from calcualtions. Default is 0.3 which is very conservative as excludes 60pcof data total.

Value

1

Sample SD estimate of noise

2

Sample mean estimate of noise

Author(s)

Rose Connolly connolr3@tcd.ie

Examples

#mysignal<-noise(200,10,250)+peak(200,10,250,7,115)
#mysignal<-signal.averaging(mysignal,200,10)
#est.sig.hat(mysignal,115,0.15)

## The function is currently defined as


est.sig.hat<-function(data, peak_position=which.max(abs(data)),buffer_pc=0.3){
  lo<-peak_position-(buffer_pc*length(data))
  hi<-peak_position+(buffer_pc*length(data))
  buffer_range<-lo:hi
  reg_data<- data[-buffer_range]
  sig_hat<-sqrt(var(reg_data))
  normhat<-mean(reg_data)
  return(c(sig_hat,normhat))
}










connolr3/eegdatasim documentation built on April 14, 2022, 10:39 a.m.