EzFFT Phase Retrieval/Reconstruction - Phase Gradient Heap Integration Algorithm

StarRats
StarRats Member Posts: 18 Member
edited March 2023 in Building With Reaktor

Does anyone comprehend "the Phase Gradient Heap Integration" algorithm in EzFFT context and know how to implement it?

I need this in my custom-made macro which swaps (shifts) amplitude positions in ezfft, of course, the result of such an operation is spectral noise and jitter. I want to correct phases to fix the resulting signal to some extent at least.

Here is the paper:

https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7890450&isnumber=7895265

Comments

  • colB
    colB Member Posts: 762 Guru

    Jan Brahler has built some good phase vocoders based instruments using ezFFT, you might pick up some ideas looking through some of those:

    https://www.native-instruments.com/en/reaktor-community/reaktor-user-library/all/all/all/1126474/

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    reading the paper now but I'm afraid I don't have the mathematical literacy to fully absorb the meaning. reconstructing the phase from sampling the magnitude... what does that mean? like what do they mean by sampling?


    it reminds me of trying to understand the whole cepstrum thing where they say "take the log of the Fourier transform" without specifying which of the many possible ways something like that could be interpreted and at which step of the process


    I am familiar with the process of phase unwrapping to derive instantaneous frequency, can you speak on how this approach differs from that?


    have you tried using the phase unwrapping method?

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor
    edited March 2023

    here's bards answer fwiw, no idea how correct it is lol


    (redacted as brevity, wasn't terribly helpful 😋)

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    from chatGPT

    Here is a more detailed description of each step:

    1. Compute the STFT coefficients of the signal using a window function. The window function is typically chosen to balance the time and frequency resolution of the STFT.
    2. Compute the magnitude of the STFT coefficients. The magnitude represents the strength of the signal at each time-frequency point.
    3. Compute the log-magnitude of the STFT coefficients. This is done to make the phase information more easily accessible, as the phase information is encoded in the complex exponential part of the Fourier transform.
    4. Compute the second-order difference of the log-magnitude along the frequency axis. This measures the curvature of the log-magnitude along the frequency axis and provides information about the phase at each frequency.
    5. Compute the second-order difference of the log-magnitude along the time axis. This measures the curvature of the log-magnitude along the time axis and provides information about the phase at each time index.
    6. Estimate the phase functions for each frequency and time index by solving a set of linear equations that relate the phase to the second-order differences of the log-magnitude. The linear equations are derived from the assumption that the phase can be represented as a linear combination of phase functions that depend only on the frequency and time indices.
    7. Reconstruct the phase of the STFT coefficients by computing a linear combination of the estimated phase functions. This involves solving a linear system of equations that relates the phase to the estimated phase functions.
    8. Invert the STFT using the reconstructed phase and the original magnitude information to obtain the reconstructed signal. This is done by computing the inverse Fourier transform of the reconstructed STFT coefficients using an appropriate window function. The reconstructed signal should closely match the original signal, except for some phase ambiguity that is common to all Fourier-based reconstruction methods.


  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor
    edited March 2023

    so, apparently AI can explain research papers through every single step in excruciating detail like you're five years old and i have somehow only now fully realized this lol ROFL


    we may just be able to cook this up

    EDIT

    working my way through the algo, so far it has it taking second order differences instead of just the one like phase unwrapping (and also across the time axis AND frequency axis. interesting)

  • StarRats
    StarRats Member Posts: 18 Member

    Have you come with any correct workout?

    Would you define: 'second-order differences '? Does it have something to do with the second harmonic?

  • ANDREW221231
    ANDREW221231 Member Posts: 295 Advisor

    second order, if I'm not mistaken, in this case means taking the difference between the previous two samples instead of only one


    never ended up building this to completion, got bored lol. but I was thinking of circling back to it

Back To Top