Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noise suppression fine tune #246

Open
aaronhsueh0506 opened this issue Jan 31, 2023 · 8 comments
Open

Noise suppression fine tune #246

aaronhsueh0506 opened this issue Jan 31, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@aaronhsueh0506
Copy link

Hi Rikorose,

I'm trying to fine tune some effects, do you have any suggestions for these points?

  1. In harsh environments (lower SNR), since the dataset only yields -5 to 45 dB SNR, the resulting spectrogram has little above 5kHz, can it be improved?
  2. I want to enhance the effect of 8kHz to 14kHz and increase the brightness of the human voice. Can this be improved through post-processing?
  3. In PercepNet, it adds global gain while using warped gain. Do we need to do the same thing here?

Thanks,
Aaron

@Rikorose Rikorose added the enhancement New feature or request label Feb 3, 2023
@Rikorose
Copy link
Owner

Rikorose commented Feb 3, 2023

  1. Most probably. One could think about adding a connection from a later stage of the DF decoder to the ERB decoder. This however would not allow to only run the ERB decoder without the DF decoder anymore.
  2. This idea is partly implemented within the air absorption distortion, but not properly tested.
  3. Not sure what you mean here. What formula do you mean?

@aaronhsueh0506
Copy link
Author

aaronhsueh0506 commented Mar 2, 2023

Hi,

I found the result is good while using your website.
Because I re-train the model by Keras, and Keras do not support grouped Conv2DTranspose layer.
I will try to figure out the difference between Keras and Torch.

Best regards,
Aaron

@aaronhsueh0506
Copy link
Author

aaronhsueh0506 commented Mar 7, 2023

Hi,

I am checking the model inputs and found some differences.
I can use numpy.rfft, vorbis window, and stft_norm get the same value with stft function.

stft_norm = 1 / (n_fft ** 2 / (2 * hop))
    spec = torch.stft(
                audio, n_fft=n_fft, hop_length=hop, window=torch.Tensor(vorbis_window(n_fft)),
                return_complex=True, normalized=False, center=False
            ).transpose(1, 2)

But I found when I send the same signal to df.analysis or df_features in enhance.py, I get different spec with this stft function.
Is there any different?

Another question, is dB rescale important for ERB?

Thanks,

@Rikorose
Copy link
Owner

Rikorose commented Mar 7, 2023

Code looks good, not sure where you get some differences. dB scaling is important since the raw amplitude does not correlate well with human loudness perception and is thus not a good feature.

@aaronhsueh0506
Copy link
Author

aaronhsueh0506 commented Mar 7, 2023

Hi,

I try to use this command in enhance.py.
spec, erb_feat, spec_feat = df_features(audio, df_state, device=get_device())
and save spec as a npy files.

Also, use

spec = torch.stft(
                audio, n_fft=n_fft, hop_length=hop, window=torch.Tensor(vorbis_window(n_fft)),
                return_complex=True, normalized=False, center=False
            ).transpose(1, 2) * stft_norm

But these two functions get different values of spec.

@DonkeyHang
Copy link

Hi,

I try to use this command in enhance.py. spec, erb_feat, spec_feat = df_features(audio, df_state, device=get_device()) and save spec as a npy files.

Also, use

spec = torch.stft(
                audio, n_fft=n_fft, hop_length=hop, window=torch.Tensor(vorbis_window(n_fft)),
                return_complex=True, normalized=False, center=False
            ).transpose(1, 2) * stft_norm

But these two functions get different values of spec.

i have the same question, so are you guess about answer?

for the stream process mode, every process i only have 480 samples(48k ssamplerate and 10ms data), if i had 480 samples delay and 480 samples overlap, neither vobis window and np.fft and torch.fft, it was different result with spec in df.analysis,
it make me confuse...

@aaronhsueh0506
Copy link
Author

Hi,

FFT in torch will multiply (nfft ^ -0.5) while normalized default is True, and IFFT will diverse it.

@qiuqiu-879
Copy link

Hello. I would like to know how the df.analysis function in df_feature work. I directly spec = torch.stft( audio, n_fft=n_fft, hop_length=hop, window=torch.Tensor(vorbis_window(n_fft)), return_complex=True, normalized=False, center=False ).transpose(1, 2), but the result I got is different from that of the df.analysis. Could you please explain the possible reasons ? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants