1. IMPORTANT:
    We launched a new online community and this space is now closed. This community will be available as a read-only resources until further notice.
    JOIN US HERE

hubris? or a feedback hack

Discussion in 'Building With Reaktor' started by ANDREW221231, Jul 3, 2017.

  1. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    so i'll preface this by saying i understand the necessity of a unit delay, and why getting around having one in your feedback requires more than cheap parlour tricks. its just that won't stop me trying anyway.

    the first time i tried tricking reaktor into forgetting to add the z, i subtracted the trick signal from a unit delayed signal and it didn't null, but the difference wasn't anything more than rounding error garbage that disappeared when the signal was active

    the last trick in my bag was to trigger the value module fed by an a to e perm at sample rate with ANOTHER a to e perm at sample rate sampling something upstream

    i'm not going to say it worked, because i don't know how to check or what to look for, but the output is no copy of the unit delay, and switching between the two seems like could be changing the character of the cutoff at high resonance. i wouldn't even say if it was better or worse. at any rate there is an audible difference.

    so either i hacked the feedback (which i doubt, i mean this really shouldnt work right?) or somehow another unit delay got in the mix? or some other dark unsforseen factor is in play?

    the enclosed ensemble makes use of a dead man's switch for consideration of your equipment. i blew the lid off so hard it shut my receiver off! guess it wasnt rated for infinity watts
     

    Attached Files:

    Last edited: Jul 3, 2017
  2. colB

    colB NI Product Owner

    Messages:
    3,969
    Next you are going to build a perpetual motion machine right? ;p

    Attach two unit delay modules in series between the LP output of the filter and the top switch input. Now A/B the two feedback options with the switch.
    I guess that the A to E perm causes one unit delay and the value module is the other, because both of these modules will have internal memory that is written to by one input, then read by an event at the other (value) or an internal clock impulse (A to E perm). Either way, I suspect they are functionally equivalent z-1 modules in this context.

    ..although it's anybody's guess in the context of Primary where the order that modules are added and wires attached can invisibly change the meaning of the code...
     
    Last edited: Jul 7, 2017
  3. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    the way to trick reaktor to forget the z is to do a ton of math, therefore eliminating the need for feedback in the first place.

    see : zero delay feedback filters
     
  4. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    oh yeah, that would be the way to check. i was trying to think up some way to crank up the resonance enough to inspect the cutoff while also keeping it from blowing up :eek:. the more i think about it, two unit delays makes more sense than zero, but the connection order wonkiness in primary is what i was thinking to exploit. interestingly enough, there is a feedback block whose origin i cannot pinpoint (part of a ul collection i think) that claims to do the same thing with nothing more than a latch -1 module. that just sounds straight up quixotic, but ive used it for oscillator fm where there was feedback and it seemed to actually clean things up
     
  5. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    well, yeah, but can't it be done both ways? i was reading a pretty heated debate maybe on kvr with the guy that invented diva talking about how eliminating the unit delay and solving it with a differential equation were mathematically equivalent but the differential equation route was still superior for some such reason. maybe i didn't understand him correctly but that's OK in this case, cause im not trying to reinvent the wheel, its more an exercise in learning about things by breaking them.

    which is actually a great way to learn, if it wasnt, there wouldn't be such things as atom smashers :cool:
     
  6. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    ... i mean, whatever way you choose to do the math, it's still math. trying to trick reaktor to magically eliminate the delay is not going to happen.

    if running at audio rate, a latch -1 is identical to a z^-1 (hence the name).
     
    Last edited: Jul 7, 2017
  7. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    that was my assumption from the beginning (not that there wasn't a small hope for magical elimination).

    the absolute worst case scenario you can run into in exercises like these (besides blown speakers) is that you learn something about why something is the way it is. and maybe its something you already technically know, but you actually see it in a new way that makes other things obvious.

    so you say its not going to happen, 20% of me says i don't believe you. its not that i don't think you're better informed than i am, just that fully believing anything closes off a lot of possibilities. and again, i'm not just talking about good will hunting style 'hey you solved the magic problem' scenarios, more like seeing the regular stuff from as many angles as possible
     
  8. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    this part of your reply was omitted when i saw it first. yeah, i thought it all seemed dubious when i looked inside, but it lets you a/b and it does seem to sound better.

    so when used as a block, the z never goes away on the primary level. so this would be adding an additional z-1? just doubling up the unit delay, just as i am suspecting whatever i cooked up here did as well?
     
  9. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    i just don't understand what the point of asking questions is if you're going to ignore the answers you get. sorry if that comes across as rude, but it's kind of a waste of everybody's time if you're going to insist that a computer program is going to magically figure out how to do extremely complex math all on it's own.
     
    Last edited: Jul 7, 2017
  10. colB

    colB NI Product Owner

    Messages:
    3,969
    Maybe you misunderstood part of the discussion on KVR. Most of the debates on this topic are about the merits of different ways of reducing or removing the effect of the unit delay in digital filters. You cannot just 'remove the unit delay' that's not an option - if it was an option, there would be no debate.
    You can rearrange the problem so that the unit delay doesn't happen in the feedback path of the filter - this is the math heavy approach. Either you do it by solving the resulting algebra, or by some iterative method that homes in on the solution (e.g. Newton-Raphson).
    Alternatively, you can keep the basic algorithm with the unit delay and oversample it by some factor that is large enough that the error caused by the unit delay becomes insignificant...

    For a linear filter, solving the algebra isn't really that bad, both in difficulty and in cpu terms. As soon as you start introducing nonlinear components to simulate saturation, it gets MUCH more difficult. At this point I got better results using Newton-Raphson.
    There are other approaches that involve making estimates at what the saturation will do... or calculating the filter algorithmically, then superimposing the saturation component on top... all sorts of clever ideas that work well in some situations, and not so well in others. Search for 'mystran filter' on KVR. There is a tutorial on the KVR forum explaining how to analyse a Steiner Parker type filter circuit and turn it into a saturating zero delay digital filter with saturation using mystrans approach.

    None of these involve 'just removing the unit delay' ;)
     
    • Like Like x 1
  11. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    My intention is not to ignore the answers, in not at all saying I don't believe you, especially in the case of this answer you've helped clear things up. The 20% I am talking about is regarding believing anything, or the idea of belief itself. I guess in simplest terms its an attempt to be primarily left brained without shutting off the right side. So again to make sure in not misrepresenting myself, my 'don't believe you' was meant as a rational for my original post, not as a response to your answers, which were only helpful and much appreciated
     
  12. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    i am constantly trying to read things that are over my level, and its led me to conclusions about things that were pretty far from reality. sometimes i get lucky though... at any rate you were correct, two unit delays made them indistinguishable.

    one thing i'm left wondering... reaktor adds a unit delay to the feedback path automatically...if it didn't do this, what would happen? probably a hard freeze?
     
  13. colB

    colB NI Product Owner

    Messages:
    3,969
    Me too. One good thing is that occasionally I find myself reading something I saw a few years earlier and found very difficult that now seems a lot easier... if you keep pushing at it some of it will stick!
    It couldn't not do this. The code would not be possible to interpret/compile without the insertion of a unit delay.

    If you have a memory read, followed by some process using the read data, followed by a memory write, it is literally, logically (and to me obviously) impossible for the initial read to read the outcome of the process that uses the result of the read (assuming no time machine).

    You tell a friend that you are going to Glasgow to buy a car, and they ask: "how are you getting there?", and you reply sincerely: "I will drive there in the car I'm going to buy"... How might they react to this?

    The unit delay is like you replying: "I will drive there in the car I bought last time"... This way you still have a friend ;)
     
    Last edited: Jul 10, 2017
  14. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    great analogy, colin.

    in the case of a 1 pole low pass filter, the ideal equation is

    y = g(x-y) + s

    where x is the input, and y is the output of the filter, g is a value that determines the cutoff point and s is a known value that you don't need to worry about...

    now, how do you tell reaktor to implement that? you can't, because you can't calculate y without already knowing what y equals.

    you could simply insert a unit delay. so then

    y[n] = g(x-y[n-1]) +s

    here, you simply take the last known value of y (initialized to 0) as a best guess to calculate your new y. this is a bad way to solve the problem because it skews the frequency response of the filter so that it gets less accurate the higher cutoff frequency gets. (yet up until about 10 years ago, this was the standard way to implement filters!)

    instead, you do some algebra to isolate y on one side of the equation.

    y = g(x-y) + s
    y = gx - gy + s
    y + gy = gx + s
    (1 + g) * y = gx + s
    y = gx+s/(1+g)

    basically what you're trying to do in the first post is to somehow trick the computer to do all of that math for you on it's own, which it will never do. you must explicitly or implicitly solve the math in front of you and implement it in reaktor directly.

    so my irritated response was because you are essentially hoping that reaktor becomes sentient and starts doing your math for you. ;)
     
    Last edited: Jul 10, 2017
  15. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    okay, so the arrow of time, discrete mathematics and the read/write order of memory prohibit the reading of a sample before you can write it... that is compelling logic. i guess we can safely tick 'hubris' down on the sheet? these are notions i'd been holding these notions for some time too.

    another interesting thing... a variation of the ensemble above i tried with routing into core... subtracting the feedback path from the input in primary gave a null, though the same signal only routed out from core was delayed presumably by one sample. is that typical behaviour for routing into/out of core?

    i already knew a lot of this, at least as facts, but that did not stop me from kind of hoping for yeah, exactly that, at least as an outward possibility.
    i am, for the first time convinced that this is not a tenable solution. that's pretty understandably irritating, i thank you for bearing with me.

    as someone who failed algebra three times in high school, was gonna make some joke about 'of course i hope that', but the truth is i had a sort of light bulb moment not terribly recently, following the math on something i had a good intuitive understanding of and being able to appreciate that the math was the same information just in a condensed but unfortunately incomprehensible language. now i find myself revisiting things i actively shunned and finding them well worth geeking out over

    algebra remains pretty easy to follow, but what branch of math finds the addition of very many incomprehensible characters as shown in the attached picture (equation for a fourier transform)? is that calculus?
     

    Attached Files:

  16. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    that's calculus. math is pretty satisfying if you can find a purpose like DSP that makes it interesting to you.

    i suggest khan academy (free online videos) for learning, i find it's often possible to learn a difficult math theory in a very short time there, even in math classes well above what i took in school - i learned enough multivariable calculus to solve a problem i was working on in less than hour recently. of course, i'm mostly an autodidact so your mileage may vary.
     
  17. colB

    colB NI Product Owner

    Messages:
    3,969
    gobbledegook is what it is

    The thing is with math that often as you do research to break down something like the pic you posted, the bit you thought was going to be the tricky bit to understand - calculus, integrals etc. - is just the tip of a giant iceberg.

    Look at that pic again and you see in the f(x) part of the integral there is e taken to a power of some bunch of letters and squiggles including i.
    Here 'i' is the square root of -1 and unless I'm mistaken (quite likely given my limited knowledge), that thing is a complex number in exponential form. Look up Eulers formula for the low down on that and you have another stack of stuff to get your head around...
    It's maybe (just guessing, but it look like the same thing) some sort of Fourier kind of thing where superposition of sine waves is expressed as an integral of complex exponentials... See,now you've got me talking gobbledegook that I don't fully understand, and probably making a fool of myself ;)

    It's like a can of worms but with recursion built in. No matter how deep you go there's always another layer that's a whole chapter of an undergraduate level math text :)
    And the fun stuff is never one or the other of the difficult concepts you barely understand, it's always a combination of the lot of them in a form you've never seen before... 8-D
     
  18. ANDREW221231

    ANDREW221231 NI Product Owner

    Messages:
    875
    wait is that the thing for polar coordinates? any xy can be mapped as a sine, cosine, that bit? i love all that. theres a really good video explaining fourier transforms, and then also the zynaptiq guy has a blog post explaining fourier transforms from a different angle, getting my head around both seemed to square my understanding, and it occurred to me that human understanding could very well transcend the four regular dimensions if each new way of understanding something adds a new dimension in a manner of speaking.

    failing that, connecting new dots is like a drug. like simple harmonic motion being a sine wave for say amplitude, and then say.... acceleration? (pulling that out of my ass) is a cosine to that wave, phase locked at 90 degrees.

    and then how the sine/cosine is fundemental to the fourier transform, and then finding magical crap in the ul that exploits variations of that same basic idea, such as gabriel mulzer's work, multiplying adding/subtracting sines and cosines a la the regular ol frequency shifter. it seems like there's a lot of possibilities yet unexplored if one could indeed 8d understand it

    anyway, yeah, gobbledegook. it seems pretty self evident at a certain point that whoever invented that stuff made it fancier and more off putting than it had to be out of pure self satisfaction. or at least that's how i'll feel until i can understand it.

    is that in reference to the conqueror khans that collected smart people and threw them together for maximum learning?
     
  19. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    no it's the guy's last name i think
     
  20. colB

    colB NI Product Owner

    Messages:
    3,969
    No, polar form of complex numbers is a different thing. This is exponential form.