Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving accuracy in goutbins calc in DFT32.c #92

Open
bbkiwi opened this issue Jul 4, 2019 · 2 comments
Open

Improving accuracy in goutbins calc in DFT32.c #92

bbkiwi opened this issue Jul 4, 2019 · 2 comments

Comments

@bbkiwi
Copy link
Contributor

bbkiwi commented Jul 4, 2019

No description provided.

@bbkiwi
Copy link
Contributor Author

bbkiwi commented Jul 4, 2019

In the orginal code isps and ispc loose 16 bits accuracy to prevent overflow at line 197 when they are squared. With the APPROXNORM == 1 option this was not neccessary. However isps and ispc are also used to compute goutbins in the non-CCEMBEDDED case. With floating point calculations the higher accuracy values should be used. I think it would be better to always compute isps and ispc as in lines 172 and 173 irregardless of APPROXNORM.
Calculate 185 by
float mux = ( ((float)isps) * ((float)isps)) + (((float)ispc) * ((float)ispc));
goutbins[i] = sqrtf( (float)mux )/65536.0;
Calculate 197 by
uint32_t rmux = ( (isps>>16) * (isps>>16)) + ((ispc>>16) * (ispc>>16));

@bbkiwi
Copy link
Contributor Author

bbkiwi commented Jul 6, 2019

See #93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant