IPB

Welcome Guest ( Log In | Register )

> Upload forum rules

- No over 30 sec clips of copyrighted music. Cite properly and never more than necessary for the discussion.


- No copyrighted software without permission.


- Click here for complete Hydrogenaudio Terms of Service

DSD-2-PCM -- proof of concept, test sample and source code here
SebastianG
post Oct 8 2005, 23:55
Post #1





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



The ZIP contains 4 files:
- dsd2pcm.jar (the converter written in Java, outputs raw 24/88 PCM, intel byte order)
- info.txt (contains some infos)
- test2822k.dsd (14 seconds, mono DSD, 5 megs)
- test44k.mp3 (conversion result)

have fun,
Sebi

Edit-2011: For the latest C/C++ source code see https://code.google.com/p/dsd2pcm/ It is released under the new BSD license. The attatchment to this post is still the first Java release.



This post has been edited by SebastianG: Dec 4 2011, 17:45
Attached File(s)
Attached File  dsd2pcm.zip ( 3.56MB ) Number of downloads: 2832
 
Go to the top of the page
+Quote Post
 
Start new topic
Replies
SebastianG
post Nov 27 2009, 03:26
Post #2





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



Just for kicks and giggles I rewrote most of "dsd2pcm" in C and C++. Compared to the java tool, it lacks the 2nd stage but it supports multiple channels and user-selectable bit ordering and output bitdepth (16 or 24). Without the 2nd stage you basically get "DXD" (PCM at 352.kHz). I figured, once you have a PCM stream you could just as well use any sampling rate converter to do further processing. Though, keep in mind that the resulting 24/352 PCM signal is a big waste of hard disc space since there will be a lot of ultrasonic noise in there (blame DSD, not me!). I recommend further downsampling and/or an additional lowpass filter (kicking in at 50 kHz). If you like such high sampling rates and want to do lossless compression afterwards, you really should do some filtering.

You might want to download some DSD files from here to test a little. I successfully tested a DSD64 stereo track like this:
CODE
sg@home:~/ccpp/dsd2pcm$ cat 2L38_01_DSD.dff | ./dsd2pcm 2 m 24 | sox -t raw -r 352800 -s -3 -c 2 - -r 88200 -b 24 test.wav


(Of course, this only works for uncompressed DSD files)

This conversion was done in approx 30 X real-time on my computer (2.4 GHz Core2 Duo). So, I'm a little surprized to see some people are having problems playing back DSD in real time. BTW: I didn't find the foobar2k DSD plugin. Does anybody have a link?

Cheers!
SG

latest source code: https://code.google.com/p/dsd2pcm/

This post has been edited by SebastianG: Dec 4 2011, 17:43
Go to the top of the page
+Quote Post
vincefalks
post Nov 27 2009, 03:44
Post #3





Group: Members
Posts: 37
Joined: 23-August 09
Member No.: 72571



QUOTE (SebastianG @ Nov 27 2009, 03:26) *
Just for kicks and giggles I rewrote most of "dsd2pcm" in C and C++. Compared to the java tool, it lacks the 2nd stage but it supports multiple channels and user-selectable bit ordering and output bitdepth (16 or 24). Without the 2nd stage you basically get "DXD" (PCM at 352.kHz). I figured, once you have a PCM stream you could just as well use any sampling rate converter to do further processing.

You might want to download some DSD files from here to test a little. I successfully tested a DSD64 stereo track like this:
CODE
sg@home:~/ccpp/dsd2pcm$ cat 2L38_01_DSD.dff | ./dsd2pcm 2 m 24 | sox -t raw -r 352800 -s -3 -c 2 - -r 88200 -b 24 test.wav


(Of course, this only works for uncompressed DSD files)

That's awesome, SG! I'm going to try a multichannel DFF...super smile.gif. Oh no hang on - bah I'm a n00b - how do you compile it in windows, or can you provide a windows binary?

Honeslty not much info is known on this, but people keep claiming that 352.8kHz PCM IS DXD, when I really think it's not. I myself don't have tonnes of info on it, but for TRUE DXD I think you need to change something else in the encoding of it too (different roll-off filter to PCM). So it's just ultra hi-res PCM in this case.

QUOTE
This conversion was done in approx 30 X real-time on my computer (2.4 GHz Core2 Duo). So, I'm a little surprized to see some people are having problems playing back DSD in real time. BTW: I didn't find the foobar2k DSD plugin. Does anybody have a link?

Cheers!
SG

It's here.

It's DST-encoded files that we're having troubles with, not uncompressed DSD. The reference decoder is quite "unoptimal" by the looks of it, and could be improved a lot. Right now it's only good for storage, not on the fly decoding.
Go to the top of the page
+Quote Post
SebastianG
post Nov 27 2009, 04:14
Post #4





Group: Developer
Posts: 1317
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (vincefalks @ Nov 27 2009, 03:44) *
That's awesome, SG! I'm going to try a multichannel DFF...super smile.gif. Oh no hang on - bah I'm a n00b - how do you compile it in windows, or can you provide a windows binary?

Sorry, I can only offer a "32bit x86 Linux binary" at the moment.

QUOTE (vincefalks @ Nov 27 2009, 03:44) *
It's here.

Sweet. smile.gif

Cheers,
SG
Attached File(s)
Attached File  dsd2pcm_32bit_x86_linux.zip ( 8.4K ) Number of downloads: 197
Attached File  dsd2pcm_32bit_x86_linux_static.zip ( 412.24K ) Number of downloads: 201
 
Go to the top of the page
+Quote Post
vincefalks
post Nov 27 2009, 05:11
Post #5





Group: Members
Posts: 37
Joined: 23-August 09
Member No.: 72571



QUOTE (SebastianG @ Nov 27 2009, 04:14) *
Sorry, I can only offer a "32bit x86 Linux binary" at the moment.

Ok. well do you have a paypal account, maybe I can speed it up wink.gif wink.gif

QUOTE (rpp3po @ Nov 27 2009, 04:16) *
QUOTE (vincefalks @ Nov 27 2009, 03:44) *
Honeslty not much info is known on this, but people keep claiming that 352.8kHz PCM IS DXD, when I really think it's not. I myself don't have tonnes of info on it, but for TRUE DXD I think you need to change something else in the encoding of it too (different roll-off filter to PCM). So it's just ultra hi-res PCM in this case.


How can a n00b with only 18 posts already cause so much sick.gif pain? You yourself might not "have tonnes of info on it", but apparently tonnes of bull***** to spread anyway. All you have posted here indicates an urge to find technical justification for marketing induced belief. You don't understand what DXD is, but you know it must be better. You don't understand what DSD is, but hey it must have something to it, even if it is analogish distortion, as reported by your choice of experts.

DXD fixes a bad design choice of DSD (by todays standards) and the fix is plain PCM. But hey, it can't be. DXD is supposed to be better than DSD, DSD is supposed to be better than PCM, ergo DXD can't be just PCM, else it would sound "digitalish", wouldn't it? That is your apparent mindset. When you say you "really think it's not" it would be more honest to say you "really believe it's not" as in "I believe in the maidenhood of mary". I think there are other forums where you would get much more positive resonance for that kind of interest.

I'm sorry, but you're only embarassing yourself. Let me rebut you and completely blow away your silly assumptions with *fact*, *reason* and *science*.

1. I have another alias on hydrogenaudio, which I used up until recently, and did so for about 2, maybe 3 years IIRC. It was nothing like a 300+ post profile and I've never been a "regular" per se, but by me merely being "new" you're assuming that I don't know anything about HA, aren't you? Completely wrong. I have been frequenting and posting at these boards for years - and knopw exactly what this community is about. I switched to this new username for a certain reason which I have a right to keep to myself, and no it has nothing to do with anything I did in my previous profile and "starting afresh" or something stupid like that - as I said, I was never an active user anyway. It's a certain privacy issue (I have changed identities for certain privacy reasons) which I have a right to do. Oh and if you now took this info I've just posted and falsely accuse and assume (once again) that I must have been some idiot and got caught in some embarassing or controversial affair on HA and started afresh to escape that previous identity (it seems you are quick to falsely blame people of that sort of thing), that would just be completely lame. The mods would know, as per the IP addresses under my posts on both profiles, who I used to be, although I recently moved houses and IPs too....

2. Have I indicated ANYWHERE that I believe that certain mathematical characteristics in digital audio (like different roll-off filters), correlates to better/different perceived audio quality? NO! Do I have to justfy why I want a certain setting/feature in digital audio? NO! I might just be someone who wants to edit audio files in the highest possible anal quality (and not for subjective "audio quality" reasons)! It's not your business to question why I am persuing certain digital formats or conversion/encoding settings. I have not claimed ANYWHERE that I am pursuing certain formats for their "audio quality".

You are making an ASSUMPTION based on stereotypes and linking it with a new profile here at HA (I'm not new) and my self-admittance of not being an expert on digital signal processing, and my raising questions which might be n00by and even unscientific in nature (but NOT invalid as I'm not making any claims - "wondering" is a part of science and the unknown), and creating a picture that is completely innacurate!

Can you stop n00b bashing please? Just because I'm not an expert on digitial signal processing....I unashamedly participate in these forums no matter what my level of knowledge is, and someone like you and your attitude, I'm sorry, but that won't stop me from making my contributions, whatever you interpret them to be.

Now back to THIS case about DXD: I am interpreting what seems to be not very widely-known SCIENTIFIC information on a very new digital audio format. All sources of information say that DXD is PCM-like, NOT PCM!!!!

The white paper, and other sources on the internet, say that because it has an ultra-high sampling rate, "it can afford to have a more relaxed anti-alising filter" (and thus, characteristically, has a closer pulse response and frequency response to DSD). This is scientific information, NOTHING to do with pereived sound quality!

Now, I want to get to the bottom of this, because I'm not sure if "it can afford to have a more relaxed anti-alising filter" means it DOES have a more relaxed anti-alising filter than PCM. I READ somewhere that yes, it DOES, but can't find that info since DXD is so obscure and new.

rpp3po, I am neutral and objective in ALL my posts here and you're making a whole lot of claims otherwise!!!


QUOTE
All you have posted here indicates an urge to find technical justification for marketing induced belief

Let me put it to you mate: I have an urge for TECHNICAL PERFECTION (in this case), INDEPENDENT OF WHAT THAT MIGHT MEAN IN TERMS OF SOUND QUALITY! And I don't CARE if you think that's overkill or unnecessary or crazy or a waste of bandwidth or effort or space! I really don't... cool.gif
Go to the top of the page
+Quote Post
rpp3po
post Nov 27 2009, 12:55
Post #6





Group: Developer
Posts: 1126
Joined: 11-February 03
From: Germany
Member No.: 4961



QUOTE (vincefalks @ Nov 27 2009, 05:11) *
Now, I want to get to the bottom of this, because I'm not sure if "it can afford to have a more relaxed anti-alising filter" means it DOES have a more relaxed anti-alising filter than PCM. I READ somewhere that yes, it DOES, but can't find that info since DXD is so obscure and new.


PCM just means pulse code modulation. An analog waveform's amplitude is captured as discrete symbols at regular intervals. But "PCM" doesn't imply any specific form of antialiasing filter! And so it just does not make sense to say something would be different from PCM, because of a "more-relaxed" antialiasing filter!

When you want to tune PCM for a specific kind of application, the selection of a matching antialiasing filter is totally normal. You decide wether you want to max out frequency response (bandwidth) or impulse response within the limits of a chosen sample rate. Either a filter with a steep or gentle slope is chosen accordingly. There are even applications where the filter can be omitted entirely.

The term "like PCM" just refers to common misconceptions in the audio community. Since the world conquering success of the Audio CD, people associate the underlying technology with brick wall filtering. The Audio CD's Nyquist frequency is relatively close to the human-audible frequency range and so steep filters are commonly used to max out available bandwidth.

But different (gentler sloped) filters have always been used, especially for higher sample rate content, even for plain Redbook. That's nothing specific to DXD.

This post has been edited by rpp3po: Nov 27 2009, 13:01
Go to the top of the page
+Quote Post
2Bdecided
post Nov 27 2009, 13:00
Post #7


ReplayGain developer


Group: Developer
Posts: 5089
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



