dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Log base 2
From: Jeff Waltzer (
Date: 2002-09-19

  One could do a primitive approximation of a Log base 2 function by
rotating the bits to find the left most location set bit. This would be
good if all you need is a number from 0 to 15.

--- Jack Peel <> wrote:
> Philipp Pertermann wrote:
> > From: "Jack Peel" <>
> > > > > Also could you put "clip" "lights" on it so that if
> > the MP3 goes
> > > > > to full scale it shows a different symbol and it hangs
> > out longer
> > > > > so that we know if the MP3 itself is clipping ?
> > > >
> > > > Yes, I could.
> >
> > Now I fiddled a bit with that. I don't like it much because
> > it is incredibly unreliable. The 'quasi peak detector' of
> > the mas is very 'quasi' but not so much a 'peak detector'.
> > If we don't read the peak value exactly when it happens we
> > miss it. I now installed a polling thread that reads out the
> > mas quite often but still many peaks remain undetected. So
> > the whole peak meter is a toy and not a reliable measuring
> > tool.
> >
> > Phil
> Well, in theory the human ear cannot hear a clip if it is only a few
> samples long, so we would only be interested in seeing a "clip" if
> it were several samples long. But after thinking about it, seeing the
> peak level indicators at full scale will tell you enough. And the user
> can set how long they stick around already. It would be nice however
> to do the "set until reset" function on the peak meters :) The only
> problem is how do we easily reset them without having to go through
> 3 levels of menus :) I guess you could just add it to one of the F2 or
> F3
> key functions from the wps screen.
> Any luck with the linear to log conversion ?
> I was thinking about the lookup table issue, and you could probably drop
> a couple of bits off of the number to reduce the size of the table and
> we
> would probably never be able to tell. Since it is a 15 bit number you
> could
> probably drop 5 bits and I would never be able to tell, maybe even 7
> bits.
> Another Idea is that we only really care about the accuracy when we are
> close to the top so you might be able to "shape" the table to have
> more accuracy at the top. The Idea is that -1 dB and -2 dB are VERY
> difference, however -41 dB and -42 dB are not. It may however be
> too much coding trouble to handle the shaped table.
> Just some Ideas :)
> Jack

Whoever fights monsters should see to it that in the process he doesn't become a monster.
--Frederick Wilhelm Nietsche

Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!

Page was last modified "Jan 10 2012" The Rockbox Crew