[comp.dsp] More digital mixer stuff

byron@pyr.gatech.EDU (Byron A Jeff) (09/29/89)

Todd: My mail to you bounced. So I'm posting my reponse.

>
>~-----------  ---------  ---------  --------   --------  --------  --------
>~|8        |--|Analog |--|Filters|--|      |---|      |  |      |  |      |
>~|Audio    |--|Multi- |  |  and  |  | ADC  |   | DSP  |--| DAC  |--|Filter|
>~|channels |--|plexors|--|  S/H  |--|      |---|      |  |      |  |      |
>~-----------  ---------  ---------  --------   --------  --------  --------
>            ^^                              ^^^
>	Eight lines here.		There should be two lines since it
>					is a dual ADC.

I don't have all the specs yet. I hadn't had a chance to read the
article. The two observations you made above are correct.

>
>Sounds like it might be feasible.  Does it have serial or parallel output?
>
>Serial
>	44.1 kHz * 4 channels * 16 bits/channel = 2.822 MHz
>
>I think the 56000 can handle this.  Only half of what you need, though.
>You might be able to do it with the TM$32030, as it has two serial inputs.

Even if it were serial I'd probably just shift it into shift registers
and read in the parallel outputs when all of the bits of a complete
sample has been shifted in.

>
>Parallel
>	Either 56000 or 32020 can handle this, if you can figure
>out a way to merge the data streams.
>
>~If samples can be obtained for ~$50 then a box for between $200 to $300
>~could be realized. If the DSP is fast enough then another ADC could
>~easily be added for a grand total of 16 channels.
>
>Your biggest problem is that the samples are not arriving at the same
>time.  Actually, I guess you could use an interrupt routine to store all
>the samples, then have the DSP act on them when all have arrived.

That's exactly what I was thinking. Something along these lines:

Sample 1
         Sample 2
                  Sample 3
                           Sample 4
                                    Output of mix of the 4 above samples.

--------Time Axis--------->

>
>Remember that since you are using an analog MUX, the samples can't all
>be done at EXACTLY the same time, so there will be a slight delay between
>all of the channels.

I'm brand new in this domain. I have no clue what the effect of the
delay between channels will be. Can you give me an idea?

>
>Also, if it is serial, you'll have to use TWO 56000s and have them
>talk to each other (not really that hard).  Could do some killer
>filtering, though.

Again with some parallel shift registers that problem disappears.
Right off the top of my head I think you can clock a 74LS164 at
30 Mhz so the speed is not a problem.

Another reponse I saw indicates that a 56001 wouldn't be able to handle
mixing 8 channels much less doing any kind of EQ, reverb, etc. He
suggested a DSP for each channel. I was of course in pain as this is
strictly hobby material for me. Can you give me an idea of how much
processing power a 56001 has? An estimate of how much of the above
(getting data, mixing, providing effects) a single 56001 can do would
be quite helpful. 2 I'd be willing to deal with but my whole concept
is to reduce the parts count to a fairly small board.

>
>There might be some chips from AT&T that are cheap and have two
>synchronous serial inputs.  The TI chip I mentioned is expensive.
>

Also thanks for all of the articles you've been posting and the
server (which I haven't had a chance to use yet). It's all been
quite informative. Keep it up.

Thanks also for the reponse. I'm saving all of the them and
will summarize the results in a little while.

BAJ
-- 
Another random extraction from the mental bit stream of...
Byron A. Jeff
Georgia Tech, Atlanta GA 30332
Internet:	byron@pyr.gatech.edu  uucp:	...!gatech!pyr!byron

todd@ivucsb.sba.ca.us (Todd Day) (09/29/89)

byron@pyr.gatech.EDU (Byron A Jeff) writes:

~Even if it were serial I'd probably just shift it into shift registers
~and read in the parallel outputs when all of the bits of a complete
~sample has been shifted in.

What I was refering to was the *built-in* serial shift registers in
the DSP chips.  That way, you wouldn't need the glue logic.

~>Remember that since you are using an analog MUX, the samples can't all
~>be done at EXACTLY the same time, so there will be a slight delay between
~>all of the channels.
~I'm brand new in this domain. I have no clue what the effect of the
~delay between channels will be. Can you give me an idea?

Ch 1 - delay - Ch 2 - delay - Ch 3 - delay - Ch 4

The delay will be the length of time it takes to switch from one
channel to the next via the MUX and then sample with the sample/hold.
Probably not very signifigant, but those who spend $1000 on interconnects
for their stereo systems would probably complain.  Of course, they wouldn't
be listening to digital, anyway, would they? :-)

~Another reponse I saw indicates that a 56001 wouldn't be able to handle
~mixing 8 channels much less doing any kind of EQ, reverb, etc. He
~suggested a DSP for each channel.

I know that one chip can *at least* emulate a 2 channel 10 band 12 dB
equalizer from a Motorola app note.  I wouldn't think that reverb would be
that tough to do.

-- 

Todd Day  |  todd@ivucsb.sba.ca.us  |  ivucsb!todd@anise.acc.com
"Ya know, some day these scientists are going to invent something
	that can outsmart a rabbit" -- Bugs Bunny

mikes@lakesys.lakesys.com (Mike Shawaluk) (09/29/89)

In article <1989Sep29.102204.8798@ivucsb.sba.ca.us> todd@ivucsb.sba.ca.us (Todd Day) writes:
>byron@pyr.gatech.EDU (Byron A Jeff) writes:
>~>Remember that since you are using an analog MUX, the samples can't all
>~>be done at EXACTLY the same time, so there will be a slight delay between
>~>all of the channels.
>~I'm brand new in this domain. I have no clue what the effect of the
>~delay between channels will be. Can you give me an idea?
>
>Ch 1 - delay - Ch 2 - delay - Ch 3 - delay - Ch 4
>
>The delay will be the length of time it takes to switch from one
>channel to the next via the MUX and then sample with the sample/hold.
>Probably not very signifigant, but those who spend $1000 on interconnects
>for their stereo systems would probably complain.  Of course, they wouldn't
>be listening to digital, anyway, would they? :-)

Well, the delays would be eliminated if you used 4 sample & holds, up before
the analog demux, no?  Simply "hold" all 4 signals at the same time, and then
demux them after they are frozen, then unhold & repeat the sequence.  Of
course, the other solution would be to have separate A/D's for each channel,
as has been suggested in an alternate thread of this same subject.

BTW, isn't this "delay" the same "problem" that's been mentioned with certain
CD players, which use only one D/A converter for both channels, but mux the
stereo outputs?  One person (in a review I read) gave the analogy of standing
1 cm closer to one of the stereo speakers in the room while listening to a
CD, as being the effect of this phase shift (i.e., the speed of sound vs. the
delay).

-- 
   - Mike Shawaluk 
       (mikes@lakesys.lakesys.com  OR  ...!uunet!marque!lakesys!mikes)
   "If spirit == essense, then spiritual == essential!"  - me

byron@pyr.gatech.EDU (Byron A Jeff) (09/30/89)

-~[Byron]
-[Todd]
-~Even if it were serial I'd probably just shift it into shift registers
-~and read in the parallel outputs when all of the bits of a complete
-~sample has been shifted in.
-
-What I was refering to was the *built-in* serial shift registers in
-the DSP chips.  That way, you wouldn't need the glue logic.

But as you stated it's only one channel unfortunately. If the design
decision comes down to a choice of TI, 2 56001's, or external shift
registers with a single 56001 I'll probably go with the external glue.
How can I lose at $0.59 a pop? ;-)

However if I turn out to need 2 56001's do handle the processing then
I'll use the internal shift registers. I'm working on a shared memory
controller between two 68008's and a 68010 right now for my kick-ass
MIDI box. I might be able to apply it here somehow.

-
-~>Remember that since you are using an analog MUX, the samples can't all
-~>be done at EXACTLY the same time, so there will be a slight delay between
-~>all of the channels.
-~I'm brand new in this domain. I have no clue what the effect of the
-~delay between channels will be. Can you give me an idea?
-
-Ch 1 - delay - Ch 2 - delay - Ch 3 - delay - Ch 4
-
-The delay will be the length of time it takes to switch from one
-channel to the next via the MUX and then sample with the sample/hold.
-Probably not very signifigant, but those who spend $1000 on interconnects
-for their stereo systems would probably complain.  Of course, they wouldn't
-be listening to digital, anyway, would they? :-)

I'm hoping it's not significant. And I can't hear the phase shift when I
reverse polarities of the Monsta Leads to my $4000 Polk Audio speakers
either ;-)

-
-~Another reponse I saw indicates that a 56001 wouldn't be able to handle
-~mixing 8 channels much less doing any kind of EQ, reverb, etc. He
-~suggested a DSP for each channel.
-
-I know that one chip can *at least* emulate a 2 channel 10 band 12 dB
-equalizer from a Motorola app note.  I wouldn't think that reverb would be
-that tough to do.

Good to hear. I could live with effects on the mixed signal even though
having individual effects on each channel would be cool. Not worth
eight 56001's cool though.
-
--- 
-
-Todd Day  |  todd@ivucsb.sba.ca.us  |  ivucsb!todd@anise.acc.com
-"Ya know, some day these scientists are going to invent something
-	that can outsmart a rabbit" -- Bugs Bunny

After reading your series on building a beast and your discussion so far
on this mixer I feel very optimistic about the idea. Thanks.

BAJ
-- 
Another random extraction from the mental bit stream of...
Byron A. Jeff
Georgia Tech, Atlanta GA 30332
Internet:	byron@pyr.gatech.edu  uucp:	...!gatech!pyr!byron

byron@pyr.gatech.EDU (Byron A Jeff) (09/30/89)

-[Todd and my discussion on delay]
-
-Well, the delays would be eliminated if you used 4 sample & holds, up before
-the analog demux, no?  Simply "hold" all 4 signals at the same time, and then
-demux them after they are frozen, then unhold & repeat the sequence.  Of
-course, the other solution would be to have separate A/D's for each channel,
-as has been suggested in an alternate thread of this same subject.

I'm trying to maintain a minimum parts count on the box since I'm going
to wire the prototype by hand. Separate ADCs eliminates the need for the
200Khz speed on the part at the cost of board space, wiring, and cost.
The 4 S/H however is quite a viable solution. I'll probably run tests
in the delay configuration and see what effect is has. If it's absolutly
Godawful then I'd try the 4 S/H next.

-
-BTW, isn't this "delay" the same "problem" that's been mentioned with certain
-CD players, which use only one D/A converter for both channels, but mux the
-stereo outputs?  One person (in a review I read) gave the analogy of standing
-1 cm closer to one of the stereo speakers in the room while listening to a
-CD, as being the effect of this phase shift (i.e., the speed of sound vs. the
-delay).

That's why I'm not going to worry about it 'til I hear a problem with it.

-   - Mike Shawaluk 
-       (mikes@lakesys.lakesys.com  OR  ...!uunet!marque!lakesys!mikes)

BAJ
-- 
Another random extraction from the mental bit stream of...
Byron A. Jeff
Georgia Tech, Atlanta GA 30332
Internet:	byron@pyr.gatech.edu  uucp:	...!gatech!pyr!byron

brianw@microsoft.UUCP (Brian Willoughby) (09/30/89)

In article <9238@pyr.gatech.EDU> byron@pyr.gatech.edu.gatech.edu (Byron A Jeff) writes:
>>Serial
>>	44.1 kHz * 4 channels * 16 bits/channel = 2.822 MHz
>>
>>I think the 56000 can handle this.  Only half of what you need, though.
>>You might be able to do it with the TM$32030, as it has two serial inputs.
>
>Even if it were serial I'd probably just shift it into shift registers
>and read in the parallel outputs when all of the bits of a complete
>sample has been shifted in.

Sure, why overwork the DSP?  Question: how would you know which 16 bits
make up a sample word?  I.e. are there some kind of start bits which
could be used to signal an interrupt.  A good setup would involve
clearing all the shift register bits to one state, and then shifting in
until the start bit appears in the MSBit.  Whatever polarity the start
bit is, just clear the shift register to the opposite value and interrupt
the DSP when a full word is ready.

>>Your biggest problem is that the samples are not arriving at the same
>>time.  Actually, I guess you could use an interrupt routine to store all
>>the samples, then have the DSP act on them when all have arrived.
>
>That's exactly what I was thinking. Something along these lines:
>
>Sample 1
>         Sample 2
>                  Sample 3
>                           Sample 4
>                                    Output of mix of the 4 above samples.
>
>--------Time Axis--------->

Check out my posting on digital mixing using time-multiplexing.  Based
on Jeff Taylors zero-filling 'proofs' you should be able to send samples
1-4 through a digital filter and then directly into the 56000.  It's as
if each sample train were zero filled (3 zeroes) and then added to the
other channels.  You wouldn't have to use up any 56000 processing power
to do the mixing.  The digital filter between the time-multiplexed
samples and the 56000 may not even be necessary, but you would need to
filter the outputs at some point.

>>Remember that since you are using an analog MUX, the samples can't all
>>be done at EXACTLY the same time, so there will be a slight delay between
>>all of the channels.
>
>I'm brand new in this domain. I have no clue what the effect of the
>delay between channels will be. Can you give me an idea?

Good question.  CD manufacturers claim that using a single DAC for the
two signals in a stereo recording introduces phase distortion when the
audio waves recombine in the listening environment and cancellations
occur which wouldn't have in the original source (I least that's what I
gleaned from the mumbo-jumbo).  If the delay is <= half the sampling
period, then how can the cancelations be audible?  Perhaps the
cancellations could affect lower frequencies which are audible?

In any event, those manufacturers are merely trying to sell you two DACs
instead of one, when a single converter and a few sample and hold stages
would realign the reconstructed signals.  One S/H could be used to
temporarily hold and delay whichever channel is output first, and then a
pair of S/H amps could be simultaneously clocked for phase aligned sterio
output.  I think this would be a reasonable circuit if expanded to 8
channels (although you would need 15 S/H amps).  That's assuming that the
phase shifting is audible and you need to correct it.

S/H is necessary on the analog output of any high quality DAC to avoid
impulses caused by less-than-ideal settling times of the DAC output.
Consider that it is impossible for all 16 bits to change at the same
times in any non-ideal converter, especially considering that most
transistors cut off at a different speed that they cut on.  Example:
assume that it takes longer to turn on a transistor so that 0 to 1 bit
transitions take longer than 1 to 0 transistions.  Then, for a digital
sample changing from $8000 to $7FFF, you would first get $0000 on the
DAC output before all the other 15 bits changed to $7FFF.  Ugly and BIG
spike!  Analog sample and hold allows the outputs to be disconnented
from the DAC during that spike, which holding the voltage from the
previous conversion in a capacitor.  Then, when the DAC output has
settled (most DAC specs quote settling times in nsecs), the new voltage
is 'sampled' by charging the cap.

>Byron A. Jeff
>Georgia Tech, Atlanta GA 30332

Brian Willoughby
UUCP:           ...!{tikal, sun, uunet, elwood}!microsoft!brianw
InterNet:       microsoft!brianw@uunet.UU.NET
  or:           microsoft!brianw@Sun.COM
Bitnet          brianw@microsoft.UUCP

todd@ivucsb.sba.ca.us (Todd Day) (09/30/89)

brianw@microsoft.UUCP (Brian Willoughby) writes:

~Sure, why overwork the DSP?  Question: how would you know which 16 bits
~make up a sample word?  I.e. are there some kind of start bits which
~could be used to signal an interrupt.  A good setup would involve
~clearing all the shift register bits to one state, and then shifting in
~until the start bit appears in the MSBit.  Whatever polarity the start
~bit is, just clear the shift register to the opposite value and interrupt
~the DSP when a full word is ready.

The serial port on the 56000 is completely independent of the ALU, etc
(i.e., it is like an on board peripheral).  I was talking about using
the synchronous serial input.  You supply it with a bit clock and a
word clock and it automatically does the serial to parallel conversion
*and* generates an interrupt when it's ready.  Usually, my programs for
my board consist of a main loop that does absolutely nothing and an
interrupt service routine.  The (nano)second I get a sample, the interrupt
routine starts executing.  My service routine loads the parallel data,
operates on it, and then stores it to the serial output buffer.  The
serial section of the chip then outputs the data when the next word
clock comes around, all independent of the *real* DSP hardware on the
chip.

-- 

Todd Day  |  todd@ivucsb.sba.ca.us  |  ivucsb!todd@anise.acc.com
"Ya know, some day these scientists are going to invent something
	that can outsmart a rabbit" -- Bugs Bunny

byron@pyr.gatech.EDU (Byron A Jeff) (09/30/89)

In article <7905@microsoft.UUCP> brianw@microsoft.UUCP (Brian Willoughby) writes:
-In article <9238@pyr.gatech.EDU> byron@pyr.gatech.edu.gatech.edu (Byron A Jeff) writes:
->>Serial
->>	44.1 kHz * 4 channels * 16 bits/channel = 2.822 MHz
->>
->>I think the 56000 can handle this.  Only half of what you need, though.
->>You might be able to do it with the TM$32030, as it has two serial inputs.
->
->Even if it were serial I'd probably just shift it into shift registers
->and read in the parallel outputs when all of the bits of a complete
->sample has been shifted in.
-
-Sure, why overwork the DSP?  Question: how would you know which 16 bits
-make up a sample word?  I.e. are there some kind of start bits which
-could be used to signal an interrupt.  A good setup would involve
-clearing all the shift register bits to one state, and then shifting in
-until the start bit appears in the MSBit.  Whatever polarity the start
-bit is, just clear the shift register to the opposite value and interrupt
-the DSP when a full word is ready.

I think I'd just attach a 4 bit counter that is clocked and cleared along
with the shift registers. Then when the counters overflows I generate
an interrupt. When I read in the parallel value in the shift register
I clear the counter. Not completely thought out but that's the 
general idea.

-
->>Your biggest problem is that the samples are not arriving at the same
->>time.  Actually, I guess you could use an interrupt routine to store all
->>the samples, then have the DSP act on them when all have arrived.
->
->That's exactly what I was thinking. Something along these lines:
->
->Sample 1
->         Sample 2
->                  Sample 3
->                           Sample 4
->                                    Output of mix of the 4 above samples.
->
->--------Time Axis--------->
-
-Check out my posting on digital mixing using time-multiplexing.  Based
-on Jeff Taylors zero-filling 'proofs' you should be able to send samples
-1-4 through a digital filter and then directly into the 56000.  It's as
-if each sample train were zero filled (3 zeroes) and then added to the
-other channels.  You wouldn't have to use up any 56000 processing power
-to do the mixing.  The digital filter between the time-multiplexed
-samples and the 56000 may not even be necessary, but you would need to
-filter the outputs at some point.

The only question is what's the sample rate of the mixed signal? It
would seem to be 8x the original sample rate yes? So for 8 48Khz channels
I'd need a 384 Khz DAC. Ouch! 

