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

Fourier Square-Syntesis fails in Reaktor?

Discussion in 'Building With Reaktor' started by Makrophag, Jun 9, 2009.

Thread Status:
Not open for further replies.
  1. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    Hi there!

    I just heard about Fourier Synthesis (http://www.nst.ing.tu-bs.de/schaukasten/fourier/en_idx.html) and could not to try this simple but mighty theorie to create a square waveform out of some Sines.
    So I inserted some of the Sync Sine Modules (of course the added sines must be in sync, so they are added on the right phase), synced them to an square Osc and added the parts of the formular (thats frequency multiplied with the number of harmonics and amplitude divided throu it) and added them all up.
    I connected an "Oscilograph" to it, and whoops this curve does not look right. the main problem is that the part of the waveform, where the constant part of the square should be sowly falls of, so theres a little ramp.
    Another thing is, after adding some more sines (up to 9), the higher frequencies start messin gthins up, that means instead of making the curve more straight, it gehts more curly, wavy.

    (I think, theres something going wrong with the sync of the oscillators, for the first two sine, one can see, that when the second is phase-offset by ~0.04, the curve looks better)

    I hope you can understand what I mean, perhaps I will upload a screenshot tomorrow. Or you try it at home and tell me if you got the same problem...


    So is anybody out there who has already tried out this Kind of Synthesis and perhaps experiencing the same problems?
     
  2. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    I have tried that simple additive synthesis. Check here, there is a preset for saw and square:
     

    Attached Files:

  3. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Great! So that's what you've been talking about - any waveform can be represented with some number of sine waves? BTW, why do you need Env Follower with 0 inputs for A & D after Audio Voice Combiner and why do you need Pulse Oscillator?
     
  4. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    The pulse oscillator just triggers the scope, I think.

    @ EvilDragon:
    How do you make sure, that the different Multisines are phase-locked?
     
  5. le Syndicate

    le Syndicate Forum Member

    Messages:
    190
    Thanks for attached file Evil Dragon.

    ....if i play with your .ens it Produces some (more or less decent) clicks & plops
    if i hit the Keyboard.
    Is there a way to avoid this, or is it nature of Reaktor ?

    I guess this is a problem in some .ens

    Does anyone know why...?
     
  6. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Soundcard latency?
     
  7. le Syndicate

    le Syndicate Forum Member

    Messages:
    190
    no,... it´s not so raw.
    More something with Fine tuning in the ensemble, maybe.

    You can see issue at the Scope from Evil Dragon attachment.
    If you hit some notes it is a not so loud Plop sound on the beginning
    of every new hit.

    and just sometimes there unregular Peaks in scope when it "plops".

    do you know what i mean or is it, just me:confused:

    Maybe this is because it`s nature of that test .ens.
    or an easy sine Wave....
    But really want to know how to avoid this....

    Thanks
     
  8. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    There are severel Possibilities.
    If the sines aren't synced to gate, you here a plop, when the gate just starts into an part of the sine with an high amplitude (thats, the sine beginns with an suare-like signal).

    Another thing could be something in velocity management.

    Anyone got an answer to my question above, how pahes lock is realised?
     
  9. le Syndicate

    le Syndicate Forum Member

    Messages:
    190
    Thanks for description Makrophag.
    That helps.....:D

    I have actually no idea but
    hope somone found an answer to your question about
    ....how to realize phase lock? (If that´s the words you described above)
     
  10. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    no problem. But as I said, I do not garantee for the corectness of my words..
     
  11. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    Hello EvilDragon?
    Are you out there?
     
  12. Makrophag

    Makrophag NI Product Owner

    Messages:
    208

    I think I found out:
    It Just works as an rectifier. All inputs are converted to positive Values, so that the pulse, that is used for triggering always has an positive Amplitude. And although with nothin connected, I think the env. Follower produces some small smoothing. But I am not sure.

    Now its somehow paradox, I keep answering questions in my own thread where my question should be answered. pf. So its once again: Try And Error!
    ---
    nope. I just do not get it.
    WHY ARE THE 4 MULTI-SINE MODULES PERFECTLY PHASE SYNCHRON?

    help!
     
    Last edited: Jun 12, 2009
  13. kid_sputnik

    kid_sputnik NI Product Owner

    Messages:
    3,552
    the primary level module you mean? that is an ugly beast IMO. It is not exactly Sine Osc * 4, I think under the hood it is doing something a bit more clever, and the phase-locking is a result of that. OK, that was a lame explanation but thats all I got.

    You may want to check out Macros->Building Blocks->Oscillators->Sine Bank. This is a Core based approach that gives you 16 sine waves that you can use a partials. You can easily rip out the Core Cell oscillator and forget about the big ugly gui that the macro has.

    [EDIT] even that macro will give you nasty clicks when you change the ratio between sine waves. I think this is just an implimentation issue due to the way it works. Stacking a bunch of real sine oscillators and using math to determine frequency ratios is probably best to avoid clicking and phase-locking, at the cost of CPU [/EDIT]

    As far as additive synthesis goes in Reaktor, it might help to look into SumSynth. It is sort of flawed in that it uses polyphony to create the sinewaves, and therefore it only plays monophonic, but it gives a good insight into a more efficient way to manage the many sinewaves needed for good additive synthesis. Doing realtime FFT analysis / resynthesis is actually something entirely different and near impossible to do well in Reaktor (check out the FFT upload by Stephan Schmitt and Gabriel Mulzer I think in the UL, it is a nice idea and well done considering what they are doing but still not exactly smooth are easy to use).
     
  14. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    Yeah thats what I was thinking, Inside the Module must be something that causes synchronized Waves, but why can 2 different of these modules be used in that way? Somthing must sync between those modules or didnt I look correctly into the waves? In the end arent they phase synced?
     
  15. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    I guess they are synced, why shouldn't they?
     
  16. Makrophag

    Makrophag NI Product Owner

    Messages:
    208
    because they are 2 different modules.

    OK, i managed to biuld up my own Sine and Cosine Oscillators and succeeded (somehow) in realising Fourier Synthesis by adding 16 sines/cosine together to create square, saw, triangle and sine pulse Waveforms.
    But I have problems with aliasing sounds (unwished waveform contents that get worse, the lower the samplerate is) and it eats up a lot of CPU.
    But I will keep on triing.

    Perhaps moving more modules into Core will reduce aliasing?
     
  17. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    I guess they are 2 different modules, but they are synced. There was a topic about anti-aliasing problem inside core discussed here:

    http://www.native-instruments.com/forum/showthread.php?t=82420

    I think you have more control over wave inside core level, however you should know how to implement anti-aliasing algorithm well.

    Good luck!
     
  18. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    I think the "plop" somebody asked is because all 16 partials in the Square and Saw patches have 0 attack time. Since I used msec for envelope parameters, that's what you get. Increasing the attack time for every partial a bit takes the "plop" out.
    EDIT: it's not that. I guess it's the nature of Multisine oscillator. I tried it with normal Sine oscillator, and there was no initial click after I added some Attack envelope. Which is not the case with Multisine osc. My guess is that whenever the new Gate signal is received, the phase of Multisine is reset, and that's what is causing the clicks. So, you can't get rid of that, I think.

    Also sorry for not checking in here for a while.

    How the phase correctness is preserved in my ensemble? I think that all Multisine oscillators that are connected to the same Gate source are phase locked. I think that's what it is, because I don't hear any phase shifts when I'm using all 16 partials with my test ensemble.

    About Envelope follower, I put it after the mono-summed signal to even out the scope display frequency. Try to bypass that module with direct signal from mono-summed output, and see what you get. Not nice, eh?
     
  19. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Hm, aren't primary sine oscillators phase locked as well, but they don't give any clicks? I mean what happens when you send Gate on signal - signal is on, so does phase right? Sorry if I confuse something.
     
  20. EvilDragon

    EvilDragon Well-Known Member

    Messages:
    19,938
    Normal Sine oscillators don't have a Sync input, so they are free-running all the time, I guess... That's the difference between them and Multisine, as I see it. Multisine is phase-synced internally, clicking when a new Gate signal resets the phase, whereas with normal Sine oscillator (not Sine Sync), a new Gate signal just plays the oscillator regardless of the phase it's in. That's the most logical conclusion to me as to why is there a "plop" in the attack phase regardless of the Attack setting..
     
Thread Status:
Not open for further replies.