Peak value

Aug 02, 2010 23 Replies

Err... but the 'mean squared value' with statistical weight equal at all times is what is a good measure of the sinewave. With an ADC that samples at a short time interval, you get 'sum squared value' according to the statistical weight of a series of delta- functions. It might eventually converge to the same value as the desired function, but it only works in one cycle time if your ADC measurements are all taken at carefully selected times (no jitter allowed, no sample-time error relative to the phase of the sinewave).

The four-sample example was a correct Nyquist-limited sampling for the frequency of interest, and would work fine. But, it requires a 4x sample clock synchronized to the sinewave, which is not easy with a modest microprocessor ADC at 200 kHz.

Actually you only need 3 samples per sine wave period. You could set this up quite easily using the ADC and timers on an STM32F103xxxx. The OP has not explained how he generates the sine wave from a PWM signal - which might have some influence on how easily the ADC sample clock can be generated. My feeling is that increasing the ADC sampling rate from 200kHz to 300kHz will be a lot cheaper and more reliable than an analogue method. From the response to Tim's suggestions I'm not sure the OP understands the sampling maths at all.

Michael Kellett

text -

text -

Excuse me, but are you saying that you are programming the uC that is generating the sine wave (PWM) and you still do not know when the peak occurs??

text -

text -

Yes. That's when I quit the game :-) ...Jim Thompson

| James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | Spice is like a sports car... Performance only as good as the person behind the wheel.

Join the Discussion

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

Didn't find your answer?

Ask the community — no account required