-
->>Remember that since you are using an analog MUX, the samples can't all
->>be done at EXACTLY the same time, so there will be a slight delay between
->>all of the channels.
->
->I'm brand new in this domain. I have no clue what the effect of the
->delay between channels will be. Can you give me an idea?
-
-Good question.  CD manufacturers claim that using a single DAC for the
-two signals in a stereo recording introduces phase distortion when the
-audio waves recombine in the listening environment and cancellations
-occur which wouldn't have in the original source (I least that's what I
-gleaned from the mumbo-jumbo).  If the delay is <= half the sampling
-period, then how can the cancelations be audible?  Perhaps the
-cancellations could affect lower frequencies which are audible?

I have a CD player with a single DAC. My ears are not sharp enough
to hear such distortion and I'm a musician.

-
-In any event, those manufacturers are merely trying to sell you two DACs
-instead of one, when a single converter and a few sample and hold stages
-would realign the reconstructed signals.  One S/H could be used to
-temporarily hold and delay whichever channel is output first, and then a
-pair of S/H amps could be simultaneously clocked for phase aligned sterio
-output.  I think this would be a reasonable circuit if expanded to 8
-channels (although you would need 15 S/H amps).  That's assuming that the
-phase shifting is audible and you need to correct it.
-
-S/H is necessary on the analog output of any high quality DAC to avoid
-impulses caused by less-than-ideal settling times of the DAC output.
-Consider that it is impossible for all 16 bits to change at the same
-times in any non-ideal converter, especially considering that most
-transistors cut off at a different speed that they cut on.  Example:
-assume that it takes longer to turn on a transistor so that 0 to 1 bit
-transitions take longer than 1 to 0 transistions.  Then, for a digital
-sample changing from $8000 to $7FFF, you would first get $0000 on the
-DAC output before all the other 15 bits changed to $7FFF.  Ugly and BIG
-spike!  Analog sample and hold allows the outputs to be disconnented
-from the DAC during that spike, which holding the voltage from the
-previous conversion in a capacitor.  Then, when the DAC output has
-settled (most DAC specs quote settling times in nsecs), the new voltage
-is 'sampled' by charging the cap.

This is the same explanation I got in Hal Chainberlin (sp) "Musical
Applications for Microprocessors". I understand I'll need S/H and filters
before the ADC and after the DAC. I was figuring on only one or two
pairs of stereo outputs from the mixer so I don't think that many S/H
are necessary on output.

Someone suggested that the S/H is built into the ADC so that I can
hook up the output from the CMOS multiplexor directly into the ADC.
So only 2 S/H (or one if I decide to go with a single DAC) will be
necessary (I hope).

-Brian Willoughby
-UUCP:           ...!{tikal, sun, uunet, elwood}!microsoft!brianw
-InterNet:       microsoft!brianw@uunet.UU.NET
-  or:           microsoft!brianw@Sun.COM
-Bitnet          brianw@microsoft.UUCP
-- 
Another random extraction from the mental bit stream of...
Byron A. Jeff
Georgia Tech, Atlanta GA 30332
Internet:	byron@pyr.gatech.edu  uucp:	...!gatech!pyr!byron

brianw@microsoft.UUCP (Brian Willoughby) (10/02/89)

In article <1160@lakesys.lakesys.com> mikes@lakesys.UUCP (Mike Shawaluk) writes:
>BTW, isn't this "delay" the same "problem" that's been mentioned with certain
>CD players, which use only one D/A converter for both channels, but mux the
>stereo outputs?

You hit it right on the head.

>                 One person (in a review I read) gave the analogy of standing
>1 cm closer to one of the stereo speakers in the room while listening to a
>CD, as being the effect of this phase shift (i.e., the speed of sound vs. the
>delay).

I had asked earlier about just how important it would be to correct such
phase shifts.  From the example of a room environment, I guess the answer
is: not very bloody important.  But, if the sound is to later be mixed -
for monophonic broadcast, or any other need to combine the stereo signals
electronically, not acoustically (where placement affects delay anyway) -
then it does become important, merely because the result (with its
peculiar frequency cancellations and reinforcements) would be different
than it would without the shift.

>-- 
>   - Mike Shawaluk 

Brian Willoughby
UUCP:           ...!{tikal, sun, uunet, elwood}!microsoft!brianw
InterNet:       microsoft!brianw@uunet.UU.NET
  or:           microsoft!brianw@Sun.COM
Bitnet          brianw@microsoft.UUCP

brianw@microsoft.UUCP (Brian Willoughby) (10/02/89)

In article <9247@pyr.gatech.EDU> byron@pyr.UUCP (Byron A Jeff) writes:
>In article <7905@microsoft.UUCP> brianw@microsoft.UUCP (Brian Willoughby) writes:
>-In article <9238@pyr.gatech.EDU> byron@pyr.gatech.edu.gatech.edu (Byron A Jeff) writes:
>-Sure, why overwork the DSP?  Question: how would you know which 16 bits
>-make up a sample word?  I.e. are there some kind of start bits which
>-could be used to signal an interrupt.  A good setup would involve
>-clearing all the shift register bits to one state, and then shifting in
>-until the start bit appears in the MSBit.  Whatever polarity the start
>-bit is, just clear the shift register to the opposite value and interrupt
>-the DSP when a full word is ready.

