0

I am implementation a convolution reverb method for audios array in Python using scipy.signal.convolve. I choose the fft mode, which essentially a product of the rfft of the two signals then ifft back.

What I am not sure is how to perform the convolution without changing the amplitude of the original signal. My audio sample is normalized to -1. to 1.0. And the impulse response (ir) is not normalized but has a peak value near 1.0.

A direct convolve(signal, ir) will result a new signal that has the amplitude of over -6.0 to 6.0. This of course results in a massive clipping during playback. Of course I can reduce the amplitude of the ir to bring down the level. However, I don't know what is the mathematical relationship here in order to achieve the same amplitude.

Thank you in advance for your advice.

J_yang
  • 101
  • 1
  • (very, very, very many questions when you search for [fft] normalization or [fft] scaling on this site. I just picked the first one.) – Marcus Müller Jun 30 '20 at 18:54
  • IR normalized in time domain doesn't ensure the same energy after convolution. In fact, it's hardly a case. – jojeck Jun 30 '20 at 19:02
  • @jojek, the IR is not normalized. It is just happen the room ir I downloaded has a peak value near 1. – J_yang Jun 30 '20 at 19:04
  • Treat IR as a filter where 0 dB is anechoic environment. Then, assuming that your original recordings have reference SPL levels, you have the right result. Otherwise, your best choice is to guess how loud would be that signal in this acoustic space. Anyway, depending on your application, normalizing the output might be enough. – jojeck Jun 30 '20 at 19:12
  • @jojek As this is intended as a general method, I cannot anticipate what the reference SPL level might be. So is it ok to just take the max(abs(original_signal) then multiply by the normalized(result) ? – J_yang Jun 30 '20 at 19:28
  • @MarcusMüller, Thanks. I am not sure if it does. If we normalize the fft, if I have an input signal that is very quiet and not normalized. Will I end by with a much louder and normalized convolved result? – J_yang Jun 30 '20 at 19:32
  • There is no “general method” really. It depends on what you want to settle. You might for example calculate the energy of the signal before convolution and normalise the result so it has the same energy as before. This won’t however ensure that the output won’t be clipped in certain cases. – jojeck Jun 30 '20 at 21:50

0 Answers0