Detection of saw tooth or square wave

Isn't there a FFT library for Arduino?

I wonder if it would keep up.