A recursive scheme for frequency estimation using the modulating functions method