Jump to content
IGNORED

Analyzing files for clipping


joelha

Recommended Posts

how exactly do you analyze multiple files (i.e album worth) using SOX? I mean I realize you can do one wav (or Flac) at a time (I've successfully done that, yeah!) but to do all of them to get a peak for the album, how does one combine? I saw a little of your description earlier, but it seems doing

sox songname.wav tracks.wav

is an example that shows only one songname.wav file. Sorry for being thick. :)

 

Is this what I should do?

sox song1.wav song2.wav song3.wav tracks.wav

 

and the resultant file is called "tracks.wav" and is actually the whole album? is it ok to have spaces in the file name (my file names are pretty long, with track - artist - album - title)

 

Link to comment

No problem Ted, I wasn't born with the knowledge either ;)

 

You're on the right track and I in fact already mentioned the procedure for multiple files. Essentially you are concatenating the files and analyzing the resulting file (which is one long file containing the whole album) with the tools in SoX. This can be done in one single command if all the files are of the same format and present in a folder with no other audio files to be analyzed. So, place all tracks of the album (say as WAV files) in a folder with nothing else in it, cd to the folder in your terminal of choice and run the following:

 

sox '*.wav' -n stats

 

The '*.wav' part means that SoX should take every file ending in wav (the '' prevent errors due to spaces in files) and concatenate them. The -n part means SoX should not generate any output file (you just want to analyze it, not save it). The final stats part means SoX should analyze the "resulting" file (which due to -n is not being saved to an actual file on your disk!) and print the results. Of course if you have FLAC files you just replace '*.wav' by '*.flac'. I hope this helps, let me know if there's any issues with that.

 

P.S.: And yes, if you (for some other reason) indeed want to combine multiple files to one long file you just run

 

sox file1.wav file2.wav file3.wav long.wav

 

if you want to select the files manually, or the following if you have many files in a given folder:

 

sox '*.wav' long.wav

 

 

 

Listening Room: ALIX.2D2 (Voyage MPD) --> Arcam rDAC --> Marantz PM-15S2 --> Quadral Wotan Mk V

Drinking Room: ALIX.2D2 --> M2Tech hiFace 2 --> Cambridge Audio Azur 740C --> Rotel RC-06/RB-06 --> B&W XT4

Home head-fi: Grado SR80i, Sennheiser HD 650

On the go head-fi: Sennheiser IE 8

Link to comment

Sik,

 

I realize I might be asking for too much of the software here, but is there a way to set up Sox to analyze the files of multiple albums at one time, separating out the results by album?

 

At least in this way a fairly time consuming process could be worked on overnight by the computer.

 

Joel

 

 

 

Link to comment

If you are willing to use Korg Audiogate for converting your DSDIFF tracks to PCM (*.wav or *.flac, stereo only of course!), it is as easy as it could be, because Audiogate has a feature to scan the tracks before doing the conversion.

 

Just go to "Export"

--> "Edit"

--> "Normalize"

and set it to "Current Songlist selection (avg. level)"

 

It then will scan the selected tracks (usually the whole album) and perform an analysis before converting it to PCM.

The actual value of the gain setting will be displayed after the scan has finished, and the conversion process has started.

 

It hasn't failed on me since I use it, so I bet this is quite save to use it ;-)

 

Cheers

Harald

 

Esoterc SA-60 / Foobar2000 -> Mytek Stereo 192 DSD / Audio-GD NFB 28.38 -> MEG RL922K / AKG K500 / AKG K1000  / Audioquest Nighthawk / OPPO PM-2 / Sennheiser HD800 / Sennheiser Surrounder / Sony MA900 / STAX SR-303+SRM-323II

Link to comment

too broad and kills dynamics and leaves a sonic signature too. I disliked the sound when I tried it on one album. Maybe i have it set wrong.

 

Edit: I will try an album (Peter Gabriel, UP-SACD) and post the three sox results (normalized, -6db test, manually adjusted based on test results) and ask those who can understand these numbers (other than peak which is all I used) tell me if normalize looks to be doing anything other than simple gain adjustments. If not, then I stand corrected and will use normalize as it reduces steps from manually running -6db test, sox analysis, etc.

 

So here are the sox results (jpeg attached for easier viewing):

 

NORMALIZED ALBUM

Overall Left Right

DC offset -0.000000 -0.000000 0.000000

Min level -0.974473 -0.969758 -0.974473

Max level 0.978299 0.978299 0.977946

Pk lev dB -0.19 -0.19 -0.19

RMS lev dB -14.21 -14.29 -14.13

RMS Pk dB -5.92 -5.93 -5.92

RMS Tr dB -60.97 -60.44 -60.97

