Windowing option added to sampling

This commit is contained in:
Jan Käberich 2020-09-16 16:13:06 +02:00
parent de8761545d
commit d9d00b8c71
23 changed files with 1267 additions and 493 deletions

View file

@ -187,6 +187,11 @@ bool MAX2871::SetFrequency(uint64_t f) {
auto approx = Algorithm::BestRationalApproximation(fraction, 4095);
if(approx.denom == 1) {
// M value must be at least 2
approx.denom = 2;
}
int32_t rem_approx = ((uint64_t) f_PFD * approx.num) / approx.denom;
if(rem_approx != rem_f) {
LOG_WARN("Best match is F=%u/M=%u, deviation of %luHz",