DVD
game
auto
gym
HDTV
sun
photo
wine
space
yachts
BBQ
baths
astro
phones
spy
GPS
iPods
PC
SCUBA
France


UK HDTV FAQ
(Sky HD, BBC HD)


Safe For Kids





Volume Control - digital



Tue, 08 Nov 2005 13:52:32 +0000 rec.audio.tech
previous


Dirk Bruere at Neopax...
I'm trying for a wireless solution to get rid of some cables.
'Obviously' the best is to use direct ditital stream from say a CD player,
transport it wirelessly and either convert it to analogue at the amp in the
speaker, or continue digitally into a digital amp eg Powersoft.

Problem is, how do I control the volume?

Joe Kesselman...
Have you considered the other solution, remote control of the amp's volume?

Dirk Bruere at Neopax...
At least 3 amps, one in each speaker.
More if surround sound is used.

There are only two possible way that I can see:
a) Convert it to analogue at the CD end and redigitise.

Arny Krueger...
OK, it can be messy.

b) Do the volume control digitally.

Arny Krueger...
The trick is finding a digital volume control with digital
inputs and outputs that operates in real time.

Michael R. Kesti...
Scott Dorsey got it correct about 20 articles earlier.

But I must admit that I am prejudiced as these are manufactured only a
bit more than a stone's throw from where I live and some of the people
involved are friends and coworkers.


I can see the drawbacks of a), but what about b)?

Arny Krueger...
Two hardware alternatives would be a digital mixer or a
digital equalizer with digital I/O.

Any s/w available to do it simply in a PC for example?

Richard Crowley...
You can use a PC for a volume control, but can't run a
wire?

Dirk Bruere at Neopax...
The system is in the >$20,000 range and the customers doesn't want wires
trailing about. They don't want to see anything except a few elegant (moveable)
speakers unobtrusively plugged into the mains.

Richard Crowley...
So design a custom composite "cable" and connector that
carry both the power and the signal. $20K is not enough
to develop a really reliable, high-fidelity wireless digital
solution.

Dirk Bruere at Neopax...
It does if we're selling dozens per year.



kludge...
In that case, you can probably afford one of the boxes from
Graham-Patten Systems. I believe they make a thing that does
just what you want.

Dirk Bruere at Neopax...
The wireless part is not the problem at present.
I want advice on volume control.

kludge...
Right. Graham-Patten makes a box with an AES/EBU in, an AES/EBU out, and
a knob. It lets you scale input down by any factor.

Dirk Bruere at Neopax...
Well, since it is going to be a PC storing and originating the digital signals I
was hoping for something in s/w.

kludge...
So, write some software. All you need is to take your existing software
and modify it to multiply everything by a constant. Then you pop up
something on the screen that lets the user change that constant.

dpierce...
Well, it is, as I am sure Scott knows, a wee bit more complicated than
that.

You have a control object on the screen, say a slider control. It
outputs
an integer between some minimum and maximum value whenever it's
moved. Say it outputs a range from 0-127.

Take that value, and use it to look up a 15-bit gain coefficient in a
128
entry lookup table. This table is populated such that the linear range
of
0-127 is translated into an appropriate gain curve that "feels right",
i.e.
approximately logarithmic with lots of resolution where you need it
(upper
third), and lots of gain change where you need it (lower third).

Take the 15 bit gain coefficient (actually, it's really a 16 bit signed

integer coefficient limited to only the positive values: I'll explain
why in
a bit) and for each sample that comes flying by, multiply the two
together.
The result will be a 32-bit signed integer. TO get back to 16 bits, add
an
appropriate dither value (usually 16 bits) to the 32 bit result, then
take
the top 16 bits as the gain-adjusted sample. Repeat for all subsequent
samples.

If you want to get more sophisicated, hold on to the 16 lower bits and
feed
them back into the input stream after the multiply. Do it right, and
you can
add higher-order noise shaping to reduce the audible effect of the
dithering.

Always make sure your gain coefficients are positive, i.e., in the
range of
0x0000 to 0x7FFF (0 to 32767). If you don't, as soon as the top bit
gets
set, it' makes it a negative gain coefficient and you suddenly flip the
phase
of the resulting signal. Bad idea, especially when you run your volume
control up thourgh the transition from positive to negative gains. Bad
idea.