Crest factor - 5.07 4.98

Flat factor 0.00 0.00 0.00

Pk count 2 2 2

Bit-depth 24/24 24/24 24/24

Num samples 706M

Length s 4003.000

Scale max 1.000000

Window s 0.050

 

-6.0 DB TEST

Overall Left Right

DC offset -0.000000 -0.000000 0.000000

Min level -0.505556 -0.503110 -0.505556

Max level 0.507542 0.507542 0.507358

Pk lev dB -5.89 -5.89 -5.89

RMS lev dB -19.91 -19.99 -19.83

RMS Pk dB -11.62 -11.63 -11.62

RMS Tr dB -66.67 -66.14 -66.67

Crest factor - 5.07 4.98

Flat factor 0.00 0.00 0.00

Pk count 2 2 2

Bit-depth 24/24 24/24 24/24

Num samples 706M

Length s 4003.000

Scale max 1.000000

Window s 0.050

 

MANUALLY ADJUSTED GAIN TO -0.2DB

Overall Left Right

DC offset -0.000000 -0.000000 0.000000

Min level -0.985757 -0.980987 -0.985757

Max level 0.989627 0.989627 0.989270

Pk lev dB -0.09 -0.09 -0.09

RMS lev dB -14.11 -14.19 -14.03

RMS Pk dB -5.82 -5.83 -5.82

RMS Tr dB -60.87 -60.34 -60.87

Crest factor - 5.07 4.98

Flat factor 0.00 0.00 0.00

Pk count 2 2 2

Bit-depth 24/24 24/24 24/24

Num samples 706M

Length s 4003.000

Scale max 1.000000

Window s 0.050

 

 

Link to comment

Is the -6 dB test something where you actually set *-6 dB*, or is it unadjusted SACD data. If it is the unadjusted SACD data, then it is interesting that the peak level is at -5.89 dB for each track.

 

Some SACDs exceed the spec maximum level. Which may cause PCM-converting players that apply fixed 6 dB gain to clip. That's why it's good idea to either apply smaller gain or no gain at all.

 

I personally don't see much point in maxing out the PCM level if target is 24 or 32 bits.

 

 

Signalyst - Developer of HQPlayer

Pulse & Fidelity - Software Defined Amplifiers

Link to comment

Mike in MD, the -6db test in Audiogate is the same as setting Saracon to 0.0db (i.e no gain added). (Note: The result was the largest peak for the playlist, not the peak for every song!) You set it to -6.0Db in order to see your useable headroom. If you set it much higher (say 0.0db default) you wouldn't know how much room you have (cuz clipping tops out at 0.0db peak, no positive numbers).

 

My negative comments earlier re: normalize might well have been setting it to do each song rather than whole album, or something else messed up. The whole album setting does appear to be benign, as per Miska's comments.

 

Thanks.

 

P.S. Miska, what do you mean about not max'ing gain for 24 bit? Wouldn't more gain (i.e to within.1 or .2db of 0.0) give you better s/n or a maximum transfer? Albums like Miles' KOB SACD are so low that a -6db safe test produces a peak of like -8.2db. Seems a waste to transfer that low. Waveform looks like a flat line.

 

Link to comment

P.S. Miska, what do you mean about not max'ing gain for 24 bit? Wouldn't more gain (i.e to within.1 or .2db of 0.0) give you better s/n or a maximum transfer? Albums like Miles' KOB SACD are so low that a -6db safe test produces a peak of like -8.2db. Seems a waste to transfer that low. Waveform looks like a flat line.

 

Yes, it gives that roughly 6 dB better SNR, but the practical impact is rather small when comparing the resulting SNR with SNR of the recording. And some DACs give the lowest distortion between -10 and -20 dBFS. If you look at the waveform in logarithmic scale it is still high level.

 

So, IMO, it may not be worth the trouble, except for some recordings that stay far below the -6 dB peak level. OTOH, there shouldn't be too many recordings that exceed this spec level and cause clipping in conversion with 6 dB gain. Leaving that Miles' peaking at -2.2 shouldn't be any practical loss.

 

P.S. I'm using 6 dB gain in playback conversion, but have not seen clipping indicator getting active.

 

 

Signalyst - Developer of HQPlayer

Pulse & Fidelity - Software Defined Amplifiers

Link to comment

I have been testing about 40 of my ripped-to-DIFF albums and a majority of them peak higher than -5db (usually around -4db) when the Audiogate setting is -6db. IOW, if I left them at A-gate's default (0db) they would clip almost 2 db worth of peaks off!! Am I doing something wrong to reach this conclusion? I hear you, Kevin and others say "don't worry about it" but it seems very many SACD's that I'm transferring would easily clip in PCM if I left Audiogate at it's 0.0db setting (which is analogous to Saracon's +6db default setting). To me that seems worth the trouble, but I admit my math or perspective could be wrong.

 

Link to comment

My understanding of SACD conversion from discussions with Jared was that audio engineers *automatically* add (he claimed) 6 dB of gain. So, if your SACD is typical, then there will automatically be clipping on all these blind conversions.

 

By specification, SACD has max -6 dB DSD level. Most SACDs follow this standard and that's why many of the hardware DSD->PCM converters apply fixed 6 dB gain to reach 0 dBFS PCM level so that you don't notice level difference between SACD and CD/BD.

 

Then there are some small number of SACDs that exceed that -6 dB level. These then end up clipping...

 

So most won't clip, some minority would.

 

My strategy has been to use 6 dB gain until I encounter material that exceeds the spec level and then switch off the gain for that particular piece. (Even though it would be handled by a soft limiter so it would most likely go unnoticed.)

 

My point was that I don't see it worth the trouble to make micro adjustments to reach exactly 0.0 dBFS PCM level.

 

 

Signalyst - Developer of HQPlayer

Pulse & Fidelity - Software Defined Amplifiers

Link to comment

I have been testing about 40 of my ripped-to-DIFF albums and a majority of them peak higher than -5db (usually around -4db) when the Audiogate setting is -6db. IOW, if I left them at A-gate's default (0db) they would clip almost 2 db worth of peaks off!! Am I doing something wrong to reach this conclusion?

 

For sure that's a problem. Either you have some bad luck with your SACDs or then exceeding the spec is much more typical than I thought. I'm even more surprised if those are sourced from PCM material, since then it would have been easy to avoid by re-running the conversion. But as/if Audiogate has working album normalization, it solves the problem nicely.

 

If you have Saracon, do you get similar results with it too?

 

does not clip 2 db peaks off is not a "micro adjustment" in my book

 

Sure it's not micro adjustment that way around. I meant more like the one that had -8.2 dB peak, running it at 6 dB gain would be just fine from my perspective, instead of tuning it for exactly 0.0 dB target. Leaving a bit of headroom can be actually good thing with some DAC chips.

 

As I said in another post, my strategy has been to use 6 dB gain by default and re-run with 0 dB if any clips were encountered during conversion. (even though most of my conversions are on-the-fly while listening, so I don't re-run in those cases, I just drop the volume)

 

 

Signalyst - Developer of HQPlayer

Pulse & Fidelity - Software Defined Amplifiers

Link to comment

Does anyone know if the PS Audio DLIII can handle DFF files?

 

Chris

 

Headphones: ZMF Atrium Closed, ZMF Bokeh, Audeze LCD-X, Meze 109 Pro, Focal Clear Mg, Noble Katana IEMs, Dan Clark Aeon 2 Closed
Amp/DAC: Decware MKIII Tube Amp, ZMF Homage, Schiit Bifrost 2/64, Woo Audio WA8, Burston Playmate 2, Mytek DSD192 DAC, Cayin RU7, Chord Mojo, Fiio M11 Plus DAP
Cables: Promitheus XLR Interconnects, WyWired red cables, Meze Silver, ZMF 6.35 ofc and 4 pin xlr stock, Arctic Cable, Audio Envy Cable balanced, balanced Silver Interconnects
Other: Aurender N100H, Macbook Pro (2023) running Audirvana Studio

Link to comment

There aren't many. EMM, Playback Designs, Mytek, dCS line (announced), twisted pear DIY DACs, and some other professional studio gear. However, several chips have the capability and if the dCS idea gains traction maybe DACs that use chips like ESS Sabre will be retrofitted.

 

Link to comment

So, when I play the DFF files through Audirvana is it being converted to PCM?

 

Headphones: ZMF Atrium Closed, ZMF Bokeh, Audeze LCD-X, Meze 109 Pro, Focal Clear Mg, Noble Katana IEMs, Dan Clark Aeon 2 Closed
Amp/DAC: Decware MKIII Tube Amp, ZMF Homage, Schiit Bifrost 2/64, Woo Audio WA8, Burston Playmate 2, Mytek DSD192 DAC, Cayin RU7, Chord Mojo, Fiio M11 Plus DAP
Cables: Promitheus XLR Interconnects, WyWired red cables, Meze Silver, ZMF 6.35 ofc and 4 pin xlr stock, Arctic Cable, Audio Envy Cable balanced, balanced Silver Interconnects
Other: Aurender N100H, Macbook Pro (2023) running Audirvana Studio

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...