loopback VS10xx Prototyping Board

Designing hardware that use VLSI Solution's devices as the system controller for the entire design.
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: loopback VS10xx Prototyping Board

Post by Panu »

Let me try to understand what you are doing? Because it sounds like you're trying to measure sound volume based on a single sample, which cannot work, it doesn't produce any meaningful results.

You need to do something a little bit more elaborate, such as get a bunch of samples (at least few hundred to few thousand), and calculate RMS for that set.

You could get somewhat usable results if you would take a sample more often, say 100 to 1000 times a second and take the most high absolute value. I often do it to get something that resembles a VU meter on a display: take value, convert to dB, and replace the "current value" by it if it's more than the "current value", otherwise decrease the "current value" a little bit. For a human-readable UI it works if you sample more than 100 times per second and can accept that the value is not very accurate.

But to get exact values: sample, window (perhaps), filter, and calculate RMS.

-Panu
Post Reply