diff --git a/README.md b/README.md index 65bd81b..2ab261b 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Should run completly fine on a pi 5, fine on a pi 3b (~30% cpu) FM95 also includes some other apps, such as chimer95 which generates GTS tones each half hour, and vban95 now which is a buffered VBAN receiver. And now also SCA generation was moved to sca95 from fm95! +## Feature Requests + +In case you are missing something, you can create an issue, and if you actually do need the feature and can prove it, and also provide/tell how to test the feature - any feature is welcome to be implemented (though i never said when will it be done) + ## Usage of other projects The apps use inih by Ben Hoyt. diff --git a/lib/oscillator.c b/lib/oscillator.c index 5fbfd05..6464e6e 100644 --- a/lib/oscillator.c +++ b/lib/oscillator.c @@ -2,7 +2,6 @@ void init_oscillator(Oscillator *osc, float frequency, float sample_rate) { osc->phase = 0.0f; - osc->unwrapped_phase = 0.0; osc->phase_increment = (M_2PI * frequency) / sample_rate; osc->sample_rate = sample_rate; } @@ -33,7 +32,6 @@ float get_oscillator_cos_multiplier_ni(Oscillator *osc, float multiplier) { inline bool advance_oscillator(Oscillator *osc) { osc->phase += osc->phase_increment; - osc->unwrapped_phase += osc->phase_increment; if (osc->phase >= M_2PI) { osc->phase -= M_2PI; return true; diff --git a/lib/oscillator.h b/lib/oscillator.h index 82c5a6c..94808f5 100644 --- a/lib/oscillator.h +++ b/lib/oscillator.h @@ -6,7 +6,6 @@ typedef struct { float phase; - double unwrapped_phase; float phase_increment; float sample_rate; } Oscillator; diff --git a/specifications/fm95/R-REC-BS.1194-2-199812-I!!PDF-E.pdf b/specifications/fm95/R-REC-BS.1194-2-199812-I!!PDF-E.pdf new file mode 100644 index 0000000..9adc738 Binary files /dev/null and b/specifications/fm95/R-REC-BS.1194-2-199812-I!!PDF-E.pdf differ diff --git a/specifications/fm95/R-REC-BS.1350-1-199812-I!!PDF-E.pdf b/specifications/fm95/R-REC-BS.1350-1-199812-I!!PDF-E.pdf new file mode 100644 index 0000000..a95fe1a Binary files /dev/null and b/specifications/fm95/R-REC-BS.1350-1-199812-I!!PDF-E.pdf differ diff --git a/specifications/fm95/R-REC-BS.412-9-199812-I!!PDF-E.pdf b/specifications/fm95/R-REC-BS.412-9-199812-I!!PDF-E.pdf new file mode 100644 index 0000000..e799c2b Binary files /dev/null and b/specifications/fm95/R-REC-BS.412-9-199812-I!!PDF-E.pdf differ diff --git a/specifications/fm95/R-REC-BS.643-4-202212-I!!PDF-E.pdf b/specifications/fm95/R-REC-BS.643-4-202212-I!!PDF-E.pdf new file mode 100644 index 0000000..0d3bf5b Binary files /dev/null and b/specifications/fm95/R-REC-BS.643-4-202212-I!!PDF-E.pdf differ diff --git a/specifications/fm95/R-REC-SM.1268-5-201908-I!!PDF-E.pdf b/specifications/fm95/R-REC-SM.1268-5-201908-I!!PDF-E.pdf new file mode 100644 index 0000000..81c8a40 Binary files /dev/null and b/specifications/fm95/R-REC-SM.1268-5-201908-I!!PDF-E.pdf differ diff --git a/src/fm95.c b/src/fm95.c index 66c7be4..c1e842b 100644 --- a/src/fm95.c +++ b/src/fm95.c @@ -257,7 +257,7 @@ int run_fm95(FM95_Config* config, FM95_Runtime* runtime, FM95_RunResult* result) uint8_t osc_stream = 12 + stream; if (osc_stream >= 13) osc_stream++; // "The first position, 61,75 kHz is not used to protect the basic subcarrier of 57 kHz on existing receivers." - IEC 62106-1 - float shaped = 0.0f; + float shaped; iirfilt_rrrf_execute(runtime->rds_filter[stream], runtime->rds_symbol[stream], &shaped); float carrier = get_oscillator_cos_multiplier_ni(&runtime->osc, osc_stream * 4.0f); @@ -338,12 +338,18 @@ static int config_handler(void* user, const char* section, const char* name, con else if(MATCH("advanced", "lpf_order")) pconfig->lpf_order = atoi(value); else if(MATCH("advanced", "stereo_ssb")) pconfig->stereo_ssb = atoi(value); else if(MATCH("advanced", "preemp_unity")) pconfig->preemp_unity_freq = strtof(value, NULL); - else if(MATCH("advanced", "sample_rate")) pconfig->sample_rate = atoi(value); - else if(MATCH("advanced", "lpf_cutoff")) { + else if(MATCH("advanced", "sample_rate")) { + pconfig->sample_rate = atoi(value); + if(pconfig->sample_rate < 0) { + fprintf(stderr, "Negative sample rate\n"); + return 0; + } + } else if(MATCH("advanced", "lpf_cutoff")) { pconfig->lpf_cutoff = strtof(value, NULL); if(pconfig->lpf_cutoff > (pconfig->sample_rate * 0.5)) { pconfig->lpf_cutoff = (pconfig->sample_rate * 0.5); - fprintf(stderr, "LPF cutoff over niquist, limiting.\n"); + fprintf(stderr, "LPF cutoff over niquist.\n"); + return 0; } } else if(MATCH("advanced", "headroom")) pconfig->volumes.headroom = strtof(value, NULL); else if(MATCH("advanced", "drive")) pconfig->volumes.drive = strtof(value, NULL);