Neuronal identification of signal periodicity by balanced inhibition