[chbot] Software filter. Fast attack, slow decay

Stephen Irons stephen at irons.nz
Sun Jun 19 05:46:38 BST 2022


My solution was to implement the (low-pass) filter in any standard way, 
and implement the ideal diode as the max() function: the input to the 
filter is the larger of the input value and the current filtered value.

For interest, my preferred implementation for a single-pole low-pass 
filter is 'exponential smoothing' 
<https://en.wikipedia.org/wiki/Exponential_smoothing>

Stephen Irons

On Sun, Jun 19, 2022 at 16:34, Robin Gilks <gb7ipd at gmail.com> wrote:
> Here's another question for you all!!
> 
> I'm trying to implement "something like" a VU Meter in software (in 
> an embedded system so it has to be small & fast).
> The hardware equivalent to a diode running into an RC filter
> 
>           |\ |             R
>    in ----|  |----------vvvvvv--------- out
>           |/ |                    |
>                                  ___
>                                  ___  C
>                                   |
>                                   |
>  common ----------------------------------------
> 
> My first port of call for filters is an IIR but that does not have 
> the fast attack I'm after, especially if I want the long tail.
> 
> Does anyone have any magic that doesn't disappear into a morass of 
> DFTs and FFTs and 3 page equations summing integrals from 0 to 
> infinity ;)
> 
> Cheers - hopefully see you tomorrow.
> 
> --
> Robin Gilks
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ourshack.com/pipermail/chchrobotics/attachments/20220619/e66b7232/attachment-0001.html>


More information about the Chchrobotics mailing list