Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: De-emphasis: sharing some results (Read 36587 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

De-emphasis: sharing some results

Hello,

As many before, I've been looking for the "best" digital de-emphasis method so as to listen to my music properly on my computer.

I've compared the resulting files of three de-emphasis methods applied to the song "Ecplise" of The Dark Side Of The Moon - Japan Harvest Black Face (Matrix: CP353017 10A1).

    Audacity with a custom EQ curve based on the ISO 908 standard, originally posted by foobar2000[/li]

I've applied the following curve to the FLAC rip of Ecplise with its pre-emphasis untouched, with a 32bits resolution on Audacity before exporting to 16bits FLAC:
Code: [Select]
<curve name="De-Emphasis">
<point f="510.000000000000" d="-0.100000000000"/>
<point f="726.000000000000" d="-0.200000000000"/>
<point f="896.000000000000" d="-0.300000000000"/>
<point f="1042.000000000000" d="-0.400000000000"/>
<point f="1173.000000000000" d="-0.500000000000"/>
<point f="1294.000000000000" d="-0.600000000000"/>
<point f="1408.000000000000" d="-0.700000000000"/>
<point f="1516.000000000000" d="-0.800000000000"/>
<point f="1620.000000000000" d="-0.900000000000"/>
<point f="1720.000000000000" d="-1.000000000000"/>
<point f="2188.000000000000" d="-1.500000000000"/>
<point f="2629.000000000000" d="-2.000000000000"/>
<point f="3064.000000000000" d="-2.500000000000"/>
<point f="3506.000000000000" d="-3.000000000000"/>
<point f="3965.000000000000" d="-3.500000000000"/>
<point f="4449.000000000000" d="-4.000000000000"/>
<point f="4968.000000000000" d="-4.500000000000"/>
<point f="5534.000000000000" d="-5.000000000000"/>
<point f="6159.000000000000" d="-5.500000000000"/>
<point f="6861.000000000000" d="-6.000000000000"/>
<point f="7664.000000000000" d="-6.500000000000"/>
<point f="8605.000000000000" d="-7.000000000000"/>
<point f="9739.000000000000" d="-7.500000000000"/>
<point f="11157.000000000000" d="-8.000000000000"/>
<point f="13029.000000000000" d="-8.500000000000"/>
<point f="15708.000000000000" d="-9.000000000000"/>
<point f="20128.000000000000" d="-9.500000000000"/>
<point f="21427.000000000000" d="-9.600000000000"/>
</curve>


    SoX 14.3.2 using the deemph command line[/li]

Code: [Select]
FOR %%A IN (*.flac) DO sox "%%A" "%%A.flac" deemph


    Audacity with a
full EQ curve based on the ISO 908 standard[/li][/list]
The first EQ curve I took from foobar2000 (see first point) isn't actually complete, and though the two following frequencies are not anymore within the audible frequency range, they should be added (at least the first one) on a theoretical point view, to help filtering the frequencies between 21427Hz and 22050Hz (Shanon's frequency).

Code: [Select]
 <point f="30195.000000000000" d="-10.00000000000"/>
<point f="96000.000000000000" d="-10.40000000000"/>


