Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to rec.audio.pro
[email protected][_2_] seanbroderick20003@yahoo.com[_2_] is offline
external usenet poster
 
Posts: 26
Default DSD to PCM Question

Can someone describe how a piece of software would take a 1 bit
stream, and convert it to whatever bit depth PCM? I'm familiar with
PCM sample rate conversion when the bit depths are identical. Then
it's just upsample to least common multiple, filter, and downsample
(assuming your going down by other than simple whole ratios). What I
don't understand is how 1 bit information is piled up to make PCM
words.

Thanks,

Sean B
  #2   Report Post  
Posted to rec.audio.pro
Scott Dorsey Scott Dorsey is offline
external usenet poster
 
Posts: 16,853
Default DSD to PCM Question

wrote:
Can someone describe how a piece of software would take a 1 bit
stream, and convert it to whatever bit depth PCM? I'm familiar with
PCM sample rate conversion when the bit depths are identical. Then
it's just upsample to least common multiple, filter, and downsample
(assuming your going down by other than simple whole ratios). What I
don't understand is how 1 bit information is piled up to make PCM
words.


DSD has a single bit that tells you if the signal is rising or falling.
It records at a very high sample rate.

insample=1 ; we're starting at the beginning of the data set
outsample=1
datasum =0 ; this is the current value of the signal.

while there is data

for i = i to dsdrate/pcmrate ; go through a block of data representing
if in[i+insample]=1 then ; one sample of the PCM output and look
datasum=datasum+1 ; through the DSD data to see what the
else ; final output level is.
datasum=datasum -1
end for

