EzFFT Phase Retrieval/Reconstruction - Phase Gradient Heap Integration Algorithm

Member Posts: 7 Newcomer
edited March 31

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

Tagged:

• Member Posts: 555 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/

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?

edited March 31

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

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

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.