QUOTE (rpp3po @ Nov 27 2009, 11:55) *
An analog waveform's amplitude is captured as discrete symbols at regular intervals.
I guess that's why it's "PCM-like" - there's so much noise that a single given discrete symbol (sample!) can have almost no relationship to the original analogue waveform's instantaneous amplitude.

It's a fair distinction they're trying to make - it's just that the terminology is wrong - it is still PCM - just like SBM or noise shaped CDs are still PCM.

I guess an honest description, e.g. "noisy PCM" wouldn't look so good in the marketing! wink.gif

Cheers,
David.
Go to the top of the page
+Quote Post

Posts in this topic
- SebastianG   DSD-2-PCM -- proof of concept   Oct 8 2005, 23:55
- - skamp   Now you need to develop a DVD-ROM driver for readi...   Oct 9 2005, 01:27
|- - SebastianG   QUOTE (skamp @ Oct 9 2005, 01:27 AM)Now you n...   Oct 9 2005, 10:32
|- - SebastianG   Oh, I noticed a small bug: The dsd file size must ...   Oct 9 2005, 11:06
- - tarsier   So is it theoretically possible to convert the PCM...   Dec 24 2006, 20:33
|- - putanik   QUOTE (tarsier @ Dec 24 2006, 13:33) So i...   Dec 24 2006, 22:54
|- - tarsier   Thanks for the link. But right now, I'm only ...   Dec 26 2006, 16:28
|- - Kees de Visser   QUOTE (tarsier @ Dec 26 2006, 16:28) In d...   Dec 26 2006, 19:03
- - andyshedd   I'm mildly curious how this method compares an...   Jan 8 2007, 22:44
- - frenchglen   Is there any updated info about this program? I tr...   Jun 8 2009, 15:23
- - LukeS   I am bringing this back form years of being dead. ...   Nov 23 2009, 15:56
- - GeSomeone   I think it's in the first post. QUOTE (Sebasti...   Nov 23 2009, 19:12
|- - SebastianG   QUOTE (GeSomeone @ Nov 23 2009, 19:12) I ...   Nov 23 2009, 20:31
- - LukeS   SebastianG, Awesome job on the program, my proble...   Nov 23 2009, 22:32
|- - vincefalks   I am not an expert but it would be cool to compare...   Nov 24 2009, 00:17
|- - rpp3po   What would be a higher quality approach than 1. co...   Nov 24 2009, 02:48
- - SebastianG   QUOTE (LukeS @ Nov 23 2009, 22:32) The ou...   Nov 24 2009, 10:38
- - 2Bdecided   With the huge caveat that I made no attempt to do ...   Nov 24 2009, 12:40
- - vincefalks   The noise is indeed a problem with the DSD format ...   Nov 24 2009, 13:07
|- - rpp3po   The problem with the "most accurate capture...   Nov 24 2009, 14:01
|- - vincefalks   QUOTE (rpp3po @ Nov 24 2009, 15:01) The p...   Nov 24 2009, 14:25
||- - Canar   QUOTE (vincefalks @ Nov 24 2009, 08:25) I...   Nov 24 2009, 15:49
||- - rpp3po   Raw DSD means saving about 3 GB per 70 minute ster...   Nov 24 2009, 17:23
||- - BOBCHEWIE   QUOTE (rpp3po @ Nov 24 2009, 10:23) Raw D...   Jan 3 2010, 12:14
||- - rpp3po   QUOTE (BOBCHEWIE @ Jan 3 2010, 12:14) scr...   Jan 3 2010, 14:15
||- - Axon   QUOTE (BOBCHEWIE @ Jan 3 2010, 05:14) QUO...   Jan 3 2010, 14:22
||- - Martel   QUOTE (BOBCHEWIE @ Jan 3 2010, 12:14) ......   Jan 4 2010, 09:53
|- - Mike Giacomelli   QUOTE (rpp3po @ Nov 24 2009, 08:01) DSD h...   Nov 24 2009, 15:46
- - LukeS   QUOTE (rpp3po @ Nov 24 2009, 08:01) The p...   Nov 24 2009, 21:39
|- - rpp3po   QUOTE (LukeS @ Nov 24 2009, 21:39) 48kHz ...   Nov 25 2009, 03:00
||- - LukeS   QUOTE (rpp3po @ Nov 24 2009, 21:00) QUOTE...   Nov 25 2009, 04:20
||- - Mike Giacomelli   QUOTE (LukeS @ Nov 24 2009, 22:20) QUOTE ...   Nov 25 2009, 05:25
||- - LukeS   QUOTE (Mike Giacomelli @ Nov 24 2009, 23...   Nov 25 2009, 05:29
||- - Mike Giacomelli   QUOTE (LukeS @ Nov 24 2009, 23:29) Also I...   Nov 25 2009, 05:55
|- - vincefalks   QUOTE (LukeS @ Nov 24 2009, 22:39) I am v...   Nov 25 2009, 08:02
|- - knutinh   QUOTE (LukeS @ Nov 24 2009, 21:39) Also t...   Nov 25 2009, 08:36
- - Axon   Look into the dynamic range of SACD at 22khz somet...   Nov 24 2009, 21:56
- - Axon   Yes, let's all thank LukeS for being a boy sco...   Nov 25 2009, 04:59
|- - LukeS   QUOTE (Axon @ Nov 24 2009, 22:59) Yes, le...   Nov 25 2009, 05:21
||- - Martel   QUOTE (LukeS @ Nov 25 2009, 05:21) The bo...   Nov 25 2009, 10:24
|- - 2Bdecided   QUOTE (Axon @ Nov 25 2009, 03:59) Sorry f...   Nov 25 2009, 12:13
|- - udauda   QUOTE (Axon @ Nov 24 2009, 19:59) You...   Nov 26 2009, 02:31
|- - 2Bdecided   QUOTE (udauda @ Nov 26 2009, 01:31) Does ...   Nov 26 2009, 11:46
|- - vincefalks   QUOTE (2Bdecided @ Nov 26 2009, 12:46) Li...   Nov 26 2009, 12:02
|- - rpp3po   Yawn! Am I really the last one to get where t...   Nov 26 2009, 12:37
|- - vincefalks   QUOTE (rpp3po @ Nov 26 2009, 13:37) Yawn...   Nov 26 2009, 13:10
|- - rpp3po   At least you seem believe the life-like-analog-sou...   Nov 26 2009, 13:25
|- - vincefalks   QUOTE (rpp3po @ Nov 26 2009, 14:25) At le...   Nov 26 2009, 13:40
- - LukeS   QUOTE (vincefalks @ Nov 25 2009, 02:02) Q...   Nov 25 2009, 09:16
|- - SebastianG   QUOTE (LukeS @ Nov 25 2009, 09:16) See th...   Nov 25 2009, 10:32
|- - knutinh   QUOTE (LukeS @ Nov 25 2009, 09:16) DST wo...   Nov 25 2009, 18:02
|- - simmconn   QUOTE DST would work but I have not found a no low...   Nov 26 2009, 01:31
|- - vincefalks   QUOTE (simmconn @ Nov 26 2009, 02:31) QUO...   Nov 26 2009, 03:38
- - rpp3po   Sorry, if I didn't express myself clearly enou...   Nov 25 2009, 12:04
- - Axon   It's a surprisingly well known mod, actually. ...   Nov 25 2009, 19:38
|- - rpp3po   I find it interesting, nevertheless. What equipmen...   Nov 25 2009, 20:38
- - LukeS   Wow, I really am messing thing up lately ; I got ...   Nov 26 2009, 07:27
|- - simmconn   And I just spent one and a half hours to encode an...   Nov 26 2009, 08:16
- - 2Bdecided   Yes, the distortions of SACD are inaudible. Especi...   Nov 26 2009, 15:57
- - Canar   So that's what they mean by "warm" s...   Nov 26 2009, 16:22
- - Axon   If SACD really did have a similar distortion profi...   Nov 26 2009, 21:14
- - SebastianG   Just for kicks and giggles I rewrote most of ...   Nov 27 2009, 03:26
|- - vincefalks   QUOTE (SebastianG @ Nov 27 2009, 03:26) J...   Nov 27 2009, 03:44
|- - SebastianG   QUOTE (vincefalks @ Nov 27 2009, 03:44) T...   Nov 27 2009, 04:14
||- - vincefalks   QUOTE (SebastianG @ Nov 27 2009, 04:14) S...   Nov 27 2009, 05:11
||- - Kees de Visser   There seems to be a growing (niche) market for onl...   Nov 27 2009, 09:02
||- - 2Bdecided   QUOTE (vincefalks @ Nov 27 2009, 04:11) N...   Nov 27 2009, 10:59
||- - rpp3po   QUOTE (vincefalks @ Nov 27 2009, 05:11) N...   Nov 27 2009, 12:55
|||- - 2Bdecided   QUOTE (rpp3po @ Nov 27 2009, 11:55) An an...   Nov 27 2009, 13:00
||- - krabapple   QUOTE (vincefalks @ Nov 26 2009, 23:11) T...   Nov 29 2009, 03:56
|- - rpp3po   QUOTE (vincefalks @ Nov 27 2009, 03:44) H...   Nov 27 2009, 04:16
- - LukeS   QUOTE (SebastianG @ Nov 26 2009, 21:26) J...   Nov 27 2009, 07:33
|- - smack   QUOTE (LukeS @ Nov 27 2009, 07:33) Window...   Nov 27 2009, 11:00
- - .halverhahn   DXD is PCM - just with a bunch of noise above 48kH...   Nov 27 2009, 15:34
|- - rpp3po   Wow! The DXD track is certainly nothing Bruce ...   Nov 27 2009, 17:47
- - spoon   As the noise is constant this shows the levels qui...   Nov 29 2009, 20:54
- - spoon   QUOTE The final amusing aspect to all this is that...   Nov 29 2009, 22:51
|- - krabapple   QUOTE (spoon @ Nov 29 2009, 16:51) QUOTE ...   Nov 30 2009, 06:33
- - spoon   Based on Sebastians good work I have wrapped the d...   Dec 1 2009, 17:49
- - kode54   @spoon: I presume you modified the stage 1 filter ...   Dec 1 2009, 19:55
- - spoon   I thought it was a command line option on dsd2pcm?   Dec 1 2009, 20:15
|- - kode54   QUOTE (spoon @ Dec 1 2009, 11:15) I thoug...   Dec 7 2009, 15:32
- - krabapple   This is all peachy for those recording DSD files o...   Dec 2 2009, 06:56
|- - BOBCHEWIE   QUOTE (krabapple @ Dec 1 2009, 23:56) Thi...   Jan 3 2010, 13:33
- - spoon   I might be wrong, but I do not think there are any...   Dec 2 2009, 09:55
|- - krabapple   QUOTE (spoon @ Dec 2 2009, 03:55) I might...   Dec 2 2009, 17:23
- - Martel   QUOTE There are three types of SACDs[9]: * Hy...   Dec 2 2009, 10:35
- - .halverhahn   Just for your information: Wheatus is offering The...   Dec 2 2009, 11:38
|- - 2Bdecided   QUOTE (.halverhahn @ Dec 2 2009, 10:38) J...   Dec 2 2009, 15:11
- - vincefalks   Ok finally my warning was lifted after a little si...   Dec 7 2009, 17:55
|- - krabapple   QUOTE (vincefalks @ Dec 7 2009, 11:55) QU...   Dec 7 2009, 18:26
|- - 2Bdecided   QUOTE (vincefalks @ Dec 7 2009, 16:55) I...   Dec 7 2009, 18:33
|- - spoon   Did anyone manage to decode a .dsf file? (such as ...   Dec 8 2009, 10:21
- - Martel   A (square analog) pulse has an infinitely wide spe...   Dec 7 2009, 18:26
- - udauda   I wonder, how come Pro-DSD never comes up with a s...   Jan 4 2010, 13:39
- - rpp3po   Excellent paper, thanks!   Jan 4 2010, 14:31
- - krabapple   I remember this one from a few years back....I for...   Jan 8 2010, 22:05
- - ElfeJoyeux   Hello, I just discovered this awesome topic durin...   Mar 11 2010, 22:34
|- - Hobbit13   QUOTE (ElfeJoyeux @ Mar 11 2010, 22:34) T...   Jul 19 2010, 10:48
- - Sik_Lescinovid   Has anyone so far noticed that when creating a 24 ...   Nov 27 2011, 18:28
2 Pages V   1 2 >


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st August 2014 - 17:15