insample=insample+i ; advance to the next block
out[outsample=datasum ; store the data sum
outsample=outsample+1 ; advance to the next sample

; notice we do not clear datasum so we
; are starting the next group of samples
; at the point where the last left off

end while
--scott



Thanks,

Sean B



--
"C'est un Nagra. C'est suisse, et tres, tres precis."
  #3   Report Post  
Posted to rec.audio.pro
[email protected][_2_] seanbroderick20003@yahoo.com[_2_] is offline
external usenet poster
 
Posts: 26
Default DSD to PCM Question

Thanks Scott!

Can you zoom in on the part of the program where the 1 bit samples are
added up? Say we are going from 2.8224 1-bit down to 16 bit/44.1 kHz
PCM. Obviously then, 64 DSD samples need to be turned into one 16 bit
PCM word. How is this done? Can you give a step-by-step
description? Thanks!

Sean B
  #6   Report Post  
Posted to rec.audio.pro
Scott Dorsey Scott Dorsey is offline
external usenet poster
 
Posts: 16,853
Default DSD to PCM Question

Markus Mietling wrote:
(Scott Dorsey) wrote:

wrote:

Can you zoom in on the part of the program where the 1 bit samples are
added up? Say we are going from 2.8224 1-bit down to 16 bit/44.1 kHz
PCM. Obviously then, 64 DSD samples need to be turned into one 16 bit
PCM word. How is this done? Can you give a step-by-step
description? Thanks!


It's just addition! All those 1-bit samples tell you is whether the
signal is rising or falling.

So if you add up the number of DSD samples that make up one PCM sample,
you know how much the signal has risen or fallen between the last PCM
sample and the current one.


You mean, when we start at a PCM sample value of zero, and all those
1-bit DSD samples tell you that the signal is rising, then the next PCM
sample will have a value of 64? And the next one 128 when everything is
still rising?


Right, if the DSD data is all one 1 after another. If they are alternating
1s and 0s, the next PCM sample will be the same as the last.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."
  #7   Report Post  
Posted to rec.audio.pro
Randy Yates Randy Yates is offline
external usenet poster
 
Posts: 839
Default DSD to PCM Question

" writes:

Can someone describe how a piece of software would take a 1 bit
stream, and convert it to whatever bit depth PCM? I'm familiar with
PCM sample rate conversion when the bit depths are identical. Then
it's just upsample to least common multiple, filter, and downsample
(assuming your going down by other than simple whole ratios). What I
don't understand is how 1 bit information is piled up to make PCM
words.

Thanks,


Hi Sean,

DSD is just a special type of delta sigma data conversion that uses a
specific modulator and oversampling ratio. I provide a very quick
elementary, but I hope useful, coverage of the situation in this
presentation:

http://www.digitalsignallabs.com/presentation.pdf

Even though this is for delta sigma D/A conversion, the same basic ideas
apply to delta sigma A/D conversion.

If you understand the basics I present in that paper, then a method
that converts a 1-bit delta sigma bit stream to a multi-bit stream
would be as follows:

1. Low-pass filter the one-bit stream. Let one state represent +1
and the other -1 at the 1-bit rate, or 64*44.1 kHz.

2. Decimate the output by 64.

There are several sub-steps and considerations in implementing this
(such as the design of the filter, the careful selection of accumulator
word length and avoidance of overflow in the filter, and the use of
polyphase filtering to reduce the computational complexity of the
filter), but that's basically it. Write if you need to ask more
questions.
--
% Randy Yates % "Ticket to the moon, flight leaves here today
%% Fuquay-Varina, NC % from Satellite 2"
%%% 919-577-9882 % 'Ticket To The Moon'
%%%% % *Time*, Electric Light Orchestra
http://www.digitalsignallabs.com
  #9   Report Post  
Posted to rec.audio.pro
Scott Dorsey Scott Dorsey is offline
external usenet poster
 
Posts: 16,853
Default DSD to PCM Question

Markus Mietling wrote:
(Scott Dorsey) wrote:

Markus Mietling wrote:

You mean, when we start at a PCM sample value of zero, and all those
1-bit DSD samples tell you that the signal is rising, then the next PCM
sample will have a value of 64? And the next one 128 when everything is
still rising?


Right, if the DSD data is all one 1 after another. If they are alternating
1s and 0s, the next PCM sample will be the same as the last.


So, obviously the fastest way to get from 0 to full scale is to have
only 1s in your DSD data, and even under these "ideal" conditions you
won't have differences between adjacent PCM sample values that are
larger than 64, if we assume 2.8224 MHz DSD and 16 bit/44.1 kHz PCM.


Right. This is why slew-limiting becomes a big issue with DSD. You can
represent very high frequencies easily at low levels, but not at high levels.

However, the way I figure it, there are 63,553 DSD samples to each PCM
sample, given the rates that you describe. And it only takes 65,536
samples to go from -0dBFS to +0dbFS in a 16-bit system.

In other words, the maximum frequency at 0dBFS would be 44100 / 2048, or
roughly 21.5 Hz. Hz, not KHz.

Where's my mistake?


I think you dropped some decimal points, but the concept is sound.
--scott
--
"C'est un Nagra. C'est suisse, et tres, tres precis."
  #14   Report Post  
Posted to rec.audio.pro
Les Cargill Les Cargill is offline
external usenet poster
 
Posts: 617
Default DSD to PCM Question

Scott Dorsey wrote:
Markus Mietling wrote:
(Scott Dorsey) wrote:

Markus Mietling wrote:
You mean, when we start at a PCM sample value of zero, and all those
1-bit DSD samples tell you that the signal is rising, then the next PCM
sample will have a value of 64? And the next one 128 when everything is
still rising?
Right, if the DSD data is all one 1 after another. If they are alternating
1s and 0s, the next PCM sample will be the same as the last.

So, obviously the fastest way to get from 0 to full scale is to have
only 1s in your DSD data, and even under these "ideal" conditions you
won't have differences between adjacent PCM sample values that are
larger than 64, if we assume 2.8224 MHz DSD and 16 bit/44.1 kHz PCM.


Right. This is why slew-limiting becomes a big issue with DSD. You can
represent very high frequencies easily at low levels, but not at high levels.

However, the way I figure it, there are 63,553 DSD samples to each PCM
sample, given the rates that you describe. And it only takes 65,536
samples to go from -0dBFS to +0dbFS in a 16-bit system.

In other words, the maximum frequency at 0dBFS would be 44100 / 2048, or
roughly 21.5 Hz. Hz, not KHz.

Where's my mistake?


I think you dropped some decimal points, but the concept is sound.
--scott



Really *DUMB* quesiton here... but can't you simply frame them? In
essence, do PCM, one bit at a time? Just something I always
wondered when people waxed poetic about DSD in non-audio applications -
it serves the hardware engineer's desire to eliminate wires,
and still makes for Nyquist-ey encodings....

next up: HTTP over SPI....

--
Les Cargill
  #15   Report Post  
Posted to rec.audio.pro
Randy Yates Randy Yates is offline
external usenet poster
 
Posts: 839
Default DSD to PCM Question

Les Cargill writes:
[...]
Really *DUMB* quesiton here... but can't you simply frame them? In
essence, do PCM, one bit at a time?


Hi Les,

You didn't ask me, but if Scott and you don't mind, I'll go ahead and
answer.

Not only no, but hell no! You'd be weighting each bit differently. It
would be similar to multiplying an N-bit pcm wordstream by a ramping
stream of gain values.
--
% Randy Yates % "Rollin' and riding and slippin' and
%% Fuquay-Varina, NC % sliding, it's magic."
%%% 919-577-9882 %
%%%% % 'Living' Thing', *A New World Record*, ELO
http://www.digitalsignallabs.com


  #16   Report Post  
Posted to rec.audio.pro
Les Cargill Les Cargill is offline
external usenet poster
 
Posts: 617
Default DSD to PCM Question

Randy Yates wrote:
Les Cargill writes:
[...]
Really *DUMB* quesiton here... but can't you simply frame them? In
essence, do PCM, one bit at a time?


Hi Les,

You didn't ask me,


I asked everybody.

but if Scott and you don't mind, I'll go ahead and
answer.

Not only no, but hell no! You'd be weighting each bit differently. It
would be similar to multiplying an N-bit pcm wordstream by a ramping
stream of gain values.


You'd have to do more than just frame them.

I really still don't "get" DSD, but... that's okay. It works.

--
Les Cargill
  #17   Report Post  
Posted to rec.audio.pro
Randy Yates Randy Yates is offline
external usenet poster
 
Posts: 839
Default DSD to PCM Question

Les Cargill writes:

Randy Yates wrote:
Les Cargill writes:
[...]
Really *DUMB* quesiton here... but can't you simply frame them? In
essence, do PCM, one bit at a time?


Hi Les,

You didn't ask me,


I asked everybody.


Hi Les,

Whew. I thought I was stepping on toes...

but if Scott and you don't mind, I'll go ahead and
answer.

Not only no, but hell no! You'd be weighting each bit differently. It
would be similar to multiplying an N-bit pcm wordstream by a ramping
stream of gain values.


You'd have to do more than just frame them.

I really still don't "get" DSD, but... that's okay. It works.


It's not too hard to see at least the big picture if you look at it the
right way, and that way revolves around viewing things in the frequency
domain.

By far the most important thing to get is this: for a given bit
resolution, the total quantization noise power is constant. For example
if you have a one bit signal at some specified supply voltage that has a
total quantization noise power of 1 milliwatt at 44.1 kHz, then running
the same conversion system at 2.8224 MHz (or whatever) will still have 1
milliwatt of quantization noise power.

Now if we view this noise power in the frequency domain, and we make an
assumption on the input signal's randomness, that 1 milliwatt is spread
evenly throughout the entire spectrum from 0 to Fs / 2 Hz. Noise power
per unit bandwidth is what we call noise _power spectral density_.

So if we take our 44.1 kHz 1 bit signal that has 1 milliwatt of total
noise power, we'll have a noise _power spectral density_ of 1 milliwatt
/ 22.05 kHz = 4.44E-8 watts/Hz.

Now if we clock that same converter at, say, 2.8224 MHz, then we STILL
have a total noise power of 1 milliwatt, but now it's spread evenly over
the entire bandwidth of 0 to 1.4112 MHz, or 3.54e-10 watts/Hz.

So if we simply lowpass filter this 2.8224 MHz signal at 22.01 kHz, we
cut out a large portion of the quantization noise, and that's _part_ of
the reason we get better than 1 bit resolution with just a 1 bit
converter. This is what I call "oversampling" in the short presentation
I cited a couple of posts ago, and it's illustrated in Figure 3.

The final twist to delta sigma modulation is that we don't just leave
the quantization noise flat over the band. It turns out that we can
actually redistribute the noise in frequency by placing feedback around
the quantizer. This is called "noise-shaping."

For example, we can move the noise that is in the lower power of the
spectrum up into the higher part of the spectrum. Then when we filter
with the lowpass filter mentioned above, we are left with even less
in-band quantization noise power and therefore have improved the
effective resolution of our "1-bit" converter dramatically compared to
oversampling alone.

And that's the gist of it.
--
% Randy Yates % "So now it's getting late,
%% Fuquay-Varina, NC % and those who hesitate
%%% 919-577-9882 % got no one..."
%%%% % 'Waterfall', *Face The Music*, ELO
http://www.digitalsignallabs.com
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about live shows (the band simple minds) and unrelated audio question GreenSlimer Tech 8 September 28th 04 05:07 AM
question about the band Simple Minds (and live show question) GreenSlimer Pro Audio 0 September 13th 04 01:25 AM


All times are GMT +1. The time now is 07:19 PM.

Powered by: vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 AudioBanter.com.
The comments are property of their posters.
 

About Us

"It's about Audio and hi-fi"