Polyphase allpasses update

Laureano Lopez
Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri

I updated the polyphase allpasses with a complete set of quasi linear-phase filters. As I said in this post, I'd been looking for a way to oversample a level detection sidechain with IIR filters. There are other potential uses for these, whenever the oversampled and non-oversampled signals need to be mixed in some way. For example, if they need to be added, these filters would avoid cancellations.

In my own level detection cases, I'm just using x2 with the low setting. This already recovers most of the intersample energy. "True peak" detectors use x4, along with a specific weighting eq. For me, the overhead of x4 is not justified by the additional precision, which tends to be < 0.1 dB with reasonable attack times (> 0.5 ms). x8 is just overkill.

I think there must be some way of doing this kind of thing with FIR -I mean, power-complementary half-bands with quasi linear-phase response. The typical FIR half-bands are linear-phase but amplitude-complementary, so they cut too much from the top end. From what I've read, it's not possible to have power-complementary pairs which are also linear-phase, so it's always a compromise. I would expect a FIR solution to be more expensive though.

«13

Comments

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    i ended up using these in my vocoder for the bank of envelope detectors. wasn't sure about the logic of that, since i had to swap out the peak detectors in your original post for the stock core envelope detector which work quite a bit differently. but it seemed to make quite a bit of difference for the above 9k band

    i like the novelty of IIR oversampling filters, anyway

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    if i were to test out these new quasi linear phase filters for 2x oversampling of envelope detection, it would look like this, correct?


  • Laureano Lopez
    Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri

    Yap. You can think of the allpass as a 3.5 samples delay -that's what it's doing for most of the spectrum (up to SR/3):

    So you have two lines at a half sample distance (-3.5 and -3), with the allpass acting as interpolator. At the other end, you delay them by 3.5 and 4, so they're together again with a total delay of 7 samples, and you get their average. If the source has too much content above SR/3, which will be aliased and may (or not) affect your calculations, it may be a good idea to lowpass it before oversampling.

  • Laureano Lopez
    Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri

    There are two things to do with the envelope detectors. First, all states should be OBC chained, so that all copies work on the same memory. Second, you have to scale SR.R for the coefficients. For example, using the R5 peak detector:

    If you're using the R6 envelope toolkit, that's more complicated -I'm not sure how you'd chain states there.

    In a multiband context, oversampling is mostly relevant for the last band -the rest is too lowpassed to have any aliasing that matters for the peak detector (the signals are too slow to have any large intersample peaks). Also, oversampling has pretty much no effect on RMS detection (attack = release), the symmetric window already disperses the intersample energy.

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    good call, i'd remembered to chain the OBC but forgot about SR.R! should probably separate the top band now you mention it so im not oversampling them all for no reason. lol


    so with the corner frequency at 14k or whatever at normal sample rates, you're basically sacrificing that top 5k or so of bandwidth? i chose your macros over the FIR options in the UL because they passed the side by side subjective vibe check. maybe that has something to do with why? have to check out the difference when lowpassed 🧐

  • Laureano Lopez
    Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri
    edited January 28

    If you have a fixed arrangement, you can try oversampling the top band only and see if it's enough -remember to delay the lower bands to compensate for the oversampling latency. With a variable, parameterized arrangement it's a harder call -you could always have a, say, second-to-top band which happens to alias relevantly.

    I'll back down on lowpassing -it's not really necessary. The attack of the envelope will wipe out anything above SR/3 anyway. I'd take a look at the envelope itself though. I see you're using a modified version of the stock follower, which has a single feedback loop for both attack and release. If you want to get a good peak estimation, this is bad. Coupled, single loop detectors have their output level scaled by their coefficients. You need at least two feedback loops to have proper attack and release.

    Take a look at the attachment. They are decoupled detectors, with separate filters for attack and release. The "3p" ones use an additional pole for attack -this increases both the lowpassing and the peak estimation, but the difference is tiny compared to a coupled detector. In the figures, blue is the coupled, 1-pole one, pink is 2-pole, orange is 3-pole, all with 10ms attack and 50ms release. You can see the problem.

    The top figure shows the filters working on abs(x), the bottom figure on x^2, with sqrt afterwards. You'll see that the abs versions follow the signals more closely. The x^2 versions work on power, so the peaks and valleys are similar, but everything is "fattened" in between (not only the releases, the attacks too). This is often desired for compression, or for comparing signals, but not so much for envelope extraction.

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    fantastic. i knew the envelope detector part of the vocoder needed something besides just oversampling, but without another set of eyes, had nothing but to resort to pushing random buttons (like using (x^2) instead of abs(x), which now that you bring it up is categorically something i don't want in there. haha). i think in addition to bolabo's fixed 'moog style' bands this is enough to carry through update 1.2. i'll report back after trying out


    i think maybe i asked this before, but not here: what is an oversampling situation where processing between stages is appropriate?

  • Laureano Lopez
    Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri

    <<what is an oversampling situation where processing between stages is appropriate?>>

    Oh, I have no idea 😁 It's there just in case someone needs it, because in those cases the other chains would not work, but using these ones for the general case is a waste of cpu. They just use the same filters for all stages, because the process in between could generate frequencies above the original Nyquist that need to be lowpassed again. Without processing between stages, x4 and x8 stages can have lower corners and wider transition bands, which means less poles for the same stopband reduction.

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri
    edited January 29

    this whole system is gradually becoming less mysterious to me, running sine sweeps in your test suite is helpful there. just got your envelope detectors into the vocoder for a series of vibe checks. interesting in your figures, that whether or not the env detector is coupled or not seems to make the biggest difference out of anything. i'd have expected the difference between abso(x) and x2 to be bigger. huh...


    Oh, I have no idea 😁

    btw, i figured out how all the cool kids are doing quoting of specific sections of replies: just by copy/pasting the text and entering a ">" after. found that out by dumb luck trying to use that character to say 'greater than'

  • Studiowaves
    Studiowaves Member Posts: 196 Tri

    Your pretty good Laureano, I'm always impressed. I have a side chain hardware compressor that works great. I put the compressor side on a lead guitar player and when we are studying the sheet music as soon as we open the book up it turns the lead guitar player off. lol It's the only way. haha

  • Laureano Lopez
    Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri
    edited January 29

    >>i figured out how all the cool kids are doing quoting of specific sections of replies

    Lol, I can't make it work 🙃

    >>interesting in your figures, that whether or not the env detector is coupled or not seems to make the biggest difference out of anything

    Yep. You really need to let the input pass through to get actual peak detection. The coeff switching is pretty much a resource-saving hack. The difference between arv and rms becomes more relevant when you have to take relative levels: peak minus average, band minus broadband, dry minus wet, etc. In those cases, equal power usually works better than equal amplitude.

    Back to decoupled vs coupled: this comes from a, say, "technically agnostic" point of view. A decoupled detector is a better match to the actual signal envelope, but it's not necessarily a better match to specific designs of specific devices. For modelling vintage stuff, you always have to find out what was actually used, which wasn't always the technically better option. There was a lot of resource saving 😄

    >>I put the compressor side on a lead guitar player and when we are studying the sheet music as soon as we open the book up it turns the lead guitar player off. lol It's the only way. haha

    What a smart device (?) 😂

  • Laureano Lopez
    Laureano Lopez Cordoba, ArgentinaMember Posts: 55 Tri
    edited February 6

    I corrected an old mistake in the release filters. You won't really notice a difference, but anyway, a mistake it was. Thing is, I use zdf lowpasses to get zero gain at Nyquist, and that's ok for attack, but for release you have the branching on peaks. I was setting the state in a way that didn't clear the past, so the trajectory started slightly off. Turns out the fix is rather complicated, so I replaced the releases with naive lowpasses.

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    i think getting rid of the intersample energy and now having an envelope follower that actually follows the envelope are the two main things in this, my pursuit of constructing a 'premium' vocoder. what a difference! the other main thing was in the choice of filters, and possibly more than that their settings (the carrier having a wider passband and the modulator set narrower, bordering on resonance)


    since you talk about bulding your oversampling library more or less for the purpose of level detection, does that mean you'd recommend the using the newer quasi-linear phase filters to this end?


    anyway, having fun looking inside the two respective release macros and pondering their differences. the updated one just looks more or less like a regular integrator... i guess its interesting because i've never seen anything with a ZDF topology 'condensed' to this degree. haha



  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    alan from what you've described it sounds like the sidechain is making intelligent decisions?? i simply must know more 🤔

  • ANDREW221231
    ANDREW221231 Member Posts: 131 Tri

    btw, for quotes:

    this

    and then pressing enter, give us this

    >>i figured out how all the cool kids are doing quoting of specific sections of replies


Back To Top