<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Wow, lots of good stuff. Thanks!<br>
      Processor: STM32<br>
      I was thinking of a lookup table with if-then statements in a
      successive-approximation style. I think that comes out to 5
      if-thens max?<br>
      As for going analog on the front end processing, two issues: lots
      of components, and difficult to switch responses from DIN to VU,
      if I decide that is a needed feature.<br>
      I'm not making a console-quality meter, so 2dB steps is just fine.
      With a 12-bit converter you only get 72 dB of range, and that's on
      a good day. 56 dB range sounds perfect for this. Now if I go to
      the 51-led display then things will be different.<br>
      Surprising no on mentioned the AD8307 .. its perfect for meters
      like this, except for cost of course.</p>
    <p>Thanks again!</p>
    <p>--timbo<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 8/4/2017 3:15 AM, Steve wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:trinity-482adc54-3145-486d-ba57-6b888601fd8b-1501841735586@3capp-gmx-bs73">
      <div style="font-family: Verdana;font-size: 12.0px;">
        <div><br>
          I've done something similar in the past. The max over a
          greater number of samples helped to see quick peaks which
          would be gone in less than the blink of an eye otherwise, the
          purpose of that meter was to see such peaks.
          <div> 
            <div name="quote" style="margin:10px 5px 5px 10px; padding:
              10px 0 10px 10px; border-left:2px solid #C3D9E5;
              word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;">
              <div style="margin:0 0 10px 0;"><br>
                <b>Von:</b> ezion <a class="moz-txt-link-rfc2396E" href="mailto:ezion67@gmail.com"><ezion67@gmail.com></a><br>
                Here is a somewhat different approach, its very lean on
                CPU cycles, but is only useful for generating visual
                feedback.</div>
              <div name="quoted-content">
                <div>
                  <div>
                    <div> </div>
                    - For a period of around 1/10th of a second, (about
                    4000 samples) find the maximum value.</div>
                  <div>- Map the max value you found to the display.</div>
                  - Zero the max value and start over for the next 4000
                  samples. 
                  <div>
                    <div> </div>
                    <div>This works for both signed and unsigned
                      samples.<br>
                      For visual feedback the 1/10 second latency is not
                      a problem.<br>
                      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.<br>
                       </div>
                    <div>Next the mapping, this might be a open door but
                      anyways...<br>
                       </div>
                    <div>To map the values to the display (LEDs) it may
                      be useful to use multiple short lookup tables
                      instead of a single big one.</div>
                    <div>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.</div>
                    <div>First look at the high byte:<br>
                          - IF the high byte is non zero: use the high
                      byte as index for table1 to control the LEDs.</div>
                    <div>    - ELSE: use the low byte and table2.</div>
                    <div><br>
                      With 24bit values, use 3 tables in the same way.<br>
                      Shifting out the lower bits first may help to
                      further reduce the lookup table size you need.<br>
                      <br>
                       </div>
                    <div>Hope this helps,</div>
                    <div>Theo</div>
                  </div>
                  <div class="gmail_extra"> 
                    <div class="gmail_quote">On Thu, Aug 3, 2017 at 7:57
                      PM, Tim Ressel <span><<a
                          href="mailto:timr@circuitabbey.com"
                          onclick="parent.window.location.href='timr@circuitabbey.com';
                          return false;" target="_blank"
                          moz-do-not-send="true">timr@circuitabbey.com</a>></span>
                      wrote:
                      <blockquote class="gmail_quote" style="margin: 0 0
                        0 0.8ex;border-left: 1.0px rgb(204,204,204)
                        solid;padding-left: 1.0ex;">Hi,<br>
                        <br>
                        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.\<br>
                        <br>
                        Any thoughts?<br>
                        <br>
                        <span class="HOEnZb"><font color="#888888">--<br>
                            --Tim Ressel<br>
                            Circuit Abbey<br>
                            <a href="mailto:timr@circuitabbey.com"
                              onclick="parent.window.location.href='timr@circuitabbey.com';
                              return false;" target="_blank"
                              moz-do-not-send="true">timr@circuitabbey.com</a><br>
                            <br>
_______________________________________________<br>
                            Synth-diy mailing list<br>
                            <a href="mailto:Synth-diy@synth-diy.org"
                              onclick="parent.window.location.href='Synth-diy@synth-diy.org';
                              return false;" target="_blank"
                              moz-do-not-send="true">Synth-diy@synth-diy.org</a><br>
                            <a
                              href="http://synth-diy.org/mailman/listinfo/synth-diy"
                              target="_blank" moz-do-not-send="true">http://synth-diy.org/mailman/listinfo/synth-diy</a></font></span></blockquote>
                    </div>
                  </div>
                </div>
                _______________________________________________
                Synth-diy mailing list <a class="moz-txt-link-abbreviated" href="mailto:Synth-diy@synth-diy.org">Synth-diy@synth-diy.org</a> <a
                  href="http://synth-diy.org/mailman/listinfo/synth-diy"
                  target="_blank" moz-do-not-send="true">http://synth-diy.org/mailman/listinfo/synth-diy</a></div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Synth-diy mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Synth-diy@synth-diy.org">Synth-diy@synth-diy.org</a>
<a class="moz-txt-link-freetext" href="http://synth-diy.org/mailman/listinfo/synth-diy">http://synth-diy.org/mailman/listinfo/synth-diy</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
--Tim Ressel
Circuit Abbey
<a class="moz-txt-link-abbreviated" href="mailto:timr@circuitabbey.com">timr@circuitabbey.com</a></pre>
  </body>
</html>