xiph / rnnoise

Recurrent neural network for audio noise reduction
BSD 3-Clause "New" or "Revised" License
3.97k stars 890 forks source link

A question about the adaptation for different frame size e.g. 10ms 22band #145

Open 20050710212 opened 3 years ago

20050710212 commented 3 years ago

Thank you for the fantastic work. In denoise.c, line 193, should I change the 22 to be NB_BANDS for different NB_BANDS? out[i] = sum*sqrt(2./NB_BANDS);

My configuration is 10ms per frame, and 16kHz. Other modification I have done:

  1. in the denoise.c
    
    #define FRAME_SIZE_SHIFT 1
    #define FRAME_SIZE (80)
    #define WINDOW_SIZE (2*FRAME_SIZE)
    #define FREQ_SIZE (FRAME_SIZE + 1)

define PITCH_MIN_PERIOD 20

define PITCH_MAX_PERIOD 256

define PITCH_FRAME_SIZE 320

static const opus_int16 eband5ms[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 17, 20, 24, 28, 33, 39, 47,57, 68, 80 }

features[NB_BANDS+3NB_DELTA_CEPS] = .01(pitch_index-100);


2. in the _rnnoise_demo.c_
`#define FRAME_SIZE 160`

I suppose many pepole want to change the sampling frequency, frame size and NB_BANDS. I hope we can share the ideas in this issue. I'd appreciate any help.
Zadagu commented 3 years ago

There are many open issues regarding the sampling frequency. Please use the search function! The short answer is: This is not sufficient. There is some pitch filtering/correlation done, which wont work, if you change the sampling frequency.

zuowanbushiwo commented 2 years ago

@Zadagu
I also want training sample's sample rate is 16000, how to change pitch_downsample,pitch_search,remove_doubling those funtions? I have searched all issues but didn't find the answer,Can you give some guidance? Thanks!

pallaswept commented 1 year ago

I'm also very interested in a 10ms window variant. I made an issue about this upstream: https://gitlab.xiph.org/xiph/rnnoise/-/issues/9. I'm fine with the stock 48kHz sample rate and band count, just the window size is a big deal for me. If you have any advice on how to go about this, I'd love to hear it!