I actually added them because I found out that the first Audacity EQ curve gave me more treble in the very upper range (though that's not the one you can really hear, dogs are happier about that ) than SoX.


[blockquote]The results are as follows:

[a href="http://imageshack.us/photo/my-images/269/deemphasistdsotm.png/" target="_blank"] :SoX de-emphasized minus Audacity de-emphasized with the complete EQ curve.[/li][/list]

Short and unpretentious analysis plus a few comments:

The graph is self-explanatory to me. SoX algorithm and calculation are fairly good when compared to the custom EQ curve based on the ISO 908 standard I used in Audacity. I guess it does use 32bits to EQ the curve before exporting to 16bits relying on the accuracy of the plots, in a nutshell, exaclty what Audacity did. Nevertheless, you can notice that SoX does not go as far as the ISO based complete EQ curve de-emphasis method, according to the very upper treble it left (well above 20kHz, TDSOTM pre-emph minus SoX TDSOTM de-emph ~ 0dB).

It should also be noted that the Audacity's files have a 15kbps higher average bitrate than the SoX's files, both using 8 level FLAC .
Both have average bitrates which are more or less 50-65 kbps lower than the pre-emphasized files, there's no wonder about that however.

Regarding sonics? Huh, they actually sound pretty much the same (all the de-emph's I mean  ), if not exactly, and even though my mind tells me that the Audacity full curve de-emphasized method sounds slightly better, I'm deeply convinced it all boils down to the graphs for us lesser mortals.

What will I use? Audacity with the full EQ curve. Firstly because this method shows a more consistent theoretical performance, and also because it's more convenient to use: you can do batch de-emphasis and 16bits FLAC exporting of several files quite simply (using included scripts "editor", ask if needed).



Feel free to comment or point out anything wrong  .


De-emphasis: sharing some results

Reply #2
Sorry, I loathe iTunes and any Apple audio related thing (whether being earburds, iNoise, or softwares). Not to mention iTunes is even more dreadful on Windows, I'm not going to install it again (I haven't done so in years thankfully). Let alone the Apple crap software updater  ...

Nevertheless, I remember reading somewhere that there is a 1dB thing going around, can't remember if it was an allegedly error or anything. I'm not trying it anyhow, it might do a nice job but regarding that the Audacity curve theoretically improved SoX's work which sounds nice already...

De-emphasis: sharing some results

Reply #3
I don´t know if finding the correct curve should be done with a song. Here i did some: http://forums.slimdevices.com/showpost.php...mp;postcount=37
These pics are strongly zoomed and are +-0.05dB off, not more. With these same reference files iTunes dipped -1dB.
I don´t like the idea to use tons of linear filters. Sox biquad filter must be the the nearest approach or simply use a HighShelf filter like i do with the EQ plugin in the thread i linked. These mimik the original analog filter best.
The foobar convolver impulse was taken from a single HighShelf also afaik.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #4
The Audacity full EQ curve that has been used is based on the values the original analog filter should take as far as I know.


De-emphasis: sharing some results

Reply #6
The graph is self-explanatory to me. SoX algorithm and calculation are fairly good when compared to the custom EQ curve based on the ISO 908 standard I used in Audacity. I guess it does use 32bits to EQ the curve before exporting to 16bits relying on the accuracy of the plots, in a nutshell, exaclty what Audacity did. Nevertheless, you can notice that SoX does not go as far as the ISO based complete EQ curve de-emphasis method, according to the very upper treble it left (well above 20kHz, TDSOTM pre-emph minus SoX TDSOTM de-emph ~ 0dB).

t should also be noted that the Audacity's files have a 15kbps higher average bitrate than the SoX's files, both using 8 level FLAC .
Both have average bitrates which are more or less 50-65 kbps lower than the pre-emphasized files, there's no wonder about that however.


Sox uses even 64bit internal precision and adds dither for a 16bit output. This dither of cause needs space on encoding and explain the differences in filesize.
Were do you know how accurate your ISO 908 curve is more accurate as sox when inserted in the Audacity EQ!? Please prove this.

..my mind tells me that the Audacity full curve de-emphasized method sounds slightly better...


Please tell me how to evaluate sound quality of a music file you don´t have a reference file without pre-emphasis? Besides that you should offer samples and a nice abx result exactly here.



What will I use? Audacity with the full EQ curve. Firstly because this method shows a more consistent theoretical performance, and also because it's more convenient to use: you can do batch de-emphasis and 16bits FLAC exporting of several files quite simply (using included scripts "editor", ask if needed).


Well, using around 30! filter settings in an equalizer isn´t the best idea even when it is a so called linear phase one. Each filter adds some so called ringing and maybe defects used in that small steps behind. I don´t know about how that happens but did read about several times.

If it sounds worse in the end? Don´t know.


The Audacity full EQ curve that has been used is based on the values the original analog filter should take as far as I know.

Still no one knows how accurate these are when inserted and applied in Audacity.

Here were already some thoughts about applying de-emphasis, it includes my iTunes testcurve http://www.hydrogenaudio.org/forums/index....hl=waveemph+sox
Even there the used Denon reference curve only has an accuracy of +- 0.1dB So any implemantation in a studio is most likely more off.
When a recording is done in our digital time age the chances are high pre-emphasis is applied with a plugin like the Waves EQ and its preset, another highshelf with yet another response curve
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #7
http://sox.sourcearchive.com/documentation..._8h-source.html

I prepared a VST plug-in based on coefficients listed there.

Here are some measures done with Hermaan Seib's VST plugin Analyzer.

http://www.hydrogenaudio.org/forums/index....showtopic=90368

Juha


Looking forward to that plugin! Based on the sox Biquad it really should do the trick!
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #8
First of all, to make some things clear: I'm not claiming I'm using the best method that ever existed.

I've only been sharing some computations I've been doing for myself, but as I had the curve on hand, I thought it might by handy for other people as well.

Quote
Sox uses even 64bit internal precision and adds dither for a 16bit output. This dither of cause needs space on encoding and explain the differences in filesize.

Audacity's files were the bigger ones, I don't understand your point otherwise. Feel free to explain a little more.

Quote
Please tell me how to evaluate sound quality of a music file you don´t have a reference file without pre-emphasis? Besides that you should offer samples and a nice abx result exactly here.

When quoting someone, please quote the full sentence, here it is:
Quote
even though my mind tells me that the Audacity full curve de-emphasized method sounds slightly better, I'm deeply convinced it all boils down to the graphs for us lesser mortals.


As you can see I didn't bother posting any ABX log because I didn't any. That was an "on the fly"comment. As I've already said, the files sounded "pretty much the same, if not exactly". This was followed by some kinf of humour underlining that my mind was teased by the graphs.

Quote
Were do you know how accurate your ISO 908 curve is more accurate as sox when inserted in the Audacity EQ!? Please prove this.


What I do know is how the curve has been calculated, the SoX process is all mystery and we have no access to the EQ values, nevertheless, they both showed a nearly identical curve, save SoX does not go up to 22050Hz, and stops somewhat above 20kHz, which is the only reason why I prefer to use Audacity added to the fact that it's more convenient to me. I'm not saying there's a substantially more accurate curve below 20kHz since they are very very fairly similar.

Quote
Still no one knows how accurate these are when inserted and applied in Audacity.

Audacity processes files with a 32bit resolution.

De-emphasis: sharing some results

Reply #9
Quote
Sox uses even 64bit internal precision and adds dither for a 16bit output. This dither of cause needs space on encoding and explain the differences in filesize.

Audacity's files were the bigger ones, I don't understand your point otherwise. Feel free to explain a little more.


Ok, i didn´t read carefully but filesizes may be different because of such things like different dither from the applications themself. Here shouldn´t be any correlation to quality.

Besides that i answer that nasty because every now and then someone enters here or a completely different discussion disposing his best sounding de-emphasis setting with some software.
Of cause you didn´t claim it directly, but on a sidenode.

Search also shows that there are several other threads disussing that. No need for another one imho.

Edit:
I may be completely wrong and this thread was really worth it if Juha really offers a VSt plugin now. So in future we simply can link to that
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #10
Ok, i didn´t read carefully but filesizes may be different because of such things like different dither from the applications themself. Here shouldn´t be any correlation to quality.


You were aggressively pointing out that the files were bigger because of better quality, anyhow, I'm not taking it.

Search also shows that there are several other threads disussing that. No need for another one imho.


More feedbacks is no bad thing to me, as I've already said, I did this for myself first and it didn't took me much more time to upload a few images on ImageShack and to add a few comments. My title is "sharing some results", take it or leave it, it can't hurt to have other calculations and show that SoX doesn't go up to the Shanon frequency while sharing similar results with the other method below 20kHz, that's all.


Regarding the VST plug-in, I know Audacity supports them, but I have not tried anything yet, if I have some time, well .

De-emphasis: sharing some results

Reply #11
Ok, i didn´t read carefully but filesizes may be different because of such things like different dither from the applications themself. Here shouldn´t be any correlation to quality.


You were aggressively pointing out that the files were bigger because of better quality, anyhow, I'm not taking it.


I didn´t. No word about better quality because of the size. I only suggested that sox uses 64bit internal precision since you guessed it uses 32bit. Be it 32bit or 64bit shouldn´t matter.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #12
SoX doesn't go up to the Shanon frequency while sharing similar results with the other method below 20kHz

SoX uses a biquad filter (matched to the ISO spec) which of course has a response across the entire band; however the filter is optimised to minimize the phase & amplitude error in the audible band.  In other words, above 20k, the error may be a little more that what is specified in the audible band.

The last time I checked, Audacity was using a large FIR for deemph, i.e. with very different phase response to what it should be.

Wavemph's response was based on that of the Denon CD and matches it very well; however, the Denon CD is slightly off spec.

De-emphasis: sharing some results

Reply #13
I may be completely wrong and this thread was really worth it if Juha really offers a VSt plugin now. So in future we simply can link to that


Hmm... if I give away compiled .dll, would there be some licencing required since base coefficients are lent from others work?

I have a VST plugin .dll with three modes: Pre-emphasis, De-emphasis and bypass.
If there are any licencing required then as an alterantive, I could host instructions over how to build this filter plug-in using SynthEdit software, including project file without coefficients placed.


Juha

De-emphasis: sharing some results

Reply #14
I may be completely wrong and this thread was really worth it if Juha really offers a VSt plugin now. So in future we simply can link to that


Hmm... if I give away compiled .dll, would there be some licencing required since base coefficients are lent from others work?

I have a VST plugin .dll with three modes: Pre-emphasis, De-emphasis and bypass.
If there are any licencing required then as an alterantive, I could host instructions over how to build this filter plug-in using SynthEdit software, including project file without coefficients placed.

I can´t help you with the licensing, sorry.
One thing i noticed in your VST plugin analysis is that there seems to be an additional Highpass. If you added that for filtering some DC it would be nice to be able unticking this option if someone uses the build-in offset correction of his editor.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #15
One thing i noticed in your VST plugin analysis is that there seems to be an additional Highpass. If you added that for filtering some DC it would be nice to be able unticking this option if someone uses the build-in offset correction of his editor.


I suppose HP is build in Analyser ...

OK, here are quickly made instructions for to build a VST filter ... http://jiiteepee.fortunecity.com/ISO908/ISO908.html

Juha

De-emphasis: sharing some results

Reply #16
SoX uses a biquad filter (matched to the ISO spec) which of course has a response across the entire band; however the filter is optimised to minimize the phase & amplitude error in the audible band.  In other words, above 20k, the error may be a little more that what is specified in the audible band.

The error is not "a little more", it's above 9dB, which is quite a lot, even out of the allegedly audible band. (Several sutdio monitors have a frequency reponse up to 30kHz or 50kHz to improve the phase reponse according to them, I don't know if it is pure marketing however.)


