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:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user