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

Formant Osc-like effect on audio source

Discussion in 'REAKTOR' started by carloskleiber, Mar 17, 2009.

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

    PeterW NI Product Owner

    Messages:
    182
    The A/E, with red ring, only converts Audio to Event 400 times per second, much too slow and not synced to the triangle test osc. This means the output from the "A to E trig" module is a fairly random stream of ones and zeros.

    The modulo and compare/equal you are using are not needed and will introduce detection errors especially if you intend using a live input signal with any harmonics present.

    I'm not sure why you are using modulo module and dismiss using "A to E trig", Have I missed somthing ?
     

    Attached Files:

  2. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    How about using an event separator with zero threshold then connect the upper output only ? I've used it many times to get rid of the 0 on alternating 0 and 1 events, the only events that got through is just those with 1 value.

    I think you don't even need the A/E module at all, remember the "A" input of the A to E Trig module can accept audio signal.

    A to E Perm is much better i think, as the rate can be adjusted freely, even beyond allowed global event rate..
     
  3. PeterW

    PeterW NI Product Owner

    Messages:
    182
    Yes agreed, however “A to E Perm” with higher rates can cause a substantial increase in CPU use if followed by many other event modules. Probably best used sparingly or only when really required.

    Using “A/E” or “A to E Perm” will only cause problems in this timing critical application because the events must be locked exactly to the zero crossing of the input. The “A to E Trig” was made for this sort of thing and will (imho) provide the most accurate detection of the –ve to +ve transition of the input signal.
     
  4. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    I think I didn't explain it right, sorry for my english. I was talking about that I didn't think of using A/E Trig before you've said about it, because I didn't know how it worked properly and I though you were advising first to make it together with Modulo, but it was caused by my misunderstanding that I used that scheme together. But after deleting Modulo I realized that it was wrong solution (back to your reply in quote - you explained me why). That's why I told "I dismissed the usage of A/E Trig module".
     
  5. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Yes, it worked for me as well in some cases, but I've tried using it in this structure and it didn't work properly. Maybe I did something wrong..

    This structure works perfectly for me (see picture attached).
     

    Attached Files:

  6. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    Oh, no wonder i get that sudden increase in CPU usage (sometimes more than 10%) after connecting more event modules to its output, thanks for the info. I use it for several parts that needs specific rate that differs from global event rate, or knob-adjustable rate.

    This is much simpler, yet perform better i believe..
     
  7. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    I'm going to add it to my livejournal entry (Bert, I suppose it was you who wrote comments on frequency and pitch topics? Sorry if I confuse).
     
  8. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    Yup, that's me :) Thanks for answering my request, i think this will be an interesting topic to be explored further..
     
  9. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Yes, because this method is used only for easy waveforms, as for hard ones it won't be valid..
     
  10. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    This zero-crossing method can be quite fast and effective, the major problem for complex waveforms is there's too much false crossing that most likely caused by overtones/upper harmonics, but with proper pre-processing to simplify the complex waveform, it can perform well i think.
     
  11. carloskleiber

    carloskleiber Forum Member

    Messages:
    537
    That's exactly what I was about to ask! (This thread has become very exciting, I try keeping track, just that I am back in a period where I should be using my tools as they are instead of keeping modding them...)
    Thank you to all for these contributions, especially to Bertrand for the VoiceKeys, I am looking forward to check out your new one from the UL...
     
  12. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Any theoretical background on this btw? How can complex waveform be simplified? Just interested..
     
  13. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    Thank you very much for the kind words ! I'm glad to know that it's useful, hope the new one is satisfying as well. Any comments and suggestions are always welcome.

    I don't really know much about the 'real' theory though, so please excuse me if there's any mistake..

    In general a complex waveform is actually made up by simple ones (sine waves), so if we could increase the domination of the important one (in this case, the fundamental waveform) and decrease the others, we could easily use the zero-crossing method to track the freq/pitch of the waveform, since the crossing only happens on its fundamental period (pretty much like the triangle osc on the previous picture).

    This can be achieved with filters, we can use it to filter out or at least reducing the upper harmonics so the fundamental will be the loudest one, and zero-crossing only happens on the fundamental period.
     
  14. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    If you want to do some testing, just use any of the oscilloscope ins (Instrument->Analyzer and Displays->) to see how a filter can affect the zero-crossing of a complex waveform (like vocal), the oscilloscope will clearly shows the actual crossing, when it become stable, then most likely it is in its fundamental period..
     
  15. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Like this?
     

    Attached Files:

  16. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    Exactly like that ! Although i think for fundamental freq searching (the original pitch of the waveform) it's best to use LP out, since it's on the lower part of the waveform's harmonic spectrum, and the ones that need to be filtered out is on the upper part.

    As you can see, the zero-crossing is kinda random in the scope display, but when you altered the waveform with filter you'll get a more stable zero-crossing that is simple enough to be timed to find the frequency. Different filter or combination of filter (1-pole, 2-pole, two 1-pole with different cutoff, etc.) gives different result, experimenting is needed to find the best one. But so far i haven't found a setup that works with all kind of waveform, sometimes a filter setup works well for guitar, but not for vocal for example.

    You can then use the previous zero-crossing method to see the detected pitch after it's been filtered, if the filter setup works, you'll get the waveform's pitch.
     
  17. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Okay, so it as well depends on filter's frequency? What about this one? What is ideal frequency set for filter to count zero crossings? I will try some setup later on.
     
  18. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    For this one maybe you can set the P Cutoff knob near the source original pitch, sometimes even below it (remember to use the LP out). The trick is just playing around with P Cutoff knob until it gives a clear and stable zero-crossing on the scope. Or how about connecting the note pitch to the P input on the filter ? If it still gives false crossing, then maybe another filter is needed.

    Btw, could you post the ensemble please ? I'll try some setup that hopefully will work on yours. I also have assembled a simple zero-crossing pitch detector, with the combination of a fixed cutoff 1-pole LP filter, and an adjustable cutoff 4-pole LP filter. This i think is a lucky find when i really got into zero-crossing back then, works pretty good with guitar and vocal samples i've tried.

    One of the disadvantages though from what i know, it doesn't perform well on wide range of notes, this is caused by the use of filters, which are essentials to get a working zero-crossing detection.
     

    Attached Files:

  19. Aleksandr Smirnov

    Aleksandr Smirnov NI Product Owner

    Messages:
    1,539
    Hi Bert!

    Thanks for your feedback. I've messed a bit with your ensemble and I should say it works pretty fine for pitch detection. Here is the setup I've tried with your macro (see ensemble attached). Can it be a good complex waveform sample to start with or too complex?

    Also I'm attaching my ensemble which is only in the beginning of work. First attachment is simple macro for detecting pitch for basic waveforms. Another one is that I've done after your posts with filter (you can use same sample as in your ensemble to check it).

    Looks like the best way would be two pass it through several filters like you did. The more it will cross zero line the better will be the detected pitch.

    Problem becomes a bit harder for more voices as well..
     

    Attached Files:

  20. BertAnt

    BertAnt NI Product Owner

    Messages:
    414
    I'll have a look on your ensembles, i can't wait for that :) Thanks for keeping this discussion going, i'm sure everyone (including me) will learn something from this..

    I think as long as it's monophonic, pitched and natural waveform (not heavily processed such as rectified, which definitely cannot be detected with zero-crossing), the pitch can be detected well enough.

    If you mean polyphonic detection, well.. it's not just a bit harder, it's frustrating. I've only been able to build one, and still clueless on improving it..
     
Thread Status:
Not open for further replies.