The last time I checked, Audacity was using a large FIR for deemph, i.e. with very different phase response to what it should be.


I didn't use any Audacity's "deemph" feature, I used an EQ curve. What's is FIR? (I didn't find anything on Google).

Edit: from what I see on Juha's link http://sox.sourcearchive.com/documentation..._8h-source.html, there's no complex number whatsoever, it looks like everything is amplitude related there.


De-emphasis: sharing some results

Reply #18
The error is not "a little more", it's above 9dB, which is quite a lot, even out of the allegedly audible band. (Several sutdio monitors have a frequency reponse up to 30kHz or 50kHz to improve the phase reponse


I don´t know how you created these pictures you share and i don´t know where sox deemph error should be 9dB? Here is a plot of the sox deemph function up to 22kHz.

Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #19
The error is not "a little more", it's above 9dB, which is quite a lot, even out of the allegedly audible band. (Several sutdio monitors have a frequency reponse up to 30kHz or 50kHz to improve the phase reponse


I don´t know how you created these pictures you share and i don´t know where sox deemph error should be 9dB? Here is a plot of the sox deemph function up to 22kHz.




Self-quote: "I've used a 16384 FFT size to compute the spectrum of the first 1:27 minute of each song.
The curves represent the differences between the pre-emphasized TDSOTM (by and large) and the different de-emphasized songs."

