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

De-emphasis components

Plugins to do de-emphasis of pre-emphasized CDs:
* Postprocessing (foo_deemph): works only with lossless sources; always active during playback and ReplayGain scan.
* DSP plugin (foo_dsp_deemph): works with any source


* To de-emphasize a track, add a tag named PRE_EMPHASIS or PRE-EMPHASIS with a value 1, on or yes. Other tracks are unaffected.
* There's no reason to use both components at the same time.
* Don't use both foo_deemph and foo_dsp_effect (the latter has its own de-emphasis postprocessor).
* Note that even foo_dsp_deemph works only when a track is tagged: just adding it to the list of active DSPs is not enough to make it work.

Changelog:
0.1.1
- recompiled with latest SDK (2018-10-11). Works with foobar2000 1.4.x; users of 1.3.x need to download and install MSVC redist (here).

De-emphasis components

Reply #1
Nice.

* Don't use both foo_deemph and foo_dsp_effect (the latter has its own de-emphasis postprocessor).


Assuming that I turn off the de-emph of foo_dsp_effect: Are there any incompatibilities which prevents me from using foo_deemph for the EQ (say, for the sake of the more extensive tagging support) and still have foo_dsp_effect installed?

De-emphasis components

Reply #2
I should deprecate deemphasis support and just get people to use lvqcl's component.

or update mine to use the tags dbpowerAMP uses...

De-emphasis components

Reply #3
Why another component? Mudlord already had a nice solution!

De-emphasis components

Reply #4
Why another component?


It is even another two, facilitating choice between DSP and post-processing.  (Is that an answer? ;-)

I guess users may diverge on a “one module for each task” philosophy and “one wonder-do-it-all” philosophy – it strikes me that since HDCD is treated different (reading the actual audio first, and then deciding whether to process), there is not going to be any tags-based “foo_fix_weird_CDs_dsp”.

De-emphasis components

Reply #5
it strikes me that since HDCD is treated different (reading the actual audio first, and then deciding whether to process), there is not going to be any tags-based "foo_fix_weird_CDs_dsp".


I didn't quite understand that - do you mean there is yet another plugin which can do de-emph automatically?

De-emphasis components

Reply #6
it strikes me that since HDCD is treated different (reading the actual audio first, and then deciding whether to process), there is not going to be any tags-based "foo_fix_weird_CDs_dsp".


I didn't quite understand that - do you mean there is yet another plugin which can do de-emph automatically?


Ah, me meandering randomly away. No, there are a couple of effects I enable permanently while playing CD rips (because CD rips is something I like to keep bitperfect), and that is HDCD correction and de-emphasis. From an end-user point of view (my end-user point of view, I'd have to add), it makes more sense to have these separate from that component I only need when I process file-->file (which I would do with RIAA correction on a vinyl rip or Dolby on a tape rip).

De-emphasis components

Reply #7
Assuming that I turn off the de-emph of foo_dsp_effect: Are there any incompatibilities which prevents me from using foo_deemph for the EQ (say, for the sake of the more extensive tagging support) and still have foo_dsp_effect installed?

If you have a lossless track with PRE_EMPHASIS tag equal to 1 then it will be processed twice: with foo_deemph and with foo_dsp_effect. Not a good thing.

Why another component? Mudlord already had a nice solution!

The main reason for me: foo_dsp_effect adds several entries into the list of available DSPs. I prefer to have only one column in this list: it's much simpler to select a particular DSP in this case. (I already removed official EQ but it wasn't enough)

De-emphasis components

Reply #8
Assuming that I turn off the de-emph of foo_dsp_effect: Are there any incompatibilities which prevents me from using foo_deemph for the EQ (say, for the sake of the more extensive tagging support) and still have foo_dsp_effect installed?

If you have a track with PRE_EMPHASIS tag equal to 1 then it will be processed twice: with foo_deemph and with foo_dsp_effect. Not a good thing.


Certainly, but foo_dsp_effect has other features that may be useful if its de-emphasis filter is disabled. I take it to mean that you don't know any technical incompatibilities (and my fb2k hasn't crashed while testing).

 

De-emphasis components

Reply #9
But end users might not want the extra DSPs, like reverb/echo/bass boost/pitch shifting.

De-emphasis components

Reply #10
But end users might not want the extra DSPs, like reverb/echo/bass boost/pitch shifting.


That is kinda my point. Your component does jobs I actively choose for processing files.
HDCD and de-emphasis OTOH, I apply to playback streams without altering files, in the background without my interacting.
So to me it makes sense to enable your DSP precisely when I need it, and otherwise keep it out.

But by all means keep the deemphasis in. There is no reason to take that one out of a do-it-all DSP component.

De-emphasis components

Reply #11
I just tested with a sine sweep, generated with SoX like this:

Code: [Select]
sox -b 16 -r 44100 -c 2 -n output.wav synth 40 sine 0:22050 gain -6

In foobar2000, I tagged the resulting WAV with PRE_EMPHASIS=1, then used the converter with various settings to produce de-emphasized output files. I then looked at the frequency analysis curves in Audition (Blackmann-Harris, FFT size 32768, linear scale, zoomed in a bit).

These all produce output that is, for all intents, identical to that of WaveEmph:
  • foo_deemph
  • foo_dsp_deemph
  • foo_convolve (auto level adjust disabled) with the [a href='index.php?showtopic=76191']Wombat impulse[/a]
  • foo_convolve (auto level adjust disabled) with the lvqcl SoX impulse

However, foo_dsp_effect (with the "CD de-emphasis" IIR filter preset enabled) is shockingly wrong. It only boosts the bass, resulting in quite a bit of clipping and aliasing. It's not even close to being correct. Did I do something wrong?

De-emphasis components

Reply #12
foo_dsp_effect postprocessing service vs. SoX:



If you want to use foo_dsp_effect de-emph IIR DSP filter then you should select the last option: "High shelf" (some bug in its code, apparently). Also, there should be no PRE_EMPHASIS tag in the file.
But even without this bug, foo_dsp_effect curve is noticeably steeper.

De-emphasis components

Reply #13
Something else of note: foo_convolve results in more samples output than were input. With input of 1,764,000 samples, the Wombat impulse produces 1,765,376, and the SoX impulse produces 1,764,032.

So at this point, I can only recommend WaveEmph, SoX, foo_deemph, or foo_dsp_deemph.


De-emphasis components

Reply #15
Oh, thanks...that did the trick. All is well with foo_dsp_convolve.

De-emphasis components

Reply #16
Quickly glanced at the code: https://github.com/FauxFaux/foo_mudlord/blo.../iirfilters.cpp
Seems basically the same as biquad filter implementation of SoX, but is using sqrt(A + A) instead of 2 * sqrt(A) in SoX.

BTW doesn't fb2k read "FLAGS PRE" in cuesheet? It would be nice if fb2k reads it as metadata, and this plugin could be applied to it.

De-emphasis components

Reply #17
thank you for alerting me to the bugs, I really should rewrite iirfilters.cpp

De-emphasis components

Reply #18
I forgot to say thanks for keeping tag support the same as in mudlord's component, so thanks for that!

De-emphasis components

Reply #19
How good is the de-emphasis applied by the foo_deemph.dll compared to "sox deemph"? Can anybody judge this? Thanks in advance!


De-emphasis components

Reply #21
I'm just eyeballing graphical frequency-analysis plots of deemphasized sine wave sweeps, but foo_deemph and SoX deemph overlap nearly perfectly. And they're still within a few hundredths of a dB of the output of WaveEmph. I don't know which is closer to the ideal, but they're so close, it doesn't matter. The analog components that do the deemphasis in real CD players probably result in even greater variation.

De-emphasis components

Reply #22
just tested with some preemphasis CDs and works like a charm - many thanks for this great and very valuable foobar-component!

De-emphasis components

Reply #23
With mudlord's new DLL I'm getting the same result as before. "CD De-emphasis" IIR Filter preset results in a massive bass boost, no attenuation.

De-emphasis components

Reply #24
needs rewriting i suppose. people can use lvqcl's dsp in the meantime.

or: mudlord.info/temp/foo_dsp_effect.zip