Changed algorithm attempting to identify frequency to sample at 1000x the desired frequency