[Speex-dev] Broken denoiser in SVN (?)

Dmitry Yakimov support at zipcure.com
Wed Dec 20 09:28:38 PST 2006


Hi,

I'm trying to use a denoiser on a wince with a FIXED_POINT defined.

Denoiser works OK - it removes the noise, but then it unacceptable hurts 
a voice.

Here is a code that I use:

#define TEST_DENOISE_SAMPLES 2000

void test_denoise()
{
    FILE *fin;
    FILE *fout;
    spx_int32_t rate=0;
    int chan=1;
    int fmt=16;
    int denoise_enabled = 1;
    SpeexPreprocessState *preprocess;
    fin = _tfopen(_T("Storage Card\\1.raw"), _T("rb"));
    if(!fin)
        return;
    fout = _tfopen(_T("Storage Card\\2.raw"), _T("wb"));
    if(!fout)
    {
        fclose(fin);
        return;
    }
    preprocess = speex_preprocess_state_init(TEST_DENOISE_SAMPLES, 11025);
    speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_DENOISE, 
&denoise_enabled);
    for(;;)
    {
        short buf[TEST_DENOISE_SAMPLES];
        int readed;
        readed = fread(buf, 2, TEST_DENOISE_SAMPLES, fin);
        if(readed != TEST_DENOISE_SAMPLES)
            break;
        speex_preprocess(preprocess, buf, NULL);
        fwrite(buf, 2, TEST_DENOISE_SAMPLES, fout);
    }
    speex_preprocess_state_destroy(preprocess);
    fclose(fout);
    fclose(fin);
}

Best Regards,
Dmitry Yakimov


More information about the Speex-dev mailing list