sergree / matchering

🎚️ Open Source Audio Matching and Mastering
https://pypi.org/project/matchering/
GNU General Public License v3.0
1.29k stars 151 forks source link

Clips on final result #31

Closed nicolasegala closed 2 years ago

nicolasegala commented 3 years ago

Hi sergree, I have noticed that sometimes, for instance when the target audio has bad resolution, the final result has clips. I really appreciate your work and I have seen your video tutorial on 'How it Works'. Correct me if I am wrong, your procedure of chopping the audio seems to me related to the fact that you have fixed the FFT number of samples in order to compute the mid FIR filters. This procedure resembles to me as trying to mimic the STFT algorithm. Since you have fixed the FFT number of samples you probably do convolutions on the chopped audio samples that you used to compute the FFTs or to the full audio file performing a zero padding technique . This procedure it's probably the cause of the clips in the final result. Why you don't consider the Gabor transform instead? Setting the standard deviation of the Gaussian and the number of centers in order to control time-frequency resolution. This procedure is done to the full audio and should not be affected by the picket fence effect. If the problem is the efficiency of the algorithm you should look for a GPU implementation. Best regards

sergree commented 3 years ago

Hello @nicolasegala! I don't often meet people who are good at math, it's nice to meet you. 😀

Yes, this is STFT: https://github.com/sergree/matchering/blob/master/matchering/stage_helpers/match_frequencies.py#L33

But it is only used to calculate the matching filter FIR: https://github.com/sergree/matchering/blob/master/matchering/stages.py#L119

This FIR is then used in the convolution (on an unchopped input): https://github.com/sergree/matchering/blob/master/matchering/stage_helpers/match_frequencies.py#L112

Using this scipy function: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.fftconvolve.html

Not sure if it can make clips.. Considering that the audio is then processed by the brickwall limiter.

I assume that other types of distortion appear here. Maybe the target has very little information in the side channel, and you hear the rounding noise. I can't say for sure. You can send your files to me by email, I'll see what the problem is: wokashi.rg@gmail.com

🤗