1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-28 13:04:17 -04:00

Added Kaiser window

This commit is contained in:
f4exb
2020-02-03 14:37:29 +01:00
parent 738d069386
commit 8a5daee1b8
4 changed files with 73 additions and 2 deletions
+29 -1
View File
@@ -18,12 +18,39 @@
#include "dsp/fftwindow.h"
FFTWindow::FFTWindow() :
m_kaiserAlpha(2.15) // beta = 6.76 first sidelobe at -70dB
{
m_kaiserI0Alpha = zeroethOrderBessel(m_kaiserAlpha);
}
void FFTWindow::setKaiserAlpha(Real alpha)
{
m_kaiserAlpha = alpha;
m_kaiserI0Alpha = zeroethOrderBessel(m_kaiserAlpha);
}
void FFTWindow::setKaiserBeta(Real beta)
{
m_kaiserAlpha = beta / M_PI;
m_kaiserI0Alpha = zeroethOrderBessel(m_kaiserAlpha);
}
void FFTWindow::create(Function function, int n)
{
Real (*wFunc)(Real n, Real i);
m_window.clear();
if (function == Kaiser) // Kaiser special case
{
for(int i = 0; i < n; i++) {
m_window.push_back(kaiser(n, i));
}
return;
}
switch(function) {
case Flattop:
wFunc = flatTop;
@@ -51,8 +78,9 @@ void FFTWindow::create(Function function, int n)
break;
}
for(int i = 0; i < n; i++)
for(int i = 0; i < n; i++) {
m_window.push_back(wFunc(n, i));
}
}
void FFTWindow::apply(const std::vector<Real>& in, std::vector<Real>* out)