[sdiy] Digital VU
ezion
ezion67 at gmail.com
Fri Aug 4 12:00:27 CEST 2017
Here is a somewhat different approach, its very lean on CPU cycles, but is
only useful for generating visual feedback.
- For a period of around 1/10th of a second, (about 4000 samples) find the
maximum value.
- Map the max value you found to the display.
- Zero the max value and start over for the next 4000 samples.
This works for both signed and unsigned samples.
For visual feedback the 1/10 second latency is not a problem.
The large number of samples is needed because one or more periods of the
lowest expected frequency should "fit inside" to prevent jitter on the
display.
Next the mapping, this might be a open door but anyways...
To map the values to the display (LEDs) it may be useful to use multiple
short lookup tables instead of a single big one.
So if your value us 16 bit long, instead of using one table with a 16 bit
index, use two tables with a 8 bit index.
First look at the high byte:
- IF the high byte is non zero: use the high byte as index for table1
to control the LEDs.
- ELSE: use the low byte and table2.
With 24bit values, use 3 tables in the same way.
Shifting out the lower bits first may help to further reduce the lookup
table size you need.
Hope this helps,
Theo
On Thu, Aug 3, 2017 at 7:57 PM, Tim Ressel <timr at circuitabbey.com> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://synth-diy.org/pipermail/synth-diy/attachments/20170804/f93fd9f0/attachment.htm>
More information about the Synth-diy
mailing list