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 37208 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

De-emphasis: sharing some results

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


The frequencies there have indeed a very low amplitude, however, when I used Audacity with the ISO EQ curve, it still could cut them according to the purple curve.

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

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

That is what is claimed. Not what you've checked yourself. According to the 16384 FFT size (which is quite accurate, most people are happy with a 2048 FFT size) SoX actually lets the original file untouched somewhat above 20,5kHz. (spectrum is the same as the pre-emphasized file above that frequency). Unless I used a wrong command to process the files with SoX (see first post), there is nothing amiss.

Edit: I have been reading this (well, not everything) http://audacity.238276.n2.nabble.com/FIR-a...s-td247427.html

I remember reading some people used Foobar2000 convolver to convolve the song and the impulse reponse (finite or not?) of the appropriate filter so as to de-emphasize. FIR EQ is apparently implemented with a convolution as well, but not sure what it tells you. Same about the phase reponse.

This looks quite interesting as well http://www.dspguru.com/dsp/faqs/fir/properties

"FIR filters are usually designed to be linear-phase (but they don't have to be.) A FIR filter is linear-phase if (and only if) its coefficients are symmetrical around the center coefficient, that is, the first coefficient is the same as the last; the second is the same as the next-to-last, etc. "

De-emphasis: sharing some results

Reply #26
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.


I don't know what newer CD players do for de-emphasis but my old ones use an analog RC network.  Component tolerances can easily hit a 1 dB error. 1% resistors are easy to get. 1% capacitors, not so much. Just for my education. how many pre-emphasis titles are out there? I own 2 OLD ones.


De-emphasis: sharing some results

Reply #27
Just for my education. how many pre-emphasis titles are out there? I own 2 OLD ones.


http://www.stevehoffman.tv/forums/showpost...mp;postcount=48

Taken from this whole thread:

http://www.stevehoffman.tv/forums/showthread.php?t=121188

