A Proposed Algorithm and Sampling Conditions for Nonlinear Analysis of EEG