forked from len0rd/rockbox
New plugin: FFT, A frequency analyzer plugin
There is some more work needed: - Keymaps are definitely not perfect, touchscreen targets are disabled due to no keymap - There is no manual yet Author: Delyan Kratunov Flyspray: FS#10065 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24587 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
fa4ab10bbb
commit
43264a946f
19 changed files with 4810 additions and 0 deletions
28
apps/plugins/fft/math.h
Normal file
28
apps/plugins/fft/math.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef __MATH_H_
|
||||
#define __MATH_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <math.h>
|
||||
#include "lib/fixedpoint.h"
|
||||
|
||||
#define Q_MUL(a, b, bits) (( (int64_t) (a) * (int64_t) (b) ) >> (bits))
|
||||
#define Q15_MUL(a, b) Q_MUL(a,b,15)
|
||||
#define Q16_MUL(a, b) Q_MUL(a,b,16)
|
||||
|
||||
#define Q_DIV(a, b, bits) ( (((int64_t) (a)) << (bits)) / (b) )
|
||||
#define Q15_DIV(a, b) Q_DIV(a,b,15)
|
||||
#define Q16_DIV(a, b) Q_DIV(a,b,16)
|
||||
|
||||
#define float_q(a, bits) (int32_t)( ((float)(a)) *(1<<(bits)))
|
||||
#define float_q15(a) float_q(a, 15)
|
||||
#define float_q16(a) float_q(a, 16)
|
||||
|
||||
/**
|
||||
* Fixed point square root via Newton-Raphson.
|
||||
* @param a square root argument.
|
||||
* @param fracbits specifies number of fractional bits in argument.
|
||||
* @return Square root of argument in same fixed point format as input.
|
||||
*/
|
||||
int64_t fsqrt64(int64_t a, unsigned int fracbits);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue