New stuff ++

This commit is contained in:
Ryzerth
2020-08-21 15:34:50 +02:00
parent 709627a738
commit aa2caa67ad
16 changed files with 407 additions and 252 deletions

View File

@@ -265,6 +265,16 @@ namespace dsp {
}
}
void setBandwidth(float bandwidth) {
_bandWidth = bandwidth;
if (_mode == MODE_USB) {
lo.setFrequency(_bandWidth / 2.0f);
}
else if (_mode == MODE_LSB) {
lo.setFrequency(-_bandWidth / 2.0f);
}
}
stream<float> output;
enum {

View File

@@ -25,8 +25,9 @@ namespace dsp {
if (_M % 2 == 0) { _M++; }
float M = _M;
float sum = 0.0f;
float val;
for (int i = 0; i < _M; i++) {
float val = (sin(2.0f * M_PI * fc * ((float)i - (M / 2))) / ((float)i - (M / 2))) * (0.42f - (0.5f * cos(2.0f * M_PI / M)) + (0.8f * cos(4.0f * M_PI / M)));
val = (sin(2.0f * M_PI * fc * ((float)i - (M / 2))) / ((float)i - (M / 2))) * (0.42f - (0.5f * cos(2.0f * M_PI / M)) + (0.8f * cos(4.0f * M_PI / M)));
taps.push_back(val);
sum += val;
}
@@ -456,8 +457,6 @@ namespace dsp {
float dt = 1.0f / _this->_sampleRate;
float alpha = dt / (_this->_tau + dt);
spdlog::warn("Deemp filter started: {0}, {1}", _this->_tau * 1000000.0, _this->_sampleRate);
while (true) {
if (_this->_in->read(inBuf, count) < 0) { break; };
if (_this->bypass) {