Marcel, I'm getting similar results. I'm using a bandlimited pulse sampled at 2.8224MHz (X axis in the first plot is samples)...
It repeats this signal 2048 times, encodes it as DSD, and I'm using the correlation of the DSD output with the original pulse as a measurement of the output pulse amplitude, normalized to 1. Then it plots the histogram of the error on that pulse amplitude.
So there's a RMS amplitude error of 0.000142%. The error (in absolute value, not %) does not seem to depend on the amplitude of the pulse, in other words it is noise.
This seems perfect and does not explain why there was a difference in the previous substraction test. However the sigma delta gain is not exactly 0.5 as it should, it is more like 0.499... I'm going to do it again with better gain matching to get a true error signal.
It repeats this signal 2048 times, encodes it as DSD, and I'm using the correlation of the DSD output with the original pulse as a measurement of the output pulse amplitude, normalized to 1. Then it plots the histogram of the error on that pulse amplitude.
So there's a RMS amplitude error of 0.000142%. The error (in absolute value, not %) does not seem to depend on the amplitude of the pulse, in other words it is noise.
This seems perfect and does not explain why there was a difference in the previous substraction test. However the sigma delta gain is not exactly 0.5 as it should, it is more like 0.499... I'm going to do it again with better gain matching to get a true error signal.
This time, a shorter pulse, brickwall lowpassed to 22050 Hz. This corresponds better to one redbook CD sample once it has been oversample to 2.8Msps.
It is much shorter, leaving less samples for the DC modulator to work, so this time the RMS amplitude error is 0.12%.
Tolerable amplitude error would depend on the ear's integration period.
It is much shorter, leaving less samples for the DC modulator to work, so this time the RMS amplitude error is 0.12%.
Tolerable amplitude error would depend on the ear's integration period.
Oops! I screwed up! There was an error in the code 😀 I can't delete the posts now...
Corrected first post: RMS amplitude error 0.000292%
Corrected second post: RMS amplitude error 0.021268%
Corrected first post: RMS amplitude error 0.000292%
Corrected second post: RMS amplitude error 0.021268%
Another test is to encode a sinewave at 11025 Hz into DSD, then on each period, detect the magnitude and phase.
RMS amplitude error 0.039762%
...and I discover the sox DSD encoder adds a 1 DSD sample delay, which is corrected here.
RMS amplitude error 0.039762%
...and I discover the sox DSD encoder adds a 1 DSD sample delay, which is corrected here.
IIRC seems like the most preferred modulator in HQ Player is ADSM512+. Again IIRC, the letter A in the name refers to 'adaptive.' Perhaps its statistics would be variable depending on the waveform as well as different from those in sox and or from Marcel.
Since different modulator algorithms sound different and may have different statistics, and all sorts of modulators are used in ADCs, DACs, and DSD converters, not sure about the point of this exercise?
Since different modulator algorithms sound different and may have different statistics, and all sorts of modulators are used in ADCs, DACs, and DSD converters, not sure about the point of this exercise?
Response to an input sample of 0.1 at time point 10, red: only filtered, green: decimated sigma-delta modulate (first of the iterations).
Root of the second moment of the difference between the decimated sigma-delta modulate and signal that has only been filtered, calculated over 1000 iterations. I could simply call it the standard deviation if I had used the second central moment, but I took the root of the average of the squared errors, so errors that occur in each iteration also count.
Settling part cut off:
The signal doesn't seem to have much impact on the noise, not for this specific algorithm and signal and without any DAC imperfections anyway.
Root of the second moment of the difference between the decimated sigma-delta modulate and signal that has only been filtered, calculated over 1000 iterations. I could simply call it the standard deviation if I had used the second central moment, but I took the root of the average of the squared errors, so errors that occur in each iteration also count.
Settling part cut off:
The signal doesn't seem to have much impact on the noise, not for this specific algorithm and signal and without any DAC imperfections anyway.
Average over the 1000 iterations in the same plot, so you can see it isn't an offset or a gain error. Red: root of the second moment, green: average of the error.
Example of weird behaviour of my chaotic sigma-delta modulator, the one with the non-stationary noise issue. I've now put the pulse at 30 rather than 10. The noise is weaker after the pulse than before it. The level is astronomically low, but I have heard effects like that with a much higher level with this modulator and a non-ideal DAC.
I have continued the experiments with this sox dsd plugin running at 2.8224Msps...
Last time I substracted the original file at 88.2k and the upsampled-DSDencoded-downsampled file, and that was quite noisy.
This time I used sox to upsample the audio at 2.8224Msps (64Fs) and saved the file as 32-bit float. I encoded it as DSD. Then I substracted the 64Fs original file and the DSD file, and downsampled the result to 88.2k. Link to file.
Note all these diff files have gain, it is in the filename.
Results are completely different: there is much lower noise, the residual is a low amplitude high-pass filtered version of the original. I have tested various delays and can confirm the files are aligned, so it is not a comb filtering effect. It must be due to the DSD filters not being completely flat, so a difference in frequency response would explain this.
The difference with the previous noisy experiment must come from the high amount of noise upsetting the resampler, or something of the sort. That's quite worrying actually.
In any case, the substraction between the DSD stream and the upsampled audio does not sound distorted... so I'm going to decide this DSD encoder is clean enough.
I then simulated various amounts of jitter and voltage reference noise. Even a small amount does cause a lot of HF noise to fold back into the audio band. An interesting result was with 705600Hz (16Fs) sine wave modulating the analog reference by 0.028%. The idea is a bit of noise coming out of the digital filter. This folded back some noise in the output, which is modulated and sounds different during the almost-silence before the song starts, and after it starts. The same thing happens at the end of the song. Link to the file.
Conclusion: while the modulator works fine in the clean smooth digital world, conversion to analog seems quite perilous as jitter or reference noise will fold HF noise back in to the audio band, negating noise shaping efforts.
Last time I substracted the original file at 88.2k and the upsampled-DSDencoded-downsampled file, and that was quite noisy.
This time I used sox to upsample the audio at 2.8224Msps (64Fs) and saved the file as 32-bit float. I encoded it as DSD. Then I substracted the 64Fs original file and the DSD file, and downsampled the result to 88.2k. Link to file.
Note all these diff files have gain, it is in the filename.
Results are completely different: there is much lower noise, the residual is a low amplitude high-pass filtered version of the original. I have tested various delays and can confirm the files are aligned, so it is not a comb filtering effect. It must be due to the DSD filters not being completely flat, so a difference in frequency response would explain this.
The difference with the previous noisy experiment must come from the high amount of noise upsetting the resampler, or something of the sort. That's quite worrying actually.
In any case, the substraction between the DSD stream and the upsampled audio does not sound distorted... so I'm going to decide this DSD encoder is clean enough.
I then simulated various amounts of jitter and voltage reference noise. Even a small amount does cause a lot of HF noise to fold back into the audio band. An interesting result was with 705600Hz (16Fs) sine wave modulating the analog reference by 0.028%. The idea is a bit of noise coming out of the digital filter. This folded back some noise in the output, which is modulated and sounds different during the almost-silence before the song starts, and after it starts. The same thing happens at the end of the song. Link to the file.
Conclusion: while the modulator works fine in the clean smooth digital world, conversion to analog seems quite perilous as jitter or reference noise will fold HF noise back in to the audio band, negating noise shaping efforts.
How about a constant offset of 0.002 as the signal and 1.4112 MHz reference ripple? That should convert the main idle tone to the audio band, if they didn't do anything to prevent that.
I did a spectrogram instead, over the whole bandwidth (0-1.44MHz). This corresponds to the beginning of the Rebecca Pidgeon track, which contains only very low amplitude noise. The scale should be in V^2/Hz.
The audio band is at the bottom, and it is suitably dark. However, the higher frequencies contain structured noise, with what looks like a frequency modulated tone. So, any noise frequency modulating the analog reference (or clock jitter) will fold back a portion of this into the audio band, which results in the modulated noise that is audible on the difference file I posted earlier.
I am going to try various DC offsets now.
The audio band is at the bottom, and it is suitably dark. However, the higher frequencies contain structured noise, with what looks like a frequency modulated tone. So, any noise frequency modulating the analog reference (or clock jitter) will fold back a portion of this into the audio band, which results in the modulated noise that is audible on the difference file I posted earlier.
I am going to try various DC offsets now.
Here are the spectrograms for a range of DC offsets. Structured noise is definitely there, with a FM tone in the middle. It looks quite neat when flipping through the pictures. So it is a big failure for this encoder.
https://peufeu.fr/audio/dsd_6_spectrogram_dc.zip
Marcel, here is the python source code. It is quite simple, just loading the raw DSD file and using the spectrogram function. You could use it on your modulator, just by adapting the IO. I'm curious to see if your multibit approach gets rid of these tones.
https://peufeu.fr/audio/dsd_6_spectrogram_dc.py
https://peufeu.fr/audio/dsd_6_spectrogram_dc.zip
Marcel, here is the python source code. It is quite simple, just loading the raw DSD file and using the spectrogram function. You could use it on your modulator, just by adapting the IO. I'm curious to see if your multibit approach gets rid of these tones.
https://peufeu.fr/audio/dsd_6_spectrogram_dc.py
How about a constant offset of 0.002 as the signal and 1.4112 MHz reference ripple? That should convert the main idle tone to the audio band, if they didn't do anything to prevent that.
No offset, here it is playing music. But look at the top of the spectrum! It looks like the music is encoded in the noise or something. Modulating this with half the sampling frequency, as you suggest, should be interesting. It's just like having 32*Fs noise frequency on VREF.
Here is the result. It is still aligned, so you can play it along with the original file.
Basically I just multiplied the DSD signal by (1,-1,1,-1...). So if you want to know what a 0.01% ripple on VREF sounds like, scale this to 0.01% and listen to it or add it to the original song. (spoiler: it's atrocious)
https://peufeu.fr/audio/05 Grandmother.flac-derivative.flac <--- WARNING: this one is full scale, so lower the volume a lot!
Conclusion (and back to OP's topic which we kinda hijacked):
1) If the sigma delta DAC's output noise is modulated, its performance and associated distortions will be heavily dependent on analog implementation, as any HF noise or jitter will fold the modulated noise back into the audio band (but everyone knew that already). So it is not possible to simulate it with code and call it a day.
2) All 1-bit modulators will modulate the noise. Multibit modulators that output PWM, not necessarily. I'm interested in a spectrogram from the output of Marcel's encoder.
1) If the sigma delta DAC's output noise is modulated, its performance and associated distortions will be heavily dependent on analog implementation, as any HF noise or jitter will fold the modulated noise back into the audio band (but everyone knew that already). So it is not possible to simulate it with code and call it a day.
2) All 1-bit modulators will modulate the noise. Multibit modulators that output PWM, not necessarily. I'm interested in a spectrogram from the output of Marcel's encoder.
No surprise about jitter (and Vref sensitivity). Please see AMD slide attached below regarding DSD verses PCM. PCM has its downside too as the slide indicates. Basically, both 16/44 and DSD64 are flawed formats. DSD doesn't start sounding good until its DSD256 or higher. It means the noise shouldn't start rising until around 80kHz or so.
To reproduce DSD well, clocking design and Vref design matter a lot. In the end if done well it usually sounds better than PCM. Its the best way I have found to reproduce CDs (upsample to 24/192 and DSD encode).
Also, if you want to measure noise you might try the freeware, open source Japanese DSD encoder I linked to earlier. The graphs show it has pretty good looking noise shaping (and how sox compares). https://pcmdsd.com/Software/PCM-DSD_Converter_en.html ...Maybe helpful to use Chrome browser with language translation enabled 🙂
To reproduce DSD well, clocking design and Vref design matter a lot. In the end if done well it usually sounds better than PCM. Its the best way I have found to reproduce CDs (upsample to 24/192 and DSD encode).
Also, if you want to measure noise you might try the freeware, open source Japanese DSD encoder I linked to earlier. The graphs show it has pretty good looking noise shaping (and how sox compares). https://pcmdsd.com/Software/PCM-DSD_Converter_en.html ...Maybe helpful to use Chrome browser with language translation enabled 🙂
Attachments
Last edited:
+1 for "no surprises"
Hmm... At first I thought "wow noise is very low" then I checked again, and no matter what I do, both 32 bit and 64 bit versions of PCMDSD, no matter what wav file I use (decompressed flac music, generated wav with DC)... this software outputs a DFF file that contains only a header and then just zeros. All silent. So there is no signal... and no noise.
If you really want to try it, and if the software works on your computer, can you encode the following wav in DSD64 and pass it on? It contains a sequence of DC levels.
https://peufeu.fr/audio/dsd_8_wav_dc.zip
Hmm... At first I thought "wow noise is very low" then I checked again, and no matter what I do, both 32 bit and 64 bit versions of PCMDSD, no matter what wav file I use (decompressed flac music, generated wav with DC)... this software outputs a DFF file that contains only a header and then just zeros. All silent. So there is no signal... and no noise.
If you really want to try it, and if the software works on your computer, can you encode the following wav in DSD64 and pass it on? It contains a sequence of DC levels.
https://peufeu.fr/audio/dsd_8_wav_dc.zip
Hmmm... Tried converting a couple of files to DSD256, a real music file and the DC file. Hexedit doesn't look to be showing all zeros. Haven't tried to play either one on a dac yet.
Converted DC file is in my Dropbox: https://www.dropbox.com/s/p1pbgpzj5pzm0y2/dsd_8_wav_dc_DSD256.dff?dl=0
EDIT: Don't know if it makes any difference, but I highlighted the file I wanted to convert and hit 'Run." Settings shown in attached pic. Its the 64-bit version.
Converted DC file is in my Dropbox: https://www.dropbox.com/s/p1pbgpzj5pzm0y2/dsd_8_wav_dc_DSD256.dff?dl=0
EDIT: Don't know if it makes any difference, but I highlighted the file I wanted to convert and hit 'Run." Settings shown in attached pic. Its the 64-bit version.
Attachments
Last edited:
Thanks!
The noise spectrograms look a lot more civilized with this encoder, but this is DSD256, not comparable to the previous one which was DSD64. Here are the plots:
https://peufeu.fr/audio/dsd_8_spectrogram_PCMDSD-DSD256-dc.zip
The noise spectrograms look a lot more civilized with this encoder, but this is DSD256, not comparable to the previous one which was DSD64. Here are the plots:
https://peufeu.fr/audio/dsd_8_spectrogram_PCMDSD-DSD256-dc.zip
Last edited:
Out of curiosity I made some real-life measurements using Markw4's cymbal recording. I used a loopback of AK4490 and ES9822PRO so I played the file with AK4490 and re-recorded the result with ES9822PRO.Aside: Regarding the study of transients, from an audio reproduction perspective the waveform of a cymbal can be considered an extended transient response event starting with an impulsive attack. It is too complex too understand very well in the frequency domain (and something most dacs aren't very good at reproducing). A sample cymbal hit I recorded for forum use: https://www.dropbox.com/s/6j0di4eo3tqgind/Cymbal 24-192.wav?dl=0 Please note the file contains some ultrasonic content. ...Also, perhaps the sound could be played backwards for use as a settling time measurement impulse? Some DAW programs can perform time reversal of a wave file (an effect sometimes used in pop music).
Here is a waveform of original recording and the re-recording. The original was resampled to 32-bit float as my USBI2S board uses 16/32-bit depth.
There is some strange low-level noise (or DC offset) in the original recording after the transient.
Here is close-up showing samples at the beginning of transient.
So actually the transient is not very steep.
Here is a spectrum of original recording.
I assume that the stuff below 400Hz is not from cymbal.
And the spectrum of the re-recording.
Finally I inverted the re-recording and mixed it with the original to produce a difference.
Highest peak between 400Hz-30kHz is at -88.2dB. I assume the stuff below 400Hz is some noise in original recording.
Regarding the cymbal recording, the mic was a Schoeps CMC641. The CMC6 body FR is rated up to around 26 kHz as used, the capsule itself could go higher. From there it was amplified by a Grace Designs M101 preamp. Preamp output was digitized by an RME ADI-2 using its internal clock. SPDIF output from the RME went into a Focusrite Scarlett 6i6 USB recording interface sync'ed to the RME clock. The recording level was adjusted to allow plenty of headroom so as to avoid any potential clipping (nominally about -18dBFS peak as indicated on the RME). One particular hit was then edited out for sharing, although it wasn't especially the one with the highest peak level.
https://schoeps.de/en/products/colette/microphone-amplifiers/cmc-6.html
https://schoeps.de/en/products/colette/capsules/supercardioids/mk-41.html
https://gracedesign.com/products/microphone-preamplifiers/m101
https://schoeps.de/en/products/colette/microphone-amplifiers/cmc-6.html
https://schoeps.de/en/products/colette/capsules/supercardioids/mk-41.html
https://gracedesign.com/products/microphone-preamplifiers/m101
Last edited:
- Home
- General Interest
- Everything Else
- How we perceive non-linear distortions