Statistics for EEG waveform analysis of P300 ERP with applications to brain computer interfaces