mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Everywhere: Use AK/Math.h if applicable
AK's version should see better inlining behaviors, than the LibM one. We avoid mixed usage for now though. Also clean up some stale math includes and improper floatingpoint usage.
This commit is contained in:
parent
c5f6ba6e71
commit
ed46d52252
40 changed files with 116 additions and 156 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "AudioAlgorithms.h"
|
||||
#include <AK/Complex.h>
|
||||
#include <math.h>
|
||||
#include <AK/Math.h>
|
||||
|
||||
// This function uses the input vector as output too. therefore, if you wish to
|
||||
// leave it intact, pass a copy to this function
|
||||
|
@ -38,8 +38,8 @@ void fft(Vector<Complex<double>>& sample_data, bool invert)
|
|||
}
|
||||
|
||||
for (int len = 2; len <= n; len <<= 1) {
|
||||
double ang = 2 * M_PI / len * (invert ? -1 : 1);
|
||||
Complex<double> wlen(cos(ang), sin(ang));
|
||||
double ang = 2 * AK::Pi<double> / len * (invert ? -1 : 1);
|
||||
Complex<double> wlen(AK::cos(ang), AK::sin(ang));
|
||||
for (int i = 0; i < n; i += len) {
|
||||
Complex<double> w = { 1., 0. };
|
||||
for (int j = 0; j < len / 2; j++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue