Added Resiliancy to Freq Detection

Frequencies detected were fluctuating significantly, even with a lab
waveform generator.  This new code requires the desired frequency to
occur during 50 sampling cycles for it to proceed with the program.