|
Prev: RS-485 Troubleshooting
Next: RTOS port for LPC2214
From: Richard Sloan on 25 Jan 2006 13:47 I am having difficulty displaying nice VU meter on a character display, right now I have allowed for 8 segments per channel, which I may make into 40 as you get 5 dots across per character. Now the issue is the bars and very jumpy, either showing a couple or all of them.... I sample the audio every 1/10s and display the bars, I can sample more, but refreshing the display at a high rate is hard due to the fact I need to keep streaming MP3 data and can not miss any. I also know audio is more logrithmic than what I am doing... The difference from the softest to loudest on the ADC right now is 80 counts. I would think I could make a nicer looking VU meter that "follows" the music better. Any thoughts? Thanks, Richard.
From: Hans-Bernhard Broeker on 25 Jan 2006 14:35 Richard Sloan <rsloan2003(a)hotmail.com> wrote: > Now the issue is the bars and very jumpy, either showing a couple or all of > them.... That's most likely cause by how you sample. You can't really expect a single random sample of a digitized audio signal to be in any way indicative of its overall loudness. You absolutely need a lowpass filter. An analog VU meter would do that by the sheer fact that its needles couldn't move fast enough to follow a high-frequency oscillation. If you're working in all-digital, you have to do it by computation. For a somewhat rough 1st approximation, just average all the samples' absolute or squared values between any two updates of the meter display, and display the logarithm of the result. A more realistic method might be to weigh the individual samples differently, depending on how old they are at the time of the meter position update. Essentially, each input sample would add a pulse to the meter's displayed value, decaying with time. You can combine the two into a formula like this: for each sample of the input: output = f * output + (1-f) * input for some dampening factor f. This assumes that the impulse response of the meter is an exponential decay. Beware of round-off errors. -- Hans-Bernhard Broeker (broeker(a)physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain.
From: cbarn24050 on 26 Jan 2006 02:14 Richard Sloan wrote: > I am having difficulty displaying nice VU meter on a character display, > right now I have allowed for 8 segments per channel, which I may make into > 40 as you get 5 dots across per character. > > Now the issue is the bars and very jumpy, either showing a couple or all of > them.... > > I sample the audio every 1/10s and display the bars, I can sample more, but > refreshing the display at a high rate is hard due to the fact I need to keep > streaming MP3 data and can not miss any. > > I also know audio is more logrithmic than what I am doing... > > The difference from the softest to loudest on the ADC right now is 80 > counts. > > I would think I could make a nicer looking VU meter that "follows" the music > better. > > Any thoughts? > > Thanks, > Richard. I agree with Hans, you need to do some signal conditioning before you sample. Try searching for audio circuits you should find something somewhere.
From: CBFalconer on 26 Jan 2006 03:19 cbarn24050(a)aol.com wrote: > Richard Sloan wrote: > .... snip ... >> >> Now the issue is the bars and very jumpy, either showing a couple >> or all of them.... >> >> I sample the audio every 1/10s and display the bars, I can sample >> more, but refreshing the display at a high rate is hard due to >> the fact I need to keep streaming MP3 data and can not miss any. >> .... snip ... >> >> Any thoughts? > > I agree with Hans, you need to do some signal conditioning before > you sample. Try searching for audio circuits you should find > something somewhere. All he needs is a digital filter. A moving average will require some storage for the sampling period. However the equivalent of a RC filter will only require one value. value = (value + sample) / 2.0 for example. Changing the weighting of value and sample will change the time constant. -- "If you want to post a followup via groups.google.com, don't use the broken "Reply" link at the bottom of the article. Click on "show options" at the top of the article, then click on the "Reply" at the bottom of the article headers." - Keith Thompson More details at: <http://cfaj.freeshell.org/google/>
From: Bill Davy on 26 Jan 2006 04:47
"Richard Sloan" <rsloan2003(a)hotmail.com> wrote in message news:sJPBf.20343$ve.346276(a)news20.bellglobal.com... >I am having difficulty displaying nice VU meter on a character display, >right now I have allowed for 8 segments per channel, which I may make into >40 as you get 5 dots across per character. > > Now the issue is the bars and very jumpy, either showing a couple or all > of them.... > > I sample the audio every 1/10s and display the bars, I can sample more, > but refreshing the display at a high rate is hard due to the fact I need > to keep streaming MP3 data and can not miss any. > > I also know audio is more logrithmic than what I am doing... > > The difference from the softest to loudest on the ADC right now is 80 > counts. > > I would think I could make a nicer looking VU meter that "follows" the > music better. > > Any thoughts? I thought VU meters used some sort of fast attack system (ie rise time < fall time). So Take sample (could be average of a few readings) if sample > displayed value Displayed Value = Sample else Displayed Value = ( (Denominator-n)* Dsiplayed Value + n * Sample ) /Denominator NB Denominator and n are to make for easier arithmetic. Perhaps Denominator = 256 and n= 4, but values will need to be tuned for your sampling rate to achieve a visually attractive decay time. And then you need some way of making Displayed Value logarithmic. With so few bars, perhaps a table holding the display threshold for each bar. But that is just guess work. Still, it may pass as a thought. Bill > > Thanks, > Richard. > |