FPCA Algorithm For Waveform Clustering