mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 19:23:51 +01:00
update
This commit is contained in:
@@ -17,9 +17,11 @@ void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
|
|||||||
float measure_mpx(MPXPowerMeasurement* mpx, int deviation) {
|
float measure_mpx(MPXPowerMeasurement* mpx, int deviation) {
|
||||||
mpx->sample += deviation;
|
mpx->sample += deviation;
|
||||||
|
|
||||||
float avg_deviation = mpx->sample/mpx->i;
|
float avg_deviation = (float)mpx->sample / mpx->i;
|
||||||
float modulation_power = deviation_to_dbr(avg_deviation);
|
float modulation_power = deviation_to_dbr(avg_deviation);
|
||||||
|
|
||||||
|
mpx->i++;
|
||||||
|
|
||||||
if (mpx->i >= mpx->sample_rate*60) {
|
if (mpx->i >= mpx->sample_rate*60) {
|
||||||
mpx->sample = 0;
|
mpx->sample = 0;
|
||||||
mpx->i = 1;
|
mpx->i = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user