sound, minor FM filtering optimization
authorkub <derkub@gmail.com>
Sat, 30 Apr 2022 12:04:28 +0000 (14:04 +0200)
committerkub <derkub@gmail.com>
Sat, 30 Apr 2022 12:04:28 +0000 (14:04 +0200)
pico/sound/sound.c

index ae4bd3d..456d211 100644 (file)
@@ -89,7 +89,7 @@ static void YM2612_setup_FIR(int inrate, int outrate, int stereo)
       mindiff = diff;\r
       Pico.snd.fm_fir_mul = mul;\r
       Pico.snd.fm_fir_div = div;\r
-      if (abs(mindiff) <= inrate/1000) break; // below error limit\r
+      if (abs(mindiff) <= inrate/1000+1) break; // below error limit\r
     }\r
   }\r
   printf("FM polyphase FIR ratio=%d/%d error=%.3f%%\n",\r