Nic Roets
2005-Sep-27 14:23 UTC
[Speex-dev] Precomputing the remaining floating pointoperations.
Firstly, running for more channels will not break my hack. All that's needed
is to call RECOPLAY_MARK with different identifiers (say nb, wb or uwb)
before doing the appropriate initialization.
Secondly, my attempts to do the Gaussian in fixed point went like this :
Define a new constant lag_factor_gauss that is manually set equal to
exp(sqr(2*M_PI*lag_factor)/-2) by whoever changes the lag_factor. From bash
you can say
echo 'e((8*a(1)*.012)^2/-2)' |bc -l
Then we can replace the code in the init functions with :
gauss = 16384;
for (i=0;i<st->lpcSize+1;i++) {
st->lagWindow[i]=gauss;
for (j=i*i; j < (i+1)*(i+1); j++) {
gauss = MULT16_16_Q15 (gauss, st->lag_factor_gauss);
}
}
A Taylor expansion will be more accurate.
Jean-Marc Valin
2005-Sep-27 17:16 UTC
[Speex-dev] Precomputing the remaining floating pointoperations.
Le mardi 27 septembre 2005 ? 23:24 +0200, Nic Roets a ?crit :> Firstly, running for more channels will not break my hack. All that's needed > is to call RECOPLAY_MARK with different identifiers (say nb, wb or uwb) > before doing the appropriate initialization.Still, too many ways it can fail. You can maintain it as a separate patch it you like, but this is not going in the main tree.> Secondly, my attempts to do the Gaussian in fixed point went like this :...> for (i=0;i<st->lpcSize+1;i++) { > st->lagWindow[i]=gauss; > for (j=i*i; j < (i+1)*(i+1); j++) { > gauss = MULT16_16_Q15 (gauss, st->lag_factor_gauss); > } > }Way more complicated that it needs to be> A Taylor expansion will be more accurate.Not only more accurate, but a lot simpler because I'm only using a very small portion of the gaussian. I think a third order approximation would work.