SSRC icon indicating copy to clipboard operation
SSRC copied to clipboard

2.4.0: --minPhase causes 7dB level drop + long processing

Open gee-ell opened this issue 2 months ago • 14 comments

Windows 2.4.0 binaries 96k / 64bit float input file:

ssrc.exe --rate 48000 --bits 24 --dither 98 --pdf 1 --profile insane %1 "%outfile%"

processes quickly and produces correct output.

(except output is generally too long in 2.4.0, see https://github.com/shibatch/SSRC/issues/30)

but adding --minPhase with the same input gives a crazy long processing time, and the resulting level is reduced by exactly 7db:

ssrc.exe --rate 48000 --bits 24 --dither 98 --pdf 1 --profile insane --minPhase %1 "%outfile%"

gee-ell avatar Dec 05 '25 19:12 gee-ell

I'll look into this, but the algorithm used in SSRC to convert arbitrary FIR filters to minimum phase isn't particularly numerically stable compared to others. As a result, it seems the expected output isn't being produced when used with the extreme configuration of the insane profile. This may be somewhat unavoidable, so users may have to accept it.

The slow processing when using the minimum phase option in the insane profile is due to the algorithm being slow. This is unavoidable.

shibatch avatar Dec 06 '25 03:12 shibatch

ah, I assumed minimum phase would be faster than a long FIR.

however the level drop persists in long and high, so that's not insane specific.

gee-ell avatar Dec 07 '25 13:12 gee-ell

The paper's interpretation is difficult in that it doesn't seem to describe how to properly calculate the correct volume level. In the implementation, the volume level is being forced to match.

shibatch avatar Dec 07 '25 13:12 shibatch

I'll try adjusting the volume matching method a bit more.

shibatch avatar Dec 07 '25 13:12 shibatch

Actually, I'd like to ask: Is the minPhase option necessary? What are you using this option for? If you plan to use it in a real-time application, please tell me what kind of use case you have in mind.

shibatch avatar Dec 07 '25 13:12 shibatch

I don't know the math, but once you have the filter(s) calculated, can you eg. run a full-scale signal through and use that to normalize its output level?

gee-ell avatar Dec 07 '25 13:12 gee-ell

btw, the level drop does change on my test file based on the profile. examples (measured in integrated LUFS):

insane: -7.0 dB high : -5.1 dB long : -5.5 dB

gee-ell avatar Dec 07 '25 13:12 gee-ell

Actually, I'd like to ask: Is the minPhase option necessary? What are you using this option for? If you plan to use it in a real-time application, please tell me what kind of use case you have in mind.

me personally, I'm using it only to off-line master music. so I was wondering if it has a different sound in any significant way, ie. no pre-ringing. I don't know if it matters for this, but as the option is there I wanted to compare.

gee-ell avatar Dec 07 '25 13:12 gee-ell

in music mixing/mastering, a lot of people prefer minimum phase EQs for example as it sounds more natural due to the pre-ringing of linear phase. but some people prefer linear phase as it's 'sharper', ie. smears less.

I don't know if this matters for a brickwall filter near nyquist, but it's possible that minimum-phase does produce a slightly more natural sound.

gee-ell avatar Dec 07 '25 14:12 gee-ell

Regarding normalization, that's basically how it's done already.

I'd like to add EQ functionalities to the SSRC library, not just a resampler.

shibatch avatar Dec 07 '25 14:12 shibatch

there must be a bug somewhere then.

EQ would be great to have in the library. I once looked for an EQ library, and while at the time there was some cool stuff out there, it was incomplete, buggy etc. saying that, I haven't looked for a while as I dive in and out of programming sporadically (I do music and visuals mostly).

gee-ell avatar Dec 07 '25 14:12 gee-ell

I'm thinking it might be fun to create VST2 plugins too. I understand there are already EQ plugins with minimum phase and partitioned convolution, but if I made one, would people actually use it?

shibatch avatar Dec 07 '25 14:12 shibatch

I don't know. there are a lot of EQ plugins out there, so a new angle or feature would help. At the high end you have Pro-Q4, and the Kirchhoff EQ (which I use) that do minimum, linear, 'natural' phase, various hybrids, dynamic EQ etc.

One thing I'd personally like for mixing is the idea of 'spectral contrast', where an EQ shape, say a bell, has two small opposite dips at either end. The idea is that we notice a boosted or cut freq range more if the surrounding freqs do the opposite. A lot of people do this manually (with extra small bells), but it's tedious.

I recently started to research this (partially), and it seems there are filter algorithms that do this naturally. if you had a seperate control for the 'contrast opposites', that would be a great workflow.

gee-ell avatar Dec 07 '25 14:12 gee-ell

It sounds like the filter length is too short. I think using a sufficiently long minphase filter should solve the problem.

shibatch avatar Dec 07 '25 14:12 shibatch