sample & hold: maxima - minima

Oct 20, 2005 12 Replies

Do you want something that follows the envelope by itself, doesn't require any commands from the microprocessor, but forces you to compromise between error and speed, or do you want something that does require some interaction with the microprocessor but will acquire a true maximum and minimum within one cycle of the AC?

For the first you don't even need a sample & hold, per se, you just need an amplifier followed by a plain old rectifier circuit:

A = 500 Peak |\\ .-->|--------------o----------- Signal In || | \\ | | o---------||-----| >-----o | || | / | | Trough |/ '--|

Hi,



a 10mV ac 1kHz signal, an analog integrator, and an 8 bit adc on a microcontroller.


  1. what is the best way to build a SH for: a. the peak of the ac signal b. the trough of the ac signal

would this involve a standard SH, with diodes?



thanks to any and all replies.


specs call for 10b resolution of the peak/trough from the analog integration of the ac signal. the uC will sample the SH caps @~1/75 Hz, performing ADC of the value for archiving.

this should work for the peak...

--||---->>adc>>store conversion | |->>pin pulled low to reset after reading from adc

but for the trough? this is where I draw a blank.

maybe this...

ac~ --adc>>store conversion | |->>pin pulled hig to reset after reading adc

the pin pulled high is on the adc side of the cap, btw.

I think what Josh is suggesting is that you just sample often enough to capture the whole waveform and detect the peaks in software. This would require you a sampling rate vs. peak accuracy tradeoff -- if your signal is a pure sinusoid it wouldn't be too bad, but if you have to capture brief events then you'd have to sample pretty darn fast.

Tim Wescott Wescott Design Services http://www.wescottdesign.com

Thumb through "FullWaveRectifier.pdf" on the S.E.D/Schematics page of my website for peak (or trough) detector ideas.

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Yes, this is a problem as the signal is random. It is certain that the peak/trough will generally occur w/in 1 Hz however, but will change in amplitude over time. In fact, it is the change of peak/trough amplitude that must be captured and analyzed after aquisition. There is some tradeoff in the uC w/ triggered vs free run mode for adc; triggering introduces an annoying jitter whereas free run mode does not.

Do they still make bipolar ADCs, with something like two's complement output?

Or, you could add in some offset with a follower, and subtract it out in firmware.

Good Luck! Rich

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required