Convolution Reverb Calculation Here's my basic understanding of how to implement a convolution reverb:

I measure the IR of a space using a sine sweep. The raw mic output is stored as a Voltage-Time data set. Let's assume that this recording is 5s long.

I run a fft on the recorded mic output to derive the Mag and Phase at every frequency bin. Call this the &quot;IR Buffer&quot;.

Next, I have my music source. Let's say it's a vocal track that's playing in real-time. I record this vocal track into a 5s buffer.

Similar to step 2, I run a fft to extract the vocal track buffer's Mag and Phase values at every frequency.

Then, I multiply the Mag and Phase values of the vocal track with that of the IR Buffer at every frequency bin.

Finally, I run a ifft on the multiplied buffer and play the output as the reverb'd vocal track.


Is my understanding above correct?
What I'm very uncertain about is that it looks more like I've created a simple EQ rather reverb.
More specifically, I can't figure out how to extract and apply the time-variant Mag and Phase characteristic of the reverb space. For example, there's a certain decay time for 100Hz in the space, which means that Mag and Phase varies with time for this frequency. How is this time-variant component added to the vocal track?
First, you have to extract the Room Impulse Response (RIR) of the space from your sine sweep recordings. You can do this by taking the ratio of the FFTs of the  measured response and sine sweep input and then taking its IFFT, rir = ifft(fft(measured, Nfft)./fft(sin_sweep,Nfft)). I generally use Nfft = 2^nextpow2(length(measured))
You can truncate the RIR to $L$ samples, depending on how long the reverb tail is.
Break your music source into frames of $M$ samples.
For each frame, you want to convolve a signal of length $M$ with the RIR of length $L$. The output of the resultant convolution will be $M+L-1$ samples. So you have to pick an FFT size accordingly. Then multiply the FFT of the current frame of the signal, with the FFT of the RIR.
The final step is overlap add.

Here is some MATLAB style code.
% sig - Input signal
% rir - Room Impulse Response extracted from sine sweep
% M - length of each frame
% L - length of the RIR 

nframes = round(length(sig)/M));
Nfft = 2^nextpow2(L+M-1);
conv_sig = zeros(nframes*M,1);
for frame_no = 1:nframes
    sig_frame = sig((frame_no-1)*M+1:frame_no*M);
    conv_frame = ifft(fft(sig_frame,Nfft).*fft(rir,Nfft));
    conv_frame = conv_frame(1:M+L-1);
    conv_sig((frame_no-1)*M+1:frame_no*M+L-1) = conv_sig((frame_no-1)*M+1:frame_no*M+L-1)+conv_frame
end