Log potentiometer and digital sound

S

Sonnich Jensen

Guest
Hi all

I have been wondering - how the volume is regulated in computers. E.g. Windows offers a player, where the volume can be set by a byte, hence 0-255.

This seems to be a linear scale, but sound is logarithmic?

So if I want to set this, should I think in providing this logarithmically, or does the component does it by itself?
What about smaller MP3 players or other sound devices? When using a DAC to set the volume?



Also, regarding a pot with slider, I got to think which way I should mount it. When measuring from the slider to one end, I get a slow raising from one end and a fast raising from one end.
I get it that the slow rising from ground is the right way to turn it.


WBR
Sonnich
 
On a sunny day (Tue, 22 Dec 2015 11:35:25 -0800 (PST)) it happened Sonnich
Jensen <sonnichjensen@gmail.com> wrote in
<321365bf-4972-4a03-9b9f-0961f56deaa6@googlegroups.com>:

Hi all

I have been wondering - how the volume is regulated in computers. E.g. Windows offers a player, where the volume can be set by a
byte, hence 0-255.

This seems to be a linear scale, but sound is logarithmic?

OK, I will have a go, but plz note I do not have golden speaker cables, so some may disagree.


First, double the voltage = 2 x the output power.
Ear is logarithmic, tose 2 togeterhj.

Audi ois normally 16 bist.

I cheat and do a shift right and drop the lowest bit,
for example here:
http://panteltje.com/panteltje/pic/audio_pic/

So, evil, imagine, the distortion !

Now many earth around te sun rotations ago I did an announcement system for a big office building with 8 bit audio,
everybody was happy.


There is nothing stopping you from doing floating point math from 256 input values on the 16 bit audio values,
to find a new (closest) 16 bit value, and maybe some do that.

There is nothing stopping you from using a lookup table either, to sort of make any curve from those 256 input values.

Yes log pots, used to be the thing to do, not sure if that is still the case lin works too.

Or a linear pot is read by an ADC and then see above.

But again, 96 kHz sampling and 24 bits audio,
now you can do 23 shifts right ;-)
when you have 8 bits left and normal background noise it is OK for voice.

Tubes, I forgot about tubes.

When I was younger I could hear higher too, but not to 96 / 2 say <= 48 khz.
In those days things were more quiet too, no PC fans.

Now for the audiophile recoil I guess...

Ducks




So if I want to set this, should I think in providing this logarithmically, or does the component does it by itself?
What about smaller MP3 players or other sound devices? When using a DAC to set the volume?



Also, regarding a pot with slider, I got to think which way I should mount it. When measuring from the slider to one end, I get
a slow raising from one end and a fast raising from one end.
I get it that the slow rising from ground is the right way to turn it.


WBR
Sonnich
 
In article <321365bf-4972-4a03-9b9f-0961f56deaa6@googlegroups.com>,
sonnichjensen@gmail.com says...
Hi all

I have been wondering - how the volume is regulated in computers. E.g. Windows offers a player, where the volume can be set by a byte, hence 0-255.

This seems to be a linear scale, but sound is logarithmic?

So if I want to set this, should I think in providing this logarithmically, or does the component does it by itself?
What about smaller MP3 players or other sound devices? When using a DAC to set the volume?



Also, regarding a pot with slider, I got to think which way I should mount it. When measuring from the slider to one end, I get a slow raising from one end and a fast raising from one end.
I get it that the slow rising from ground is the right way to turn it.


WBR
Sonnich

I am not actactly shure what you're talking about but! I think maybe
something like this is close to what you are looking for.

SetPoint = 255 * Cos( (PI/2) * (1-(LinearValue / 255)));

That's not a LOG but, it will give you one near it!

But then again, I could have your idea of what you are
thinking off way in the wrong direction.

Jamie
 
"Sonnich Jensen" <sonnichjensen@gmail.com> wrote in message
news:321365bf-4972-4a03-9b9f-0961f56deaa6@googlegroups.com...
I have been wondering - how the volume is regulated in computers. E.g.
Windows offers a player, where the volume can be set by a byte, hence
0-255.

This seems to be a linear scale, but sound is logarithmic?

For the longest time, I think it was linear. The truth probably depends on
how Windows handles multimedia internally, how the drivers interface to
that, and what the hardware itself is capable of (e.g., there are many DACs
out there with 16 bit mantissa and some bits of exponent, i.e., floating
point, perfect for handling volume on a log scale with a minimum of bother).

I think Win7+ finally brought log controls. And a more advanced sound
mixer, but it's also missing some features that XP and below had, and is
harder to use.

Tim

--
Seven Transistor Labs
Electrical Engineering Consultation
Website: http://seventransistorlabs.com
 

Welcome to EDABoard.com

Sponsor

Back
Top