More DSP cleanup + Remove FastFFT option because it should never be used

This commit is contained in:
AlexandreRouma
2022-07-27 21:35:36 +02:00
parent 8efd5cd01a
commit 575a941e24
25 changed files with 335 additions and 86 deletions

View File

@@ -4,13 +4,13 @@
#include "estimate_tap_count.h"
#include "../window/nuttall.h"
#include "../math/phasor.h"
#include "../math/freq_to_omega.h"
#include "../math/hz_to_rads.h"
namespace dsp::taps {
template<class T>
inline tap<T> bandPass(double bandStart, double bandStop, double transWidth, double sampleRate, bool oddTapCount = false) {
assert(bandStop > bandStart);
float offsetOmega = math::freqToOmega((bandStart + bandStop) / 2.0, sampleRate);
float offsetOmega = math::hzToRads((bandStart + bandStop) / 2.0, sampleRate);
int count = estimateTapCount(transWidth, sampleRate);
if (oddTapCount && !(count % 2)) { count++; }
return windowedSinc<T>(count, (bandStop - bandStart) / 2.0, sampleRate, [=](double n, double N) {

View File

@@ -1,7 +1,7 @@
#pragma once
#include "tap.h"
#include "../math/sinc.h"
#include "../math/freq_to_omega.h"
#include "../math/hz_to_rads.h"
#include "../window/nuttall.h"
namespace dsp::taps {

View File

@@ -1,7 +1,7 @@
#pragma once
#include "tap.h"
#include "../math/sinc.h"
#include "../math/freq_to_omega.h"
#include "../math/hz_to_rads.h"
#include "../window/nuttall.h"
namespace dsp::taps {
@@ -30,6 +30,6 @@ namespace dsp::taps {
template<class T, typename Func>
inline tap<T> windowedSinc(int count, double cutoff, double samplerate, Func window, double norm = 1.0) {
return windowedSinc<T>(count, math::freqToOmega(cutoff, samplerate), window, norm);
return windowedSinc<T>(count, math::hzToRads(cutoff, samplerate), window, norm);
}
}