[Speex-dev] Speex sound a little artificial?

Steve Kann stevek at stevek.com
Tue Jan 4 06:31:15 PST 2005


Massimo wrote:

> Il ven, 2004-12-31 alle 20:19, Jean-Marc Valin ha scritto:
>
>>/DC (aka frequency zero) means that the signal isn't centered around
>>zero. When there's a DC or lots of low frequencies, Speex cannot do a
>>very good job./
>>
> Since in the future I'll hopefully have some time to experience Speex, 
> this catched my attention.
> How can I understand when I got a DC?
> I have an idea which is to look all the samples for min/max values and 
> translate them but it looks way too much simple to work.


This isn't speex-specific, although other codecs may do this internally, 
or may not be sensitive to it, but it's a good idea anyway (otherwise, 
you can't get the actual energy level, etc).

You can remove DC like this:

    static long bias = 0;

    /* remove bias -- whether ec is on or not. */
    for(i = 0; i < n; i++) {
        bias +=  ((((long)inputBuffer[i]) << 15) - bias) >> 14;
        inputBuffer[i] -= (bias >> 15);
    }

(or, you could just to the inside of the loop for each sample, in a 
different loop; it needn't be in it's own loop).


-SteveK

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20050104/3bdedccb/attachment.htm


More information about the Speex-dev mailing list