# [sdiy] Digital VU

Tim Ressel timr at circuitabbey.com
Thu Aug 3 20:59:28 CEST 2017

```Hi,

Thanks for the response. So you think if I use 32 bit numbers in an IIR
filter then the low Fc/Fs ratio will not an issue. That is good to know.
I'm not sure if I want to use VU or DIN response. VU is simple enough in
an IIR filter, but I'm not sure about DIN.

The display will be probably be 2 or 3 dB per step. Its a 28 LED
display. I'll use a table of values to set the transition levels. And
peak hold of course.

--timbo

On 8/3/2017 11:44 AM, Richie Burnett wrote:
> You can use simple 1st order IIR digital filters for the attack and decay "ballistics". Sure the cutoff frequency is very low compared to the sample rate, but you just need to make sure you keep track of the current filter state to a sufficient number of bits of resolution.
>
> I would be wary of decimating. You might actually need to do some interpolation if you are to avoid missing peaks that occur at instants that are between samples. Search about "inter-sample overs".
>
> You'll probably also want to do some sort of log approximation too, to make the display scale linear in dB. Or use exponentially spaced illumination thresholds for your LEDs.
>
> -Richie,
>
> Sent from my Xperia SP on O2
>
> ---- Tim Ressel wrote ----
>
>> Hi,
>>
>> I'm looking at doing a VU meter in digital land. Sample the audio and do
>> all the work in code. I am wondering what is the best way to approach
>> the filtering. There needs to be a lowpass filter thingie with a very
>> low cutoff, which makes the ratio of cutoff to sample rate very small.
>> The obvious solution is to decimate the signal and get the sample rate
>> down to a reasonable number. My concern here is the lp filter is low
>> order and tails way out in frequency. Is decimation going to affect its
>> ability to display transients? Another approach is to have a huge FIR
>> filter, but we are talking lots of calculations per sample.\
>>
>> Any thoughts?
>>
>> --
>> --Tim Ressel
>> Circuit Abbey
>> timr at circuitabbey.com
>>
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at synth-diy.org
>> http://synth-diy.org/mailman/listinfo/synth-diy
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> http://synth-diy.org/mailman/listinfo/synth-diy
>

--
--Tim Ressel
Circuit Abbey
timr at circuitabbey.com

```