Voltage output from DAC module, Obtaining the Pk-Pk Value

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
zanner
Messages
6
Reaction score
0
I have a sine wave produced as an output, which varies. This sine wave has been filtered by a moving average filter. From this output, coming out of a DAC module, I need to obtain the the voltage peak-peak value and store it preferably in an array.
How can I do this?
More importantly how can I obtain my voltage peak-peak value?
 
Engineering news on Phys.org
anorlunda said:
That depends entirely on how the moving average filter works . Can you tell us more?

The moving average filter is done via code. Essentially I am taking data points from the ADC module and storing these into an array. Each time I get a new data point the moving average is calculated. The calculated data is then passed onto the DAC module to deal with and output it.

Essentially this is being done to filter out noise.
 
  • I'm confused. You have a signal that you filter and send to a DAC as an output. Then you want the peak value of the output to input again to store in an array.
  • The average of a sin over an integer number of cycles is zero by definition.
  • Despite the confusion I think RMS is your answer. Calculate the RMS of the sin and multiply by ##\sqrt 2## to get peak. Look up RMS on Wikipedia to see how to do that. Your sampling rate should be more than 10x the frequency of the sin.
 
A moving average filter is a low pass filter. If the period over which the average is taken is small relative to the period of the sin wave then it will have little effect on the peak to peak value. At the other extreme (long averaging time) you get zero output as anorlunda says.

However all this appears irrelevant to your question which is...

I need to obtain the the voltage peak-peak value and store it preferably in an array.
How can I do this?
More importantly how can I obtain my voltage peak-peak value?

You could put the analogue output of the DAC through an ADC and use code to calculate and log the peak to peak value. Peaks can be detected by looking for the point at which the slope changes from positive to negative or negative to positive.

If you already have access to the digital data going to the DAC (eg all this is being done on one microprocessor) you could process that data to measure the peak to peak values avoiding the need for an ADC.