Re: Loudness change when writing/reading fft data from matrix


Forums > MaxMSP > Loudness change when writing/reading fft data from matrix
August 24, 2010 | 8:34 pm

Ok, I’m going to code this up in Java (at least there its clearer whats happening when). I just need a little guidance on the math for the phase accumulation.

So I have the code built to maintain a record of the current fft vector of amplitude, phase values and phase differences (output from framedelta~).
When the toggle is off (0 sent to the object) the amplitude and phase values pass through unchanged and are stored in the object’s buffer.
When the toggle is on the object waits until an index of 0 is reached (start of new vector) and outputs what was previously written to the object’s buffer.
The phase values are computed as follows:

stored phase[i] = stored phase[i] + delta phase[i]
output phase[i] = stored phase[i]

where ‘stored phase’ is initially set to phase values of the fft frame right before the freezing is enabled (ditto for delta phase). ‘i’ represents the bin index.

The phase is then sent to phasewrap~

Looking at the output values before phasewrap~, the values typically increase in the positive or negative direction, I suspect thats fine though.

The problem is I’m getting some distortion, it happens gradually and periodically over the course of a few seconds. Is this the error accumulation you were talking about Alex?