Detection of saw tooth or square wave

FFT would be fine, problem could be with ADC, 100 kHz is too much for its, as also too much to peak up "by ear". :slight_smile:
The only way I'd suggest, use arduino input capture hardware. If signal is exactly 5V and duty cycle of square wave 50% , probably, would be little difference in pulse duration, as default digital hysteresis close to 2.2 - 2.4 V. But it easy to set a divider ( 70 % let say), than voltage 3.5 V will trigger input capture in different proportion, saw tooth create shorter pulses, and even shorter with higher divider ( 55 - 60 %).
Other option, use input capture + analog comparator.
For code, look here : http://interface.khm.de/index.php/lab/experiments/frequency-measurement-library/
Or "copy-paste" from: http://fftarduino.blogspot.com/2011/12/arduino-laser-3d-tracking-range-finder.html