Just to cut into the discussion: I don't know anything about EEG or ECG waveforms, but you might also look into wavelet transforms (similar to fourier, but while fourier relies on sine waves, wavelets rely on short wave packets, and will result in a 2-d array describing frequency and amplitude distribution of the original wave). I had a look into them once for another type of data analysis (not on a PIC - something slightly bigger), but had dismissed them in favor of a plain old least-squares-method (for the time being). Bye Markus