RTL_FM Input for Analog/M17 Encoder;

This commit is contained in:
lwvmobile 2024-03-19 12:46:27 -04:00
parent 2b7de90474
commit ef13343925
2 changed files with 32 additions and 2 deletions

View File

@ -1855,8 +1855,8 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
//run lpf and hpf
// lpf8 (state, voice1, 160);
// lpf8 (state, voice2, 160);
hpf8 (state, voice1, 160);
hpf8 (state, voice2, 160);
// hpf (state, voice1, 160);
// hpf (state, voice2, 160);
//convert out audio input into CODEC2 (3200bps) 8 byte data stream
uint8_t vc1_bytes[8]; memset (vc1_bytes, 0, sizeof(vc1_bytes));

View File

@ -815,6 +815,34 @@ void dongle_init(struct dongle_state *s)
s->demod_target = &demod;
}
void demod_init_analog(struct demod_state *s)
{
s->rate_in = rtl_bandwidth;
s->rate_out = rtl_bandwidth;
s->squelch_level = 0;
s->conseq_squelch = 10;
s->terminate_on_squelch = 0;
s->squelch_hits = 11;
s->downsample_passes = 1; //
s->comp_fir_size = 0;
s->prev_index = 0;
s->post_downsample = 1; //1 -- once this works, default = 4 -- doesn't work on the official rtl-sdr source code either
s->custom_atan = 0;
s->deemph = 1; //
s->rate_out2 = rtl_bandwidth; // -1 flag for disabled -- this enables low_pass_real, seems to work okay
s->mode_demod = &fm_demod;
s->pre_j = s->pre_r = s->now_r = s->now_j = 0;
s->prev_lpr_index = 0;
s->deemph_a = 0; //
s->now_lpr = 0;
s->dc_block = 1; //
s->dc_avg = 0;
pthread_rwlock_init(&s->rw, NULL);
pthread_cond_init(&s->ready, NULL);
pthread_mutex_init(&s->ready_m, NULL);
s->output_target = &output;
}
void demod_init_ro2(struct demod_state *s)
{
s->rate_in = rtl_bandwidth;
@ -1005,6 +1033,8 @@ void open_rtlsdr_stream(dsd_opts *opts)
//init with low pass if decoding P25 or EDACS/Provoice
if (opts->frame_p25p1 == 1 || opts->frame_p25p2 == 1 || opts->frame_provoice == 1)
demod_init_ro2(&demod);
else if (opts->analog_only == 1 || opts->m17encoder == 1)
demod_init_analog(&demod);
else demod_init(&demod);
output_init(&output);
controller_init(&controller);