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: New simple, good sounding multiband compressor available. (Read 77209 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: New simple, good sounding multiband compressor available.

Reply #25
Hello John,

I hope your dolby decoder comes along fine!

You haven't had the time to look into "my project" yet, have you?

Cheers!

Re: New simple, good sounding multiband compressor available.

Reply #26
Hello John,

I hope your dolby decoder comes along fine!

You haven't had the time to look into "my project" yet, have you?

Cheers!

I am totally overloaded on the DolbyA compatible decoder project. Hopefully, the DolbyA compatible decoder program is really starting to be able to satisfy the most critical users, so the pressure might be diminishing a little. might be slowing down in a few weeks.

I have recently been doing some serious rework, where the very advanced 'super RMS' detector (RMS measurement, but lower ripple) didn't emulate HW behavior adequately to reliably properly decode DolbyA encoded material.  I finally gave-up (on my detector which is really good for normal compressors/expanders) and did a precision implementation of the REAL HW detector and nonlinear characteristics (lots of diode equation type stuff), and am now getting robust results.  The emulation is so very precise now, that there is a different mode for the old 301A style DolbyA (the follow-on DolbyAs like the cat22 do act differently from the original 301A), and the results have been stellar (but this breakthrough just happened in the last two days.)

Previously, the decoder was good enough for listeners (really nice in some ways), but didn't emulate the decoding precisely enough for serious recording engineers.   The advanced features still persist (the anti-distortion stuff), but now the front-end emulation is so pristine (becuase the 'diodes' that I am using are perfect, and the design is very clean -- my capacitors in my software are very, very good :-)), that the anti-IMD operations are less critical for providing superior results.

This stuff is 'no-joke' when it comes to tedium and in-some-ways complexity (not really complex, but when starting from scratch, it is not easy.)

With this comment -- trying to explain why I have cannot allow myself to be distracted -- I am intellectually/mentally and emotionally exhausted, yet there is still significant work needed for the decoder (GUI interface for a seperate GUI program -- avoids license encumberances) , and some other things.

I like to do compressors/expanders (I actually prefer intelligent expanders), but I have made promises to deliver great results on the decoder), and it has only been extreme concentration that has helped make as much progress as I have on the project (and sometimes, I know that I haven't done good enough.)

I WILL take a look at making the compressor more flexible when I have time!!! I really want to look at it -- I have some really good ideas for exceptional quality (probably cannot divulge the more advanced stuff from the decoder project, but still have some potentially helpful technology for when I can work on it.)

john

Re: New simple, good sounding multiband compressor available.

Reply #27
jsdyson,
Do you have any updates on the project?
Glass half full!

Re: New simple, good sounding multiband compressor available.

Reply #28
jsdyson,
Do you have any updates on the project?

Actually, yes I have made some upgrades, and some better control of the compression (maximum compression gain/loss -- so that it stops compressing above a certain gain.)  Also, I upgraded it to an intelligent 4 band -- it doesn't over-hype the high end when gains are high, but will compress them if they are too intense (there is a relative threshold setting, for the upper two bands also.)

Made some qualitative improvements -- better attack/release control, and the peak limiter has less distortion -- it can run more deeply with less intrusion in the sound.
The bad news -- the state of the compressor source code still sucks.  I have been working so crazily on the DHNRDS decoder (happens to do a good job of decoding material that is DolbyA encoded) that I haven't been able to focus elsewhere.  I plan to make something -- the new compressor -- available in the Sunday/Monday time frame (30thJul2019) hopefully.  The new decoder work is lightyears beyond my previous attempts (an actual audio professional jumped in to help.)

About the DA decoder:  I am attaching some snippets of some Olivia Newton John (truncated for obvious reasons) -- but the new DA decoder JUST MIGHT someday help to improve the quality of some of those old recordings as distributed through normal channels.  The DA decoder is a pretty raw professional tool, and inexpensive -- but works wonders (at least, in my opinon as it's daddy :-)). * If there is something sentimental, and you already have a copy, and I already have a DolbyA copy -- ill make a copy -- if REALLY desired.  We aren't selling the decoder to consumers (support issues, etc) -- but I am willing to do one-off decodes and even supply a timed-out version gratis if it is really needed by consumers only.  The pros need to go through my project partner and will get better support than I can give (he has a nice manual/etc.)

Here are the snippets:  https://www.dropbox.com/sh/l9vjbst22duw0ua/AACR2MGVhBeVfA286gUSEXnAa?dl=0

Re: New simple, good sounding multiband compressor available.

Reply #29
Give me another day to make the compressor available.  It is all written/debugged (well, you know what I mean.)  I'll package it up -- forgot, have to build a Windows version, so it will take time anyway.  I'll allocate time tomorrow to complete the build on Windows.

John

Re: New simple, good sounding multiband compressor available.

Reply #30
This new version of the compressor tends to sound better and the limiter works more cleanly.  However, the source code is just as ugly as before.  It is now 4 bands with good managment of gain differences between bands.  The compressor usually doesn't sound very obtrusive at all.

It is okay to use the compressor itself and the source code in any legal way -- if you happen to sell something derived directly from this code, just mention me as someone who helped.  I don't reserve any rights to the code -- use it at your whim -- just be a good citizen.

It compiles directly under the cygwin environment (actually written on Linux.)

Most trivial usage is very simple command line:

> comp-win --inp=infile.wav --outp=outfile.wav --cratio=2.0 --thresh=6.0
(Be careful using any new program like this -- there is nothing intentionally bad in it.)
(adding the --info=10 switch allows you to see the second by second progress of the processing.)

Also attached is a sketchy 1 page guide about the available command line switches and mentions various behavioral options.
There are NO attack/release adjustments, the compressor will generally adjust attack/release as effectively as a user can.
It is audio-RMS based detection, not EE-RMS style, so it is as inobtrusive as a simple compressor can be.

If you have questions, I'll try to answer them, but please read the sketchy guide first.  Also, make sure that the .dll files are in your path (or sitting next to the program binary.)  This will normally be true if you unpack the program into the 'comp2' directory as it normally would do.  A standard Windows install is NOT used, this is NOT a professional product,  doesn't even qualify as a good hobby quality product -- but it works, and might even show some interesting/useful programming techniques, even for a veteran C++ programmer (very SIMD centric.)  Even by my own hackery standards, the code is ugly -- sorry -- what could I do in a few hours.  This note and quick ref guide took longer to write than the cobbled together source code!!!

The program has only be tested on a feeble ATOM Windows laptop (other than the original Linux development), and appears to work.

I you want to use a simple compressor, and have FULL CONTROL over it -- you have the source code with this program, and might be a start to modify for different bands, etc.  The architecture IS limited to 4 bands without more than a few simple changes, but could easily be changed for fewer bands or change the frequencies.

Good luck!!! (you'll need it :-)).


Re: New simple, good sounding multiband compressor available.

Reply #31
Does your linkwitz-riley filters use allpass IIR to give flat frequency response when summing all bands together?

Re: New simple, good sounding multiband compressor available.

Reply #32
I simply use 2nd order filters that when summed together result in a flat response.  Of course, as the gains change, then there can be odd effects -- but really don't hurt -- the freq response is all over the place with multiband.  Since the bandpasses are soft (moderately low Q except the LF bad which purposefully has a high Q for the same reasons as DolbyA), and the bands are separated by subtraction, there isn't a really bad problem.  If you listen, the effects of the filters aren't all that obvious except for the expected bandpass effects.  One more thing -- the gain variations are restricted in a way that the phasing isn't a problem -- even if it was a problem.

I did consider using the multiple butterworth trick, and it IS a cool trick, but I didn't do it.  There was absolutely no reason for such a sharp cutoff, and the phasing issues aren't very severe.  (Listen to any proper DolbyA encoded/decoded process -- I used the same scheme.)*  The sharp cutoff of 4th order is more problematical, and only a few dB of separation between bands is needed anyway.  You can take the code in agcfilters.h, and implement two 2nd order with Q=0.707 for each band, and get the tight separation, but my experiments show no advantage, and the tight bandpass actually shows a disadantage except for the very low frequencies.  The lower Q around 0.500 (I did goose up the Q a little) is the same as a Bessel for 2nd order -- close to linear phase.  I didn't hear any bad effects up to the full single order Butterworth Q=0.707.

* If you listen to undecoded DolbyA -- probably 2/3 of the material that was recorded before 1990, but on digital -- giving that often described 'harsh' digital effect, that is UNDECODED DolbyA -- people never complain about the phasing, but just the boosted highs (I also notice the flattened stereo space.)  I can at least compare decoded and undecoded material because of the ability to decode the too common 'feral' DolbyA material.

Interestingly, on my DolbyA compatible decoder, I use linear phase filters for the high frequencies, where the phase mismatch between my linear phase and the HW standard low Q filters hasn't caused any notice or complaints, except with the better control of errant peaks by the linear phase version of the input filters (well, I did use the Q=1.170 for the 74Hz filter as in a true DolbyA because of the need to emulate the weird phase shifts there -- otherewise the gain vs. freq at LF because really weird BECUASE OF THAT HIGH Q.) 

Using the multiple butterworth scheme might keep errant peaks from happening, but with my comparison with DolbyA HW and my SW implementation -- I haven't seen that being a terrible problem -- just noticeable, with my scheme sometimes giving about 1dB extra peak headroom.

John

Re: New simple, good sounding multiband compressor available.

Reply #33
One more thing -- If I was to do the compressor over again, I would have used FIR linear phase filters throughout (my goals didn't include realtime play), but like in the DHNRDS DA decoder, the input/output files would be time synchronized (the play-time compressor doesn't do that -- it is a toy,  the DA decoder is NOT a toy.)   Also, I wouldn't have used the same kind of RMS detector, but a different technology based on Hilbert transforms, but yielding the same general results -- and NO RIPPLE.  When/if I ever did a professional calibre compressor -- I still have about 5 NR decoders to do first -- it would be different in a lot of ways, but still use the same SIMD techniques.  If I didn't use SIMD on the DA decoder, it would be much slower.
My own work -- when focusing on perfection, is REALLY crazy perfect (ask my project partner.)  You would not believe the modulation products from the fast gain control that I figured out how to cancel.  Most people in the field would claim that it is impossible (I'd expect that Orban hasn't figured this one out, well maybe just him/his company), but the modulation products are REALLY combed out really well on the DA.  I would do the same kinds of techniques on the compressor -- it would be faster, yet not produce the typical 'too-fast' attack/release distortions.
I haven't worked out the details on the conversion from the DA to a compressor, but I can give some hints if interested.  There WILL be some papers on it in the future.  (The DA decoder produces infinitely more clean results than DolbyA HW does because of the advanced DSP techniques -- especially obvious on vocal chorus -- individual voices are maintained instead of a blob like so common on material like ABBA!!!)

If you are interested in the advanced techniques not used by the toy compressor, I am certainly willing to give hints.  Most of them use Hilbert transforms and in some cases, a kind of iterative technique.  I don't think that a normal compressor would need the heroic techniques used to improve DolbyA emulation behavior (really fast release times in the 30msec range -- produce lots of modulation products that don't really sound *bad*, but lots of detail is lost.)


Re: New simple, good sounding multiband compressor available.

Reply #34
Why you use hilbert transform at all? Isn't that just giving you 90deg phase shift? Do you use FIR or IIR filters for that? Do you use decorrelators?

Re: New simple, good sounding multiband compressor available.

Reply #35
I have some major improvements for the multiband compressor -- it really was meant as a toy.
ADD-ON:  the poor-mans mastering code in the DHNRDS provide a much better 1 band, 2 band 3 band compressor, and also a limiter and anti-sibilance capability.  In a year or so, I'll release the source, but the code is available now (I'll annouce it elsewhere on the forum.)  The compressors DO use the Hilbert scheme for DA, in fact use the DA detector method, so does the limiter.  Unfortunately, the DA detector scheme isn't super fast, so is not a hard limiter, but is indeed very effective to keep normal peaks under control (but not perfectly.)   The DHNRDS actually supports 3 compressors of each time, with user specified compression ratios and thresholds -- so a varying curve can be implemented.   The DA detector is almost perfect given it is a non-RMS scheme.

However, on the DHNRDS there is a great need for precision.   This means that phase errors are a non starter, and typical IIR type phase shifters (which are essentially a Hilbert transform) aren't very precise.   In fact, the is a great need for precision, both in the anti-modulation distortion code along with the detector.   Also, Hann windows need not apply -- we are talking about a need for precision so great that the errors associated with the window function are important.  The DHNRDS emulates a piece of HW, and there is ZERO (absolutely ZERO) room for errors away from the needs for emulation.   If I was doing a GP compressor/expander, then it might be okay to allow SOME ripple in the transform, but I'd prefer just to do a GOOD FIR scheme along with my carefully chosen windows (when ripple might have otherwise happened, the ideal window mitigates the resultant effects.)   Considering that a typical run of the DHNRDS for cleaning up consumer recordings requires approx 24 Hilbert adjunct detectors with the need to avoid modulation products down to approx 50Hz or lower, I certainly would prefer to use IIR scheme if no quality would be lost!!! 

There are two places where the 90deg phase shift is needed in the DHNRDS:

The anti-IMD code, which is an adjunct to the calculation for the DolbyA compatible attack/release.   The DolbyA compatible attack/release is a highly controlled waveform, is a two layer attack/release, where the second layer has a log attack and R-C release.   The first layer is a log attack and log release.  This emulation is on the nonlinear part of the diode, not the rectification -- making the curve very complex.   The Hilbert detection melds with the DA compatible calculation to minimize the gain control modulation products produced because of internal nonlinearites, the super fast attack/release times for a compressor/expander, and the resulting modulation of the signal created by intermod in the audio used to calculate the attack/release.   The Hilbert adjunct stops the resultent modulation of the gain control signal.   The purpose is akin to, but in addition to the ripple reduction associated with such detectors.   Part of the challenge is that the DA detectors are not true peak detectors, but a standard Hilbert detector does tend to be peak detecting.  The Hilbert detector design has to be modified to work in conjunction to the DA scheme. (DA needs 2-40msec attack and 40-80msec release, precisely calcuated to match the old HW.)  R Dolby was a genius, and designed the detector to go as far as possible to minimize distortion given old-time HW -- but the DHNRDS does MUCH MUCH better.

Note:  an important part of the anti-IMD design is that frequencies below about 750Hz must maintain exactly the same gain control shape as the encoding signal.  Nonlinearities in the encoded signal must be cancelled.   On the other hand, frequencies above 1-2kHz have the tendancy to produce modulation distortion, which has the tendancy to soften the sound given the DA configuration.   The frequencies between 500Hz and 1kHz can be the results of intermodulating of the rest of the audio band -- therefore causing a wierd kind of ripple in the gain control.   It appears that the two level attack/release is the root cause for this intermodulation -- doesn't seem to appear on conventional attack/releas gain control, which mostly just has conventional ripple which can be filtered.   The anti-MD below on frequencies below 750Hz is a bad thing, because it effectively changes the shape of the gain control, and actually INCREASES resultant distortion.

The anti-MD (different than the anti-IMD) code does some things that are normally deemed impractical -- it actually implements the gain * signal calculation to effectively minimze the creation of modulation distortion.   It does something similar to a highly finessed shaping of the gain control signal, but also considers the audio signal during the calculation. The anti-MD  doesn't directly affect the gain control nor the audio signal, but instead changes how the result of gain control is calculated.  The Orban patent tries to do something similar, except it moves the sidebands to the higher side (sounds smoother), while the DHNRDS minimizes the sidebands -- keeps them at an even level when gain is changing.

John

Re: New simple, good sounding multiband compressor available.

Reply #36
Then how many FIR hilbert filter have taps in your usecase? Note that there is no way to avoid attenuating low frequency magnitude content when using FIR filters.

Re: New simple, good sounding multiband compressor available.

Reply #37
Then how many FIR hilbert filter have taps in your usecase? Note that there is no way to avoid attenuating low frequency magnitude content when using FIR filters.

Well, IIR filters are worse -- they wobble worse.
For 'detection', the Hilbert detectors are purposefully non-working below 600Hz.   The reason for them in the detectors is to keep the multi-layer nonlinear detector compatible with DolbyA from generating ripple from IMD.   The detector enhancements REALLY make an important improvement.   Anti-ripple CAN NOT be used below 600Hz because the decoder must undo the distortion (hand in glove) created by DolbyA encoding.   Therefore, using anti-ripple techniques below about 600Hz  make the sound WORSE.

For anti-MD, it is much more complex -- but the Hilbert transformers are used in a nonlinear scheme as a part of the gain control mechanism to instantaneously control the slew of the gain*signal where the peak strength of the sidebands are suppressed.   This is a huge problem with DA decoding because of the continual, repeated super fast attack/release times.   This continous/fast attack/release creates a sideband fog -- which hearing perceives as a 'warmth', but when comparing with the original, it becomes 'imprecision.'   Slow compressors/expanders really don't need the anti-MD.   This goes WAY WAY beyond the Orban upper sideband stuffing technique.
What kind of Hilbert transformers are needed:   VERY SPECIAL.   Hann windows need not apply.   Since the process is nonlinear, the  transformers need to function down to about 30-50Hz, up to Nyquist -- can you say LONNNNG FIR filters?   I thought you could :-).  The filters must also be high precision to be effective, so I am stuck with DP math.   Wobbles need not apply, or if you do have wobbles, use VERY SPECIAL ones, which I do.   The windowing function is very carefully chosen to maximize sideband suppression.
For initial guidance I reviewed an important paper (I can look it up for you, if you want, and studying/understanding the characteristics, a certain family of Windows appeared to be optimal, which they were.)

I haven't seen my method published anywhere, but it just became practical with serious SIMD machines and lots of threads.  It takes a serious amount of processing to do correctly.  Once the technique is divulged, maybe some college student will be able to program it onto an 8051, but I just don't know how to simplify the method.

The results -- the FeralA decoder, has been posted elsewhere on this forum.   Look at the video for how much gain control is happening, with NO perceived distortion.   Some of those 10/15dB gain changes are happening at least 5-6 times per second, and there are 8 of them going on at the same time on the same signal.   (2-40msec attack time and 40-80msec release times -- even faster slew for 9kHz and above.)

John

Re: New simple, good sounding multiband compressor available.

Reply #38
BTW -- the previous compressor design is cr*p compared to the one that I am using in the FeralA decoder (it has poor-person mastering capabilities built-in.)   I think that a true RMS compressor with a Hilbert adjunct would be MUCH better.   The compressors in the DA decoder do use Hilbert adjunct to a DolbyA style detector.   I think that RMS would be better for GP applications.

Give me a few months, and there might be a  REALLY, REALLY good RMS compressor source available.   I have to better control the FeralA project first.

John

Re: New simple, good sounding multiband compressor available.

Reply #39
Well, to may understanding any band splitting to work correctly need allpass component. Otherwise it will now work correctly.
Also how bands are split are also very important, for example what order of filters are used.

Re: New simple, good sounding multiband compressor available.

Reply #40
Well, to may understanding any band splitting to work correctly need allpass component. Otherwise it will now work correctly.
Also how bands are split are also very important, for example what order of filters are used.
It is important to use filters with wide skirts -- NR systems are the most stringent, and they use wide filters to minimize modulation distortions.   Both DolbyA and C4 use wide filters.    Telcom C4 does something cool to get the benefit of wide filters and narrow band selection -- they  use different EQ for each, but generally the same bands.

* for small applications where there isn'tmuch gain change, the filter choice isn't as complex.

You can get by with more narrow skirts on compressors/expanders that don't need to reverse the process -- the modulation distortion doesn't have such severe consequences.
You don't really need allpass when you use either wide-skirts or use linear phase filtering (which adding all pass helps to TRY to create for analog filters.)   Doing it in digital CORRECTLY is much easier, but is frought with troubles for other reasons (e.g. the impossibility of doing a pure audio feedback loop like normally required by DolbyA for precise emulation.)   I had to calculate all of the effects of the feedback loop and synthesize them.

I haven't done much IIR splitting except for simple apps, because it (phase) is too sloppy - allpass isn't really an answer in digital.   Just design linear phase equivalents.   That is what I did for DolbyA where it has a Q of 1.17 for the 80Hz bandpass, but Q of 0.470 for 3kHz and 0.420 for 9kHz.   The phase twisting all over the place for the 80Hz bandpass causes a myriad of troubles, but I did resolve them, and that was the only IIR bandpass that I used.   I understand why he did it (Q=1.17), but the 80Hz (actually 74Hz) bandpass doesn't really mean 80Hz, because of the twisting all over the place.   The filter really ends up causing the lower 80Hz band to include up to about 160Hz.   This really screws up the MF (80Hz to 3kHz), which is really (74Hz to 2888Hz) band, because it makes my Hilbert detectors really tricky to avoid the problem of 'hand in glove' recovering the actual distortion caused by the fast 4ms-80ms attack and 80-160ms release on the LF/MF bands.  It is important to allow ripples of certain frequency to occur, otherwise the previously created distortion isn't undone.

For the 3kHz and 9kHz, I just created the linear phase equivalents of Q=0.470 and 0.420 -- works perfectly.

I know that I am talking about DolbyA (and certain initial work on Telcom C4), but the needs are similar to a compressor/expander, but infinitely more stringent.   The reason why it is more stringent is that the digital emulation must be precise.   For example, emulating the selected diode nonlinear characteristics in DolbyA required accuracy of the nonlinear parameters at the 1% level or less.   When designing a normal, ad-hoc compressor, the parameters are more up-for-grabs, and tunable for the application.   Not so for emulating a tricky piece of hardware -- stuff must be incredibly precise.
The DolbyA was designed by circuit -- that means that the specification is the circuit itself.  For telcom C4, they appear to have a design spec as it is easily defined (I have such a definition in my records.)
On the other thand, DolbySR is much more complex, and I am probably one of the very few that does have the circuit.   It is hell, and only in the last year figured how to emulate it without violating patents.   That, in fact, was one of my challenges in DolbyA.  It had to be a novel design (but allowed many more degrees of freedom, e.g. adding anti-MD, which is impossible in a normal feedback design.)
This stuff can be deceptively complex.
Take a look at the video in the FA decoder topic -- it sometimes does 60dB of gain control multiple times per second -- the gain control is crazy to emulate the layered compression used on (against) consumer available recordings -- it is nasty.

John