Foundations of EEG: Theory, Hardware, and Application Principles