True peak-to-peak detection in SigmaStudio by BrettG
The peak envelope detectors in SigmaStudio work well for normal audio signals that have a DC offset close to 0. Their output represents the (nearly) instantaneous peak value of the signal at their input.
A SigmaStudio user recently asked me if there was a way to do true peak-to-peak detection. I came up with a solution that has one prerequisite: the signal must be crossing or touching the "zero line" in order to get an accurate reading. This means that your DC offset shouldn't be so large that the signal fails to ever cross the center line.
My peak-to-peak detector in SigmaStudio uses two half-rectifiers (built from simple logic blocks) and two peak envelope followers. The project file is attached. It runs on the ADAU1761 but could be converted for use with any SigmaDSP. I tested it and it seems to work fine, given the restriction I mentioned above. The project includes a full-scale Sine generator that can be half-rectified by clicking the switch. When the full-scale sine tone is input to the peak-to-peak detector, it reads "2" as expected. When the signal is half-rectified (cutting off all negative values), the Pk-Pk output value reads as "1", as expected.
This project is a good example of how basic logic blocks can be used in SigmaStudio in order to create functionality not included in the default library.
https://ez.analog.com/cfs-file/__key/communityserver-wikis-components-files/00-00-00-01-75/125a218d8672f28f44c9ac0e8e582778.bin