View Single Post
  #15 (permalink)  
Old 02-25-2004, 11:30 PM
Jon Harris
Guest
 
Posts: n/a
Default Re: Is there a quick, not much processing time needed, way to make the same volume on a 16 signed int stream in real time?

As I mentioned in a previous post, you have to consider the ear's
sensitivity to different frequencies to get the true answer. The RMS power
is an approximation that works decently in most real world cases, but
obviously breaks down in "made up" waveforms such as yours. Another
assumption of RMS matching perceived volume is that the signal lasts for a
reasonably long duration. One sample ain't enough!

(BTW, you will hear something when you play a 1 sample waveform like yours,
namely a click or tick. Even if your file only has 1 sample in it, your
sound card is putting out the equivalent of a file full of zeros before and
after you play the sample. So the output goes from zero to 10000 back to
zero, creating a tick sound.)

I don't have enough time to tell you how to exactly accomplish what you
want--it's actually non-trivial. But the basic process, as has been
mentioned before, is to create an automatic gain control or compressor that
takes into account the frequency sensitivity of the human ear. The gain
control logic needs to see the signal filtered by something that is
approximately the ear's response, like say an a-weighting filter.

If you have a PC, how about just using a compressor software plug-in? I'm
sure there's some Direct X stuff or something that works in real-time. Or
do you really want to do this yourself as an educational/hobby project?

"SA Dev" <[email protected]> wrote in message
news:403d0bd2$[email protected]..
> Hi Jon,
>
> > So you can see the peak amplitude is basically identical and the RMS

power
> > is within 1dB. The reason your SPL meter shows such a dramatic

difference
> > is probably due to the A-weighting performed by the meter. The New

> Asteroid
> > has most of its energy below 200 Hz while with New Pengo the energy is
> > concentrated between 1-2 kHz. The A-weighting curve is much more

> sensitive
> > to 1-2k than it is to low frequencies (see
> > http://sound.westhost.com/project17.htm for a graph).

>
> I used the A-weighting because it says it "more reflects" what the volume
> level is to the human ear. I realize there is probably a debate about
> A-weighting. To me, pengo sounds much louder than the asteroids does.

What
> can I do in software to make both of them sound about the same volume

level?
>
> BTW, I'm having a real hard time getting why the RMS power can be equated

to
> the volume you hear. If you had a wav file that had only one sample in

it,
> say 10000, you wouldn't hear anything because there is no difference to

make
> the sound, yet the power it used was significant...
>
> Thanks,
>
> SA Dev
>
>



Reply With Quote