[Speex-dev] Fwd: Re: Fixed Point on wideband-mode: Single Frame loss on 2000 Hz sine causes "freak off"

Jean-Marc Valin Jean-Marc.Valin at USherbrooke.ca
Mon Feb 1 08:04:12 PST 2010

Hi Frank,

Quoting Frank Lorenz <Frank_wtal at web.de>:
> > It's expected that the actual pitch period be different (especially for
> > a sine because there can be more than one pitch period that fits
> > perfectly). What's important is that after removing the pitch, the
> > residual should be small.
> I think there's some misunderstanding here: I meant the pitch value is
> different *between* fixed and floating point. While for floating point it
> looks more or less "random", you can see a clear preference for value of 80
> (which is 10 periods of the 2000 Hz input signal) in fixed point.

Yes, it's expected to be different between fixed and float because and tiny
rounding error can cause the pitch to change (between mostly equivalent
choices). I would even expect two float version compiled differently to produce
different results just due to small rounding errors in the float.

> My understanding of fixed point coding is that any (rounding) differences
> caused by fixed point arithmetic must be so small that they do not alter the
> parameters (like pitch, pitch gain, LPC etc.). This is not the case here --
> something messes up at least the pitch value. Or behaves the fixed-point
> arithmetic inside speex different from my assumption?

The rounding differences are small, but they are enough to swing close decisions
in different directions. And once you have a single change, it can affect later
decisions in the encoder. OTOH, on the *decoder*, float and fixed-point should
be much more similar because there are no decisions to make (it's all in the

> > So you already took the scaledown into account? If that's the case, it
> > looks a bit more odd, but I'm not ready to say that's definitely the
> > problem. Just curious, does the problem occur if the signal's amplitude
> > is lower?
> For a 2000 Hz sine, a -42 dBFs signal still "freaks out", -43 dBFS and below
> is stable.
> For such small signals, scaledown will always be 0 (or am I wrong?)

How do you define dBFs? What if you feed a sine signal that never exceeds +/-
8000 in short.


More information about the Speex-dev mailing list