gdalsanto / diff-fdn-colorless

Companion code of DAFx23 "Differentiable Feedback Delay Network for Colorless Reverberation"
http://research.spa.aalto.fi/publications/papers/dafx23-colorless-fdn/
MIT License
37 stars 3 forks source link

Adaptive Correction factor #3

Open tarlanahad opened 2 months ago

tarlanahad commented 2 months ago

You have provided a way to supress high range frequencies in FDN.

def get_center_freq(self):
        # TODO compute them for a given min ad max frequency
        if self.octave == 1:
            self.f_bands = [63, 125, 250, 500, 1000, 2000, 4000, 8000]   
            self.correction = np.array([5, 0, 0, 0, 0, 0, 0, 0, 5, 30]) 
        elif self.octave == 3:
            self.f_bands = [63, 80, 100, 125, 160, 200, 250, 315, 400, 500, 630, 800, 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000]
            self.correction = np.array([5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 5, 30])
        else:
            ValueError('Resolutions different form one or one-third octave bands are not supported at the moment')

Would you recommend any adaptive method to change values in the variables correction for maximum similarity between FDN IR and reference IR?

Upon recommendation, I can do it and request you to contribute as well.

Thanks!

gdalsanto commented 1 month ago

Hi @tarlanahad! That’s a great question. Adjusting the frequency response of the attenuation filters to improve the match between the target and synthesized RIR is a task that deserves careful study. However, since you have the reference T60 curve, you could iteratively adjust the command gains of the GEQ after analyzing the T60 curve of the synthesized RIR until you achieve a perfect match.

Personally, I’m exploring "lazier" methods for this adjustment. As a proof of concept (though not a perfectly working approach yet), we tried optimizing the command gains of a differentiable graphic equalizer using gradient descent and a cost function based on the STFTs of the target and reference RIRs. You can check it out in my other repository, which is dedicated to a PyTorch library that @GianMarcoDeBortoli and I have been working on recently.

Let me know if it helps!

tarlanahad commented 1 month ago

I did the iterative FDN, however, although the match between target T60 and L values are perfect (virtually the same) it brings the metallic colour of the FDN back, unfortunately. It probably happens because adjustment changes the modal excitation distribution of FDN back to the unoptimized version.

I will analyze the STFT based method mentioned. Thanks so much for the response!