use negative frequency for demod

This commit is contained in:
Sébastien Bourdeauducq 2024-12-28 19:05:02 +08:00
parent 36a2405f83
commit 3895b13662

View File

@ -108,7 +108,7 @@ static void dsp_thread()
sample += (double)buf_in[SND_RCHAN*j+k];
std::complex<double> rotated;
rotated = sample*std::polar(scale, phase_in[i]*2.0*M_PI/(double)UINT32_MAX);
phase_in[i] += ftw[i]; // wraps on underflow
phase_in[i] -= ftw[i]; // wraps on underflow
lpf_y[i] += (rotated - lpf_y[i])*lpf_k[i];
double mag = std::abs(lpf_y[i]);