mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-27 03:23:54 +01:00
change the mpx power a bit
This commit is contained in:
@@ -11,8 +11,12 @@ float measure_mpx(MPXPowerMeasurement* mpx, int deviation) {
|
|||||||
mpx->i++;
|
mpx->i++;
|
||||||
float modulation_power = mpx->sample/mpx->i;
|
float modulation_power = mpx->sample/mpx->i;
|
||||||
if (mpx->i >= mpx->sample_rate) {
|
if (mpx->i >= mpx->sample_rate) {
|
||||||
mpx->sample = 0.0f;
|
mpx->sample = modulation_power;
|
||||||
mpx->i = 0;
|
mpx->i = 0;
|
||||||
}
|
}
|
||||||
return modulation_power;
|
return modulation_power;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float dbr_to_deviation(float dbr) {
|
||||||
|
return 19000.0f * powf(10.0f, dbr / 10.0f);
|
||||||
|
}
|
||||||
@@ -11,3 +11,5 @@ typedef struct
|
|||||||
void init_modulation_power_measure(MPXPowerMeasurement *mpx, int sample_rate);
|
void init_modulation_power_measure(MPXPowerMeasurement *mpx, int sample_rate);
|
||||||
|
|
||||||
float measure_mpx(MPXPowerMeasurement *mpx, int deviation);
|
float measure_mpx(MPXPowerMeasurement *mpx, int deviation);
|
||||||
|
|
||||||
|
float dbr_to_deviation(float dbr);
|
||||||
|
|||||||
Reference in New Issue
Block a user