>I think I'd just attach a 4 bit counter that is clocked and cleared along
>with the shift registers. Then when the counters overflows I generate
>an interrupt. When I read in the parallel value in the shift register
>I clear the counter. Not completely thought out but that's the 
>general idea.

Still suffers from the same synchronization problems.  What if you
accidently clear the counter at bit 14?  Your hardware will happily chug
along and have you the next 16 bits from the continuous bit stream - only
they will be the wrong bits, not word aligned.

>-Check out my posting on digital mixing using time-multiplexing.
 [etc...]

>The only question is what's the sample rate of the mixed signal? It
>would seem to be 8x the original sample rate yes? So for 8 48Khz channels
>I'd need a 384 Khz DAC. Ouch! 

I might be wrong, but due to the simplicity of DACs, you'll probably find
that a DAC capable of 384 kHz is not nearly as prohibitively expensive as
an equally rated ADC.  Most DACs don't really quote conversion rates,
they merely state the settling time of the outputs, which affects how
fast you can clock your S/H on the output, and usually ends up being VERY
fast, even for $1.49 DACs (of course, thats an 8 bit price).

[I've deleted my own overview of Sample and Hold]
>
>This is the same explanation I got in Hal Chainberlin (sp) "Musical
>Applications for Microprocessors". I understand I'll need S/H and filters
>before the ADC and after the DAC. I was figuring on only one or two
>pairs of stereo outputs from the mixer so I don't think that many S/H
>are necessary on output.

Do you own that book, or borrow it from a library?  I tried to order it
from my university bookstore and could not find it listed.  BTW, Hal
Chamberlin (closer spelling, but probably not perfect :-) graduated from
NCSU, where I found his 1973 thesis for a digital waveform synthesizer.
This guy was/is really ahead of his time, and now works for Kurzweil.  He
started out with an Apple II, and did quite a bit with it (which keeps me
encouraged with my own projects).  He started a company in Raleigh, NC,
near the university. which built a dual 5.25 floppy box that would record
CD quality audio directly to disk, and also play back.  Of course, the
operator had to continually keep the drive fed with new disks, but the
amasing thing was that the box could handle managing the buffer/queue of
64K, reading from the disk and playing the sound all at once in
real-time.  No DSP used or needed.

I would appreciate any ordering information, or even just the library of
Congress number from that book.

>Someone suggested that the S/H is built into the ADC so that I can
>hook up the output from the CMOS multiplexor directly into the ADC.
>So only 2 S/H (or one if I decide to go with a single DAC) will be
>necessary (I hope).

One DAC can become two outputs with 2 S/H stages if you design separate
control for each S/H.  3 stages gets you two phase-aligned audio outputs.

>-- 
>Another random extraction from the mental bit stream of...
>Byron A. Jeff
>Georgia Tech, Atlanta GA 30332
>Internet:	byron@pyr.gatech.edu  uucp:	...!gatech!pyr!byron

Brian Willoughby
UUCP:           ...!{tikal, sun, uunet, elwood}!microsoft!brianw
InterNet:       microsoft!brianw@uunet.UU.NET
  or:           microsoft!brianw@Sun.COM
Bitnet          brianw@microsoft.UUCP

rando@skipper.dfrf.nasa.gov (Randy Brumbaugh) (10/02/89)

This digital mixer idea sounds great - but I have a question:

Is the mixer for use in recording or sound reinforcement (PA)?

If it is for PA, what would the TOTAL delay from input to output
be? (I assume that this quantity would be a constant).  Would the
delay between input from the performers and output to the audience
be long enough to be noticed?  Also, could this delay be varied
to help eliminate feedback?

Randy Brumbaugh
rando@skipper.dfrf.nasa.gov

ingoldsb@ctycal.COM (Terry Ingoldsby) (10/03/89)

There are always a lot of discussions going on about the evils of phase
shift, eg. how much oversampling do I have to do to reduce my analog filter
to 30 dB/octave with phase shift < 10 degrees.  Can someone tell us if it
might be possible, knowing what the phase shift of the analog filter
will be, to precompensate in the digital domain?  ie. before the signal is
converted back to analog (and subsequently filtered) could we not shift
the phase appropriately in the `other direction'?

-- 
  Terry Ingoldsby                       ctycal!ingoldsb@calgary.UUCP
  Land Information Systems                           or
  The City of Calgary         ...{alberta,ubc-cs,utai}!calgary!ctycal!ingoldsb

d88-jwa@nada.kth.se (Jon W{tte) (10/03/89)

In article <9247@pyr.gatech.EDU> byron@pyr.UUCP (Byron A Jeff) writes:
>The only question is what's the sample rate of the mixed signal? It
>would seem to be 8x the original sample rate yes? So for 8 48Khz channels
>I'd need a 384 Khz DAC. Ouch! 

No, not really. You apply a digital filter on the signal, and then use
each eigth sample. Yes, it'll work ! Someone said that you should apply
this BEFORE you fed the signal to the DSP, but then you would have no
channel separation (the channel separatio is in the time domain if you
interleave the samples, and the filter truly messes this up) and all the
channels would come out mixed equally.

>-In any event, those manufacturers are merely trying to sell you two DACs
>-instead of one, when a single converter and a few sample and hold stages
>-would realign the reconstructed signals.  One S/H could be used to

But using one DAC also introduces some distortion in switching between
channels !

>>transitions take longer than 1 to 0 transistions.  Then, for a digital
>>sample changing from $8000 to $7FFF, you would first get $0000 on the
>>DAC output before all the other 15 bits changed to $7FFF.  Ugly and BIG
>>spike!  Analog sample and hold allows the outputs to be disconnented

Heard about (a) a latch and (b) an analog filter after the DAC ?
Wouldn't this take care of such things ? ARE there S/H stages after
the DAC in good CDs ? I don't think so, but please correct me, if you
know for * SURE *.

Says,
		h+@nada.kth.se
-- 
Mooo.

byron@pyr.gatech.EDU (Byron A Jeff) (10/04/89)

In article <1845@draken.nada.kth.se> d88-jwa@nada.kth.se (Jon W{tte) writes:
-In article <9247@pyr.gatech.EDU> byron@pyr.UUCP (Byron A Jeff) writes:
->The only question is what's the sample rate of the mixed signal? It
->would seem to be 8x the original sample rate yes? So for 8 48Khz channels
->I'd need a 384 Khz DAC. Ouch! 
-
-No, not really. You apply a digital filter on the signal, and then use
-each eigth sample. Yes, it'll work ! Someone said that you should apply
-this BEFORE you fed the signal to the DSP, but then you would have no
-channel separation (the channel separatio is in the time domain if you
-interleave the samples, and the filter truly messes this up) and all the
-channels would come out mixed equally.

'Wow!' he exclaims incredulously. Would you please go into a little more
detail on how this black magic works? Also is it possible to scale
the samples for individual channel volume control before using the filter?

-
-		h+@nada.kth.se

BAJ (the ever amazed)
-- 
Another random extraction from the mental bit stream of...
Byron A. Jeff
Georgia Tech, Atlanta GA 30332
Internet:	byron@pyr.gatech.edu  uucp:	...!gatech!pyr!byron

todd@ivucsb.sba.ca.us (Todd Day) (10/04/89)

d88-jwa@nada.kth.se (Jon W{tte) writes:

~>>Then, for a digital
~>>sample changing from $8000 to $7FFF, you would first get $0000 on the
~>>DAC output before all the other 15 bits changed to $7FFF.  Ugly and BIG
~>>spike!

~Heard about (a) a latch and (b) an analog filter after the DAC ?
~Wouldn't this take care of such things ? ARE there S/H stages after
~the DAC in good CDs ? I don't think so, but please correct me, if you
~know for * SURE *.

I know all Denon players have them.  I'm certain that just about every
CD player has them.  It wouldn't do any good to build a latch into the
DACs because you would still have the problem of each bit not flipping
at EXACTLY the same time.  An analog filter would not solve the problem
because they would have slew problems when the spikes come through.  This
slewing would produce distortion products at the output, and could never
be filtered out entirely.  Hell, they have enough problems just handling
the staircases!

-- 

Todd Day  |  todd@ivucsb.sba.ca.us  |  ivucsb!todd@anise.acc.com
"Time to eat all your words, swallow your pride, open your eyes."
					-- Tears for Fears

brianw@microsoft.UUCP (Brian Willoughby) (10/06/89)

In article <1845@draken.nada.kth.se> d88-jwa@nada.kth.se (Jon W{tte) writes:
>>-In any event, those manufacturers are merely trying to sell you two DACs
>>-instead of one, when a single converter and a few sample and hold stages
>>-would realign the reconstructed signals.  One S/H could be used to
>
>But using one DAC also introduces some distortion in switching between
>channels !

How? when the digital signal 'switches' discretely from one sample to the
next?  There is no more 'switching' in a single DAC circuit than in a
multiple DAC circuit.  This agrees with the definition of PCM.

>>>transitions take longer than 1 to 0 transistions.  Then, for a digital
>>>sample changing from $8000 to $7FFF, you would first get $0000 on the
>>>DAC output before all the other 15 bits changed to $7FFF.  Ugly and BIG
>>>spike!  Analog sample and hold allows the outputs to be disconnented
>
>Heard about (a) a latch and (b) an analog filter after the DAC ?
>Wouldn't this take care of such things ? ARE there S/H stages after
>the DAC in good CDs ? I don't think so, but please correct me, if you
>know for * SURE *.

(a) a latch is no more instantaneous than any other electronic circuit.
It would still suffer from the same variations in transition time.
(b) an analog filter is nothing more than a circuit which reacts in a
defined to its input.  If you give a filter a different input (i.e. an
input with extra spikes it in), then it will produce a different output.
The spikes would be reduced, but your signal would not be as clean as it
would if the spikes were not produced and the filter merely smoothed the
stepping that is normal with PCM.

I can't comment on *all* good CD players, but S/H is considered optimum
(followed by an analog filter at or above the Nyquist point).

>		h+@nada.kth.se

Brian Willoughby
UUCP:           ...!{tikal, sun, uunet, elwood}!microsoft!brianw
InterNet:       microsoft!brianw@uunet.UU.NET
  or:           microsoft!brianw@Sun.COM
Bitnet          brianw@microsoft.UUCP

harrison@sunny.DAB.GE.COM (Gregory Harrison) (10/11/89)

In article <1989Sep30.122344.12326@ivucsb.sba.ca.us> todd@ivucsb.sba.ca.us (Todd Day) writes:
>
>*and* generates an interrupt when it's ready.  Usually, my programs for
>my board consist of a main loop that does absolutely nothing and an
>interrupt service routine.  The (nano)second I get a sample, the interrupt

As an aside, the TI TMS320C30 has an instruction that puts the processor
into an idle state, and just waits around for an interrupt to spur it 
into action.  

Greg Harrison
My opinions are not intended to reflect those of GE.

harrison@sunny.DAB.GE.COM (Gregory Harrison) (10/18/89)

In article <7973@microsoft.UUCP> brianw@microsoft.UUCP (Brian Willoughby) writes:
>In article <1845@draken.nada.kth.se> d88-jwa@nada.kth.se (Jon W{tte) writes:
>
>>>>transitions take longer than 1 to 0 transistions.  Then, for a digital
>>>>sample changing from $8000 to $7FFF, you would first get $0000 on the
>>>>DAC output before all the other 15 bits changed to $7FFF.  Ugly and BIG
>>>>spike!  Analog sample and hold allows the outputs to be disconnented

How about Gray Code?  Apart from the p = 0.999 chance that no manufacturers
currently make Gray code DACs, the advantage to this method would be less
of a spike due to large numbers of bits changing simultaneously.  In Gray
code, only one bit changes between each successive ADU (Analog to Digital
Unit) increment.  OK, so that would fix the problem of large spikes on the 
analog ground (ahh, a separate regulated power source for the analog half 
of the DAC?  That would go a long way towards reducing metallically 
coupled digital switching spikes to the analog output.  The EMI switching
spikes may have to be contended with by MMIC (Monolithic Microwave
Integrated Circuit) device design philosophies on-chip.

Again, OK, Gray code would counteract switching noise for increments of 
1 in the signal, but what about increments (or decrements) not = 1.
Is there a more advanced Gray code that will minimize the number of 
bits changing ~simultaneosly within a certain range?  For instance, a 
second order Gray code that would minimize the number of bits that
could change for an increment +/- 1 and +/- 2. Etcetera for third
order....  

Is there a better way, or does it all come down to parallel antennas
radiating garbage to our delicate wires?

Greg Harrison
My opinions are not intended to express those of GE.

curt@dtix.dt.navy.mil (Welch) (10/19/89)

In article <2437@ge-dab.GE.COM> harrison@sunny.DAB.GE.COM (Gregory Harrison) writes:
>How about Gray Code?

Gray codes won't work because there is no easy way to make a Gray Code
to Analog converter.  The only way I can think of doing it is to first
convert the Gray Code to binary, and this of course defeats your reason
for using Gray code.

Curt Welch
curt@dtix.dt.navy.mil

harrison@sunny.DAB.GE.COM (Gregory Harrison) (10/20/89)

In article <227@nems.dt.navy.mil> curt@dtix.dt.navy.mil (Curt Welch) writes:
>In article <2437@ge-dab.GE.COM> harrison@sunny.DAB.GE.COM (Gregory Harrison) writes:
>>How about Gray Code?
>
>Gray codes won't work because there is no easy way to make a Gray Code
>to Analog converter.  The only way I can think of doing it is to first
>convert the Gray Code to binary, and this of course defeats your reason
>for using Gray code.

Perhaps the Gray Code could be converted to binary (if need be) interior
to the intergrated circuit DAC, at a much lower power than required to 
transmit the data between chips.  I would assume that most of the ICs
that drive the datalines to the DAC, and the DAC inputs, allow much
more current (charge) to flow than would be required to actually 
perform the Gray code to binary conversion on the chip semiconductor
surface.  There are probably some very low power, low EMI digital 
circuitry technologies that would be applicable.

This may represent an improvement in preserving the S/N of the 
analog sections (reducing digital noise), but samplingand holding the
signal after the switching spike subsides would probably be sufficient.

Greg Harrison
My opinions are not intended to express those of GE