Suppose you periodically receive samples of a periodic waveform at fixed instances in time Δt. It is known ahead of time that the periodic waveform will have a fundamental frequency component of 50Hz or 60Hz, but perhaps with some higher order harmonics present. What is the easiest way to go about determining the peak value of the fundamental frequency component of the waveform from the samples? I suppose by buffering a number of samples and preforming a DFT one could retrieve the fundamental frequency component, and from there I could use a low pass filter with a large time constant to recover the peak value. Is there an easier way?