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

discrete wavelet transform in reaktor

Discussion in 'Building With Reaktor' started by ANDREW221231, May 6, 2016.

  1. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    heh that was quick, thanks!
    uh, it's late here so probably won't have anything on this til tomorrow sometime.

    edit, yeah this will be quite a bit of work, but i saw the same structure you're using (the way the wavelets are arranged) somewhere, i think it's right.
     
    Last edited: May 31, 2016
  2. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Here's one with your Analyze macros unchanged.
     

    Attached Files:

  3. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    This structure works in a perl version, so yeah I'm pretty confident in it.
     
  4. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    The structure works, but I'm not positive about the orientation of the filters any more... Gonna confirm them today.
     
  5. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Okay, I'm 95% sure what you have is correct.
     
  6. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    well... there are certainly some 'mistakes' in the filters. they may be fine in the perl setup but with the topology i have, they aren't working.

    i started by working on perfect reconstruction because it seemed easier than re-building the display (pretty much the whole thing needs to be scrapped). fft saw distortion, but i couldn't find the source.

    finally i stripped everything down to just one layer of de/re construction, still distortion. okay. so i compared all the values of the first layer coefficients for your current version and my current one.

    the rh, rg, and ih values are identical for both, but the last set is all out of whack.

    your values:

    0
    0
    -.011
    .011
    .088
    .088
    -.69
    .69
    -.088
    -.088

    mine (by which i mean, other values that you gave me):

    0
    0
    -.088
    -.088
    .69
    -.69
    .088
    .088
    .011
    -.011

    so you can see, other than the zeroes at the beginning, they are in reverse order....

    do you think the other values are similarly out of order, or not? there is certainly something awry in the other wavelets (or at least one of them) as well
     
  7. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Wouldn't the delay just be the same for all the Modify modules? Since they all get the "signal" at the same time...
     
  8. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Just saw this, I'll look into it...
     
  9. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Can you send a copy of the PR version with just one layer so I can verify when I have it right?
     
  10. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    I was just messing around and I set the layers to 12, increased the array size in the Modify block, and went through to each Modify module and set the "offset" directly on the "max" input so every Modify had the same delay, "max", and I actually got a coherent signal in the display, but it was intermittent as to when it would actually get displayed. But got a very tight curve.

    Ok, from what I can tell, this is the correct order (identical to the first tree but shifted by one) but you're right, it shouldn't work on its own. It only works in the context of the entire DTCDWPT. That's what I gather.

    If it is the incorrect order, then the "simple" filter follows the same pattern, but without the shift, so it may be similarly different.
     
  11. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    yeah, the delay is now the same for everything. but eventually certain bands will be split more than others, so that won't always be the case.

    here's a working 1 layer PR, just using the old coefficients. the problem i have is there isn't perfect reconstruction with this layer when you switch to the new ones. maybe i'll work on the display and see what we can get out of that
     

    Attached Files:

  12. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    I'll see what I can do... Here's a picture of the result I got from messing around (setting the delays the same):
    signal.png
     
  13. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    i think the problem may be related to the way that the hi/lo values propagate. i'm not able to use them directly anymore, but i think they may need to be generated elsewhere and used globally so that i can return to using them directly.

    the display will be less distorted if you set xOff to 0 in the display macro.
     
  14. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Cool. I'm mostly interested in this because it shows me that the filters are correct. I haven't spent any time at all on Reconstruction, so I don't know if the patterns for the coefficients are the same (doubtful) for reconstruction as they have been. I'm going to mess around with them and try some common themes and see what I can get out of it.
     
  15. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    okay i have perfect reconstruction, so don't worry about that anymore! i wasn't properly generating hi/lo clocks in the previous upload. not sure how something so simple got so confusing, but i replaced them with global clocks for 1/2 1/4 1/8, etc, and used the 'layers' value to choose the correct one for each macro.

    another method will be necessary in the future for CPU sake but right now i'm happy enough that it works.
     
  16. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Man, you can't just drop that bomb without telling me what the answer was!
     
  17. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    sorry i edited the post, read it again! i'll post it soon, just want to clean it up a bit.

    the new code works with your new coefficients, btw.
     
  18. BLOKDAK

    BLOKDAK Member

    Messages:
    211
    Phew, that's a relief. I thought I was losing my mind with the filters - wait, did you need to change them to make it work?
     
  19. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    i thought it worked with your new coefficients, but i had to use the old 'First' wavelet. everything else worked. (your first wavelet causes a tiny bit of distortion you can see when the chirp is in the higher regions)
     
  20. salamanderanagram

    salamanderanagram NI Product Owner

    Messages:
    3,454
    okay here it is.

    i'm very excited about this!
     

    Attached Files: