Model of a neuron trained to extract periodicity