mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
fast_pow2() implemented.
This commit is contained in:
parent
d2531016e5
commit
64e4cde7f5
@ -73,6 +73,15 @@ float fast_log2(const float val) {
|
||||
return log_2;
|
||||
}
|
||||
|
||||
float fast_pow2(const float val) {
|
||||
union {
|
||||
float f;
|
||||
uint32_t n;
|
||||
} u;
|
||||
u.n = val * 8388608 + (0x3f800000 - 60801 * 8);
|
||||
return u.f;
|
||||
}
|
||||
|
||||
float complex16_mag_squared_to_dbv_norm(const float c16_mag_squared) {
|
||||
constexpr float input_component_max = 32768;
|
||||
constexpr float mag2_max = (input_component_max * input_component_max) * 2;
|
||||
|
@ -70,6 +70,7 @@ constexpr size_t log_2(const size_t n, const size_t p = 0) {
|
||||
}
|
||||
|
||||
float fast_log2(const float val);
|
||||
float fast_pow2(const float val);
|
||||
|
||||
float complex16_mag_squared_to_dbv_norm(const float c16_mag_squared);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user