@ Sebastian Mares

Thanks for making explicit the acronym, I didn't think of impulse reponses.

De-emphasis: sharing some results

Reply #20
I don´t want to repeat the things you did and find your error.
So please tell me where is sox 9db off??
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #21
OK, here are quickly made instructions for to build a VST filter ... http://jiiteepee.fortunecity.com/ISO908/ISO908.html
Juha


Thank you very much for this HowTo! De-emphasis works nicely! Many Thanks!
Somehow i still get a weird response for the pre-emphasis. I have to check my numbers. The demo version of Synthedit creates the plugin with Demo printed in the background if anyone wonders. Otherwise there seems to be no limitation.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #22
Thank you very much for this HowTo! De-emphasis works nicely! Many Thanks!
Somehow i still get a weird response for the pre-emphasis. I have to check my numbers. The demo version of Synthedit creates the plugin with Demo printed in the background if anyone wonders. Otherwise there seems to be no limitation.


I updated the instructions since, I forgot to mention the b1 for pre-emphasisi filter needs to be multiplied twice with the given multiplier.

Looks like Jeff have added "Demo" notice after he re-started to maintain/develop the SynthEdit software.

Juha

De-emphasis: sharing some results

Reply #23
Maybe DSOTM just doesn't have frequencies above ~20.5 kHz? That can explain some strange results...

De-emphasis: sharing some results

Reply #24
SoX uses a biquad filter (matched to the ISO spec) which of course has a response across the entire band; however the filter is optimised to minimize the phase & amplitude error in the audible band.  In other words, above 20k, the error may be a little more that what is specified in the audible band.

The error is not "a little more", it's above 9dB, which is quite a lot, even out of the allegedly audible band. (Several

Nonsense—here is the amplitude error across the entire band:

0.06dB in the audible band; 0.175dB above the audible band.

Quote
I didn't use any Audacity's "deemph" feature, I used an EQ curve. What's is FIR? (I didn't find anything on Google).

Audacity's EQ curve is implemented as a large FIR, i.e. with a linear phase response. A deemphasis filter should be a simple IIR.