I need to measure the peak to peak voltage and DC offset of a 1Hz to 1MHz sine/triangle wave. The signals amplitude varies between 0 and 2Vpp and the offset can vary between -2v and +5v. I will be using an Atmega16 to do the A/D. The Atmega16 has an 8 channel 10-Bit ADC with 50-200KHz sample rate @10-Bit resolution. Taking multiple samples for cycle is obviously out of the question.
What I was thinking of doing was to sample two different versions of the signal eg connect the signal to both a negative peak detector and a precision rectifier and connect those circuits outputs to two different ADC channels and then from result of these conversions (ie the negative and positive peaks) calculate the the vpp and DC offset. Obviously the signals will need to scaled and level shifted before being applied to the controller.
Im not really sure if this will work at all, there must be a far simpler and more sophisticated way to do this that I haven't thought of.