• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Digital filter "game"

OP
B

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
But was that the case with the Mahler sample where all software clipped except SoX? Unfortunately the source DSD file is not available on the blog any longer.
No, clipping on the Mahler was caused by the implicit PCM gain settings in Saracon and DSD Master. Glitches caused by DSD overloading won't show up as a vertical line straight through the spectrogram because DSD glitches caused by this will be filtered by the PCM low pass filter, you can't easily see it in the spectrogram. If you listen to it or looking at the waveform you can find them much easier.
 

hyperknot

Active Member
Joined
Aug 17, 2019
Messages
260
Likes
166
I see. So if I manually used no gain setting in those programs that clipping wouldn't have happened. And the price of this is 23 bit of resolution instead of 24 bit right?
 

hyperknot

Active Member
Joined
Aug 17, 2019
Messages
260
Likes
166
What is the reason that you used pipes with your command? Was it because the dsd build was old and sox was an up-to-date version?

I'm trying the new SoX builds from https://audiodigitale.eu/repo/sox/ and I'd like to try to make it a single command, but I cannot make it. I thought that -p is for pipe, but if I remove it then it breaks.
 

hyperknot

Active Member
Joined
Aug 17, 2019
Messages
260
Likes
166
The DSD-capable SoX executable that mansr posted does not support flac encoding and spectrogram generation. If there is an all-in one executable then piping is not needed.
The non-windows builds from the above link are from 2021 and it seems to support everything. My only problem is that I cannot figure out the command line. Where should "rate" go? In gopts, fopts infile, fopts outfile or effects?

This doesn't work:

soxdsd -V sample.dsf rate -b 74 -v 88200 sample_sox1.flac
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,703
Location
Hampshire
Something like this should work: sox in.dsf -b 24 out.flac rate -v 88200
 

hyperknot

Active Member
Joined
Aug 17, 2019
Messages
260
Likes
166
Oh, you've already answered. And how do I specify `-f hq` or similar on this?
 

pLudio

Member
Forum Donor
Joined
Dec 8, 2020
Messages
95
Likes
86
Location
Sweden
sox -SV4 in.dsf --bits 24 -C 8 out.flac rate -uL 88.2k gain 6 dither -S

@mansr may have a better suggestion for the dither. -u is the secret ultra quality.
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,703
Location
Hampshire
There's no need for dither with 24-bit output since there's enough noise already in the source.
 
OP
B

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
Yes. I have expected comment like this as there are always different camps of people say 24-bit dither is needed or not, just like somewhere else people are talking about is it necessary to use WAVEFORMATEXTENSIBLE or not for a 24/96 file if it is only stereo.

IMO, in the case of generating 24-bit test signal to test something, then I will use dither.
 

hyperknot

Active Member
Joined
Aug 17, 2019
Messages
260
Likes
166
I see. So the same way trying to determine the right gain at encoding is also silly, as it's just best to leave it without gain and use RG in player, isn't it? So basically no gain, no dither on real world music.

-b 74 is the only question I'm left with.
 

pLudio

Member
Forum Donor
Joined
Dec 8, 2020
Messages
95
Likes
86
Location
Sweden
The FLAC specification allows 20 bit files but it is unfortunately not yet implemented. We can limit the data to 20 bits anyway and save some space.

sox -SV4 in.dsf --bits 24 -C 8 out.flac rate -uL 88.2k gain 6 dither -S -p 20

Saved me 35% on a file.
 
OP
B

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
The FLAC specification allows 20 bit files but it is unfortunately not yet implemented. We can limit the data to 20 bits anyway and save some space.

sox -SV4 in.dsf --bits 24 -C 8 out.flac rate -uL 88.2k gain 6 dither -S -p 20

Saved me 35% on a file.
The same simulation I did in one of the posts on the first page:
 
OP
B

bennetng

Major Contributor
Joined
Nov 15, 2017
Messages
1,634
Likes
1,693
I see. So the same way trying to determine the right gain at encoding is also silly, as it's just best to leave it without gain and use RG in player, isn't it? So basically no gain, no dither on real world music.

-b 74 is the only question I'm left with.
-b 74 is the lowest allowed setting on the rate effect. Depends on the target sample rate, it will for example, remove some audible frequency if your target is 44.1k, but for example at 88.2k it won't, and the removal of extra frequency (DSD noise) can reduce file size as well.

Also, if 24-bit dither is useless, than rate -u is useless as well. The added filter length and attenuation are placebo anyway.
 

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,703
Location
Hampshire
Yes. I have expected comment like this as there are always different camps of people say 24-bit dither is needed or not, just like somewhere else people are talking about is it necessary to use WAVEFORMATEXTENSIBLE or not for a 24/96 file if it is only stereo.
One of those things is a matter of mathematics, the other about an ill-defined file format. Only the latter is really up for debate.

IMO, in the case of generating 24-bit test signal to test something, then I will use dither.
If generating a synthetic signal with no noise, sure. A DSD source will always have noise well above the 24-bit level.
 
Top Bottom