Development of a fast and efficient algorithm for P300 event related potential detection