Oh, and you're likely to encounter some "fluttering" when you're
changing
volume often referred to as "zipper noise." Contrary to common belief,
it's
not because you only have a limited number of steps in your volume
control but because you aren't changing the gain OFTEN enough. The
RIGHT way to do it is to differentiate the steps coming from your
volume
control, thus getting effectively the SPEED of the knob, not its
position.
With that, you can make a prediction of how fast you have to change
your
gain. You're gain rampling algorithm then continuously ramps the gain
at fairly quick intervale (1000x a second, maybe), between the previous
value and the next value of the vaolume control. Do it right, and no
zipper noise, ever, no matter how many of few steps you have in your
volume control.

Basically, it's not a half-hour programming excercise.

Dirk Bruere at Neopax...
And does MS Media Centre do it right?

dpierce...
I do not know specifically, but having seen some of MS's other attempts
at audio, I'd bet good money that they pretty well f*cked it up.
Certainly
some of the details I spoke of regarding gain algorithms are not all
that common (e.g., gain trajectory for smooth gain ranging) amongst
professional products, so I'd doubt that they've found their way into
the
grossly low-end of the realm. And, too often, Microsoft media stuff is
worse than the worst

As I implied, we have not made a final decision on this bit or even looked in
depth at the options. These NGs can no doubt expect some question on this topic
in the near future...


Dirk Bruere at Neopax...
That's what I thought, but I was wondering about digitisation noise if
everything gets (say) divided by 256. The 16 bit signal becomes 8 bit at low volume.

kludge...
Right, that's how it works. The lower the level, the poorer the S/N
you get. Just like with analogue gear.


dpierce...
Yes, it does. That's what makes it "low volume."

Read the text elsewgere on how to deal with the artifacts resulting.


dpierce...
See my detailed reply elswhere. Bascially, you multiply your 16-bit
sample
value by a 16 bit gain coefficient, which results in a 32 bit result.
Before
truncating, you dither or noise shape to eliminate quantization
artifacts.
What kind of dither or how you noise shape is what separates the DSP
men from the boys.



What jukebox software are you using? What interface? What operating
system?

Dirk Bruere at Neopax...
Well, it's going to probably be MS Media Centre.

kludge...
I'm terribly sorry.


Richard Crowley...
Doesn't that already have a volume control?


walkinay...
You could do that with a Metric Halo MIO or ULN2, using the MH Console
app.

Or at least an explanation of why this is not possible.
Given the type of system we are developing the fewer boxes the better.

Geoff...
I hope this $20K (and rising) system is not ooutputting MP3s !

Dirk Bruere at Neopax...
Only the Golden Oldies from a top of the range antique 8-Track:-)

Actually, most of the system cost so far in in the speakers which are
proprietory. They come in at around $16k for a 2+1. Throw in 3 Powersoft amps at
around 1kW each, and all the top of the range gear needed to drive them
(including a PC) and you can probably work out the final cost. More for surround.



A very quick scan of the Powersoft website revealed that
the amplifier models I looked at have integrated volume
controls.

Dirk Bruere at Neopax...
That won't solve the problem because there is going to be one amp in each
speaker. The control must be done at the sending end. Unless there are
completely separate wireless volume controls as well...

Richard Crowley...
If you can work out a reliable way of sending the digital
audio signal via wireless, working out the volume control
is a trivial add-on.

Dirk Bruere at Neopax...
Such a solution exists, at least in chip form from Nordic.
Being an EE I could develop a wireless solution from their reference designs,
but I'd rather not.
Hence my other Q on these NGs.


Arny Krueger...
What you are looking for would be a combination of hardware
and software since PCs don't by default have digital inputs
or outputs.

Dirk Bruere at Neopax...
Well, putting in a sound card to handle that would be no problem.


In order to obtain the real-time operation you see to need -
try an audio interface with an input monitoring facility
with level control that outputs through digital outputs.

Dirk Bruere at Neopax...
I suppose that means looking through soundcards and Media Centre stuff...
Anyway, I've still to source the wireless link. Failing that I'll have to design

Richard Crowley...
Both volume control and remote control support are built-
into Media Center.

some.
next