Have fun  . Pre-emphasis mostly concerns very first pressings (most of them being as a result Japan's) and some recent Classical stuff apparently.

De-emphasis: sharing some results

Reply #28
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.


*inserts shameless plug *

SoX implements it as a IIR filter. I implemented the same filter coefficients into foo_dsp_effect's IIR filter.
In addition, it can be used in a audio decode post processor service, so appropriately tagged lossless sources
automatically get deemphasised in realtime.

De-emphasis: sharing some results

Reply #29

That is what is claimed. Not what you've checked yourself. According to the 16384 FFT size (which is quite

No, this is what is claimed: "its maximum deviation from the ideal response is only 0.06dB (up to 20kHz)"; performance above 20kHz is not specified.

I, today, generated the above graph (which confirms the claimed figure), and read off the figure at 22050Hz.  This is a mathematical analysis of the performance of the filter and as such, is free of experimental error.

Were I to wish to perform an experiment to verify the performance (and of course I/we at HA have done so in the past) , I'd choose a simple one such as this:

Generate a sweep:
  sox -r 44100 -n input.wav synth 22.05 sin 0:22050

Apply the filter:
  sox input.wav output.wav deemph

Load the output into a GUI tool, zoom in to read off the level at various points (the time axis is also the frequency in kHz), and check against an independently published list of attenuations.


De-emphasis: sharing some results

Reply #30
I don't know what newer CD players do for de-emphasis but my old ones use an analog RC network.  Component tolerances can easily hit a 1 dB error. 1% resistors are easy to get. 1% capacitors, not so much. Just for my education. how many pre-emphasis titles are out there? I own 2 OLD ones.


On the Stereophile homepage you´ll find several tests with de-emphasis. There are some that are even much more off!
Some are nearly perfect, like the one of one Revox. Some that archive high accuracy may use a real RC network still with tolerance selected parts. Most seem to use the build in DAC routines and these vary a bit also from DAC to DAC.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #31
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.

Just for the record, SoX also uses a high-shelf filter design, from here.

De-emphasis: sharing some results

Reply #32
SoX implements it as a IIR filter. I implemented the same filter coefficients into foo_dsp_effect's IIR filter.
In addition, it can be used in a audio decode post processor service, so appropriately tagged lossless sources
automatically get deemphasised in realtime.


I'm so glad you brought this to my attention - I had no idea it was already possible to tag music as pre-emphasised, then have them decoded on the fly with the accuracy of SoX.

You've just saved me 2gb of space and more importantly made me a happy man!!

De-emphasis: sharing some results

Reply #33
This is a mathematical analysis of the performance of the filter and as such, is free of experimental error.


The point is, deemphasizing is experimental, I mean, you output files with a different spectrum. You can't basically assert "here is the mathematical formula that is supposed to be applied, I'll draw how it performs, hence we will be sure that the whole processing of quantified samples (nothing is continus, whether being time or amplitudes) is indeed the same". That is nonsense, you cannot plot a continous fonction of the frequency and compare it that much to "the few" calculations that will actually be made by any existing software.

Were I to wish to perform an experiment to verify the performance (and of course I/we at HA have done so in the past) , I'd choose a simple one such as this:

Generate a sweep:
  sox -r 44100 -n input.wav synth 22.05 sin 0:22050

Apply the filter:
  sox input.wav output.wav deemph

Load the output into a GUI tool, zoom in to read off the level at various points (the time axis is also the frequency in kHz), and check against an independently published list of attenuations.



I did, and checked both the time domain and the frequency domain (though being redundant indeed, see the picture beneath for the latter), and SoX apparently de-emphasized up to the Shanon frequency for that file. Audacity's and SoX's frequency curves match precisely by the way.

What stroke me however was that the sweep was a 32bits which leads me to wonder why there is such a difference on the 16bits song, which can't but very partly be explained by quantification.



(Difference is in green, one curve hides the other which is basically the same.)

EDIT: When zoomed quite a lot, you can indeed spot the differences, here they are, and they match closely the theoretical error of SoX (the very last point corresponds to 22047Hz).


De-emphasis: sharing some results

Reply #34
It seems that FFT size = 16384 is too much: the SoX/Audacity curves are too jagged.

De-emphasis: sharing some results

Reply #35
I wavered on that, but the trend of the curve is still there. By calculating less points (say 4096 FFT), you can miss some inflexions, I have no clue what's the best compromise  . Could it be that it is supposed to be jagged and that we are not used to it because fewer points smooth dramatically the curve?

De-emphasis: sharing some results

Reply #36
I wavered on that, but the trend of the curve is still there. By calculating less points (say 4096 FFT), you can miss some inflexions, I have no clue what's the best compromise  . Could it be that it is supposed to be jagged and that we are not used to it because fewer points smooth dramatically the curve?

The sox curve is supposed to be smooth as butter. The Audacity EQ curve has some unregularities on the transitions of the several equalizing points.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #37
I wavered on that, but the trend of the curve is still there. By calculating less points (say 4096 FFT), you can miss some inflexions, I have no clue what's the best compromise  . Could it be that it is supposed to be jagged and that we are not used to it because fewer points smooth dramatically the curve?

The sox curve is supposed to be smooth as butter. The Audacity EQ curve has some unregularities on the transitions of the several equalizing points.


Not really, the EQ obviously smooths the equalizing points. Not to mention SoX and Audacity's curve match perfectly, either on the song (below 20kHz) or the sweep (all the way), save Audacity doesn't have the very slight error SoX has since I've found a curve similar to the theoretical error curve SoX by substracting Audacity to SoX, meaning Audacity has even less error with the custom EQ curve, as for the amplitude at least...

The only tumbling block is the behavior of the filter above 20kHz with the 16bits song.

De-emphasis: sharing some results

Reply #38
You gotta disable dithering in both Audacity and sox, then you'll see the resulting FR is smooth in both cases. 

I doubt you'll notice a difference between linear (like the Audacity EQ) and min phase here.
"I hear it when I see it."

De-emphasis: sharing some results

Reply #39
I even took me the time to paste your EQ curve to Audacity and applied it to a pre-emphasized sweep and indeed the sox curve is smooth as butter while the Audacity EQ curve has several unregularities. Much zoomed in of cause, so not audible.

Edit: added pic. Zoom is the same on both. Guess what comes from sox



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

De-emphasis: sharing some results

Reply #40
As Wombat pointed out, my instructions for to calculate pre-emphasis filter coefficients did not give proper filter so, I re-wrote that part of my instructions.

Does difference in smoothness come from type of filter (buffer (FFT) vs sample accurate (IIR))?

Juha

De-emphasis: sharing some results

Reply #41
Just for my education. how many pre-emphasis titles are out there? I own 2 OLD ones.


http://www.stevehoffman.tv/forums/showpost...mp;postcount=48

Taken from this whole thread:

http://www.stevehoffman.tv/forums/showthread.php?t=121188

Have fun  . Pre-emphasis mostly concerns very first pressings (most of them being as a result Japan's) and some recent Classical stuff apparently.


Oh dear, I just looked at the list and found I have 3, not 2 pre-emphasis discs. I'm embarrassed I missed Lionel Richie. The ones I knew were Maynard Furguson 'Storm' and (gasp) Whitney Houston's first CD


De-emphasis: sharing some results

Reply #42
@ xnor: Do you mean as regards the 16bits song? Because no dithering should be applied when processing the 32bits sweep (at least in Audacity the EQ is calculated on a 32bits resolution basis, which is already the resolution of the input wav sweep and the output wav). But that might be the case as for the song, might it not?

I even took me the time to paste your EQ curve to Audacity and applied it to a pre-emphasized sweep and indeed the sox curve is smooth as butter while the Audacity EQ curve has several unregularities. Much zoomed in of cause, so not audible.

Edit: added pic. Zoom is the same on both. Guess what comes from sox

):

  • Audacity

    [a href="http://imageshack.us/photo/my-images/834/audacitysweep.png/" target="_blank"][/url]
  • SoX

    [url=http://imageshack.us/photo/my-images/59/soxsweep.png/][/url]


Frequency domain with a 4096FFT size and a Hanning window:

  • Audacity:

  • SoX:

De-emphasis: sharing some results

Reply #43
(I believe I shouldn't edit because there are quite different results, but a moderator can merge the posts if needed.)

Ok guys, here are some fresh results about a TDSOTM song ("The Great Gig In The Sky" so that we have two songs all in all), there is definitely something amiss when exporting to a 16bits song by any method above 20kHz. The only method that seems to de-emphasize (as for amplitudes) properly above the alleged audible domain is when using a 32bits output.

xnor seems right about dither as well when it has to be done, namely when you export anything to a lower resolution than the one that's been used to apply the filter.

It looks like SoX uses very little or no dither. 16bits FLAC files were indeed exactly the same size (not counting any octet though  ) SoX (deemph command use, no settings changed whatsoever): 19,8 Mo, Audacity 16bits no dither: 19,8 Mo as well. Audacity 16bits shaped dither: 20,6 Mo.

Graphs are self-explantory:

  • Different de-emphasized files minus the original pre-emphasized file:
  • SoX's minus Audacity's ones:
  • SoX's minus Audacity's ones, same zoomed within the audible range:





De-emphasis: sharing some results

Reply #44
As Wombat pointed out, my instructions for to calculate pre-emphasis filter coefficients did not give proper filter so, I re-wrote that part of my instructions.


Thanks! It is working fine now
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #45
Ever wondered that Audacity maybe isn´t the best thing for doing highly accurate analysis?

So please if any Moderator is reading here, i think it is time to kick this thread to the Recycle bin

The thread starter only proved that pasting existing values into the Audacity Equalizer works. The rest imho is only unfounded claims with senseless graphs proving nothing.

Reading that one makes me think there are missing some fundamentals:
This is a mathematical analysis of the performance of the filter and as such, is free of experimental error.


The point is, deemphasizing is experimental, I mean, you output files with a different spectrum. You can't basically assert "here is the mathematical formula that is supposed to be applied, I'll draw how it performs, hence we will be sure that the whole processing of quantified samples (nothing is continus, whether being time or amplitudes) is indeed the same". That is nonsense, you cannot plot a continous fonction of the frequency and compare it that much to "the few" calculations that will actually be made by any existing software.

The facts bandpass delivers are spot on and show that sox works 100%
"the few" calculations... Huh!?

I don´t like the idea that some people read in here and get the impression sox is doing wrong because of some misleading pics.

Alternatively you may rename the thread to:

"I discovered the mysterious world of audio editors and have to share some funny pics"

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

De-emphasis: sharing some results

Reply #46
On sox deemph.h was mentioned an ideal filter (gnu plot source code for ideal/fitted comparison).
I added both ideal filters into my VST project file.

Magnitude comparison (200Hz->):

Ideal de-emphasis curve vs fitted curve:




Ideal pre-emphasis curve vs fitted curve:




Juha

De-emphasis: sharing some results

Reply #47
The rest imho is only unfounded claims with senseless graphs proving nothing.

You are joking, right? You've posted pictures, yes funny pictures with no axis at all, is that analysis? Come on man, you don't seem to know much how to present results and you're claiming I've posted "misleading pics". You're demanding this thread be delated while you've done nothing but claim "there is no problem" even though you simply never explain any behaviour.

You are a very funny guy, to say least, you come and post a strange picture with no scale whatsoever and say: "see, this one looks cool, this one doesn't", that's hilarious, to say the least.

You even came saying "hey SoX files are bigger because it uses super dither", while you hadn't actually noticed that Audacity's were the bigger ones. You read half of what you see and talks nonsense without any arguments, or explanation.

I'm quite rude, yeah, but this is just staggering that there are people like you asking for a thread to be delated because they don't bother explaining anything because they believe they are the Gods and can only say "I don't like this".

Alternatively you may rename the thread to:

"I discovered the mysterious world of audio editors and have to share some funny pics"


That is so disrespectful, but we might be even now.

De-emphasis: sharing some results

Reply #48
On sox deemph.h was mentioned an ideal filter (gnu plot source code for ideal/fitted comparison).
I added both ideal filters into my VST project file.

Magnitude comparison (200Hz->):

Ideal de-emphasis curve vs fitted curve:
Ideal pre-emphasis curve vs fitted curve:


The ideal curve seems a bit odd for my taste. 1dB difference at 20kHz.

Edit: Most likely the fitted curve was the best compromise already and was obviously tested. The so called ideal curve for my taste is to much off. We should leave it at the fitted one.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

De-emphasis: sharing some results

Reply #49
The ideal curve seems a bit odd for my taste. 1dB difference at 20kHz.

I think that what has happened here is that coefficients for a filter designed to run at 441k have been used with a filter running at 44.1k, hence the error.

As you suggest above, despite good intentions, this thread has suffered from a lack of rigour which could mislead future readers.