0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00

correct the fm mod

This commit is contained in:
2025-03-10 21:44:42 +01:00
parent 67fe502183
commit b3303abded
3 changed files with 3 additions and 24 deletions

View File

@@ -13,20 +13,4 @@ float apply_preemphasis(ResistorCapacitor *filter, float sample) {
float hard_clip(float sample, float threshold) {
// Branchless clipping
return fmaxf(-threshold, fminf(threshold, sample));
}
float voltage_db_to_voltage(float db) {
return powf(10.0f, db / 20.0f);
}
float power_db_to_voltage(float db) {
return powf(10.0f, db / 10.0f);
}
float voltage_to_voltage_db(float linear) {
return 20.0f * log10f(fmaxf(linear, 1e-10f)); // Avoid log(0)
}
float voltage_to_power_db(float linear) {
return 10.0f * log10f(fmaxf(linear, 1e-10f)); // Avoid log(0)
}
}