Passband Filter Testing on Raw Analog / EDACS / M17 Encoder;

This commit is contained in:
lwvmobile 2024-03-20 10:22:20 -04:00
parent 43f6218129
commit 89736ae543
4 changed files with 27 additions and 6 deletions

13
src/3.c
View File

@ -471,11 +471,13 @@ void init_audio_filters (dsd_state * state)
HPFilter_Init(&state->HRCFilterR, 960, (float)1/(float)48000);
//PBFilter_Init(PBFilter *filter, float HPF_cutoffFreqHz, float LPF_cutoffFreqHz, float sampleTimeS);
// void NOTCHFilter_Init(NOTCHFilter *filter, float centerFreqHz, float notchWidthHz, float sampleTimeS);
//NOTCHFilter_Init(NOTCHFilter *filter, float centerFreqHz, float notchWidthHz, float sampleTimeS);
//unclear what we should set up for these, output is super quiet after using them
PBFilter_Init(&state->PBF, 48000, 12000, (float)1/(float)48000);
NOTCHFilter_Init(&state->NF, 48000, 12000, (float)1/(float)48000);
//TODO: Make PBFilter initiazation values based on rtl bandwidth values?
//passband filter working (seems to be), notch filter unsure which values to use
PBFilter_Init(&state->PBF, 8000, 12000, (float)1/(float)1536000); //RTL Sampling at 1536000 S/s.
NOTCHFilter_Init(&state->NF, 1000, 4000, (float)1/(float)1536000); //this one probably isn't set up correctly
}
@ -524,7 +526,8 @@ void pbf(dsd_state * state, short * input, int len)
for (i = 0; i < len; i++)
{
// fprintf (stderr, "\n in: %05d", input[i]);
input[i] = PBFilter_Update(&state->PBF, input[i]);
// input[i] = PBFilter_Update(&state->PBF, input[i]); //filter only
input[i] = PBFilter_Update(&state->PBF, input[i]) * 1.5f; //add a little extra gain back
// fprintf (stderr, "\n out: %05d", input[i]);
}
}

View File

@ -279,9 +279,17 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
}
// analog audio filtering
// lpf (state, state->analog_out, 960);
// lpf(state, state->analog_out, 960);
hpf (state, state->analog_out, 960);
//analog sounds really good now, still a tad bit quiet though
if (opts->audio_in_type == 3) //passband filter if using rtl_fm
pbf(state, state->analog_out, 960);
//unsure if this one helps anymore or not, probably not be setup correctly
// if (opts->audio_in_type == 3) //notch filter if using rtl_fm
// nf(state, state->analog_out, 960);
//seems to be working now, but RMS values are lower on actual analog signal than on no signal but noise
if ( (opts->rtl_rms > opts->rtl_squelch_level) && opts->monitor_input_audio == 1 && state->carrier == 0 ) //added carrier check here in lieu of disabling it above
{

View File

@ -211,6 +211,14 @@ void edacs_analog(dsd_opts * opts, dsd_state * state, int afs, unsigned char lcn
hpf (state, analog2, 960);
hpf (state, analog3, 960);
//TODO: Test this somehow, the EDACS analog remote only ATM (Should be alright though)
if (opts->audio_in_type == 3)
{
pbf (state, analog1, 960);
pbf (state, analog2, 960);
pbf (state, analog3, 960);
}
//reconfigured to use seperate audio out stream that is always 48k short
if (opts->audio_out_type == 0 && opts->slot1_on == 1)
{

View File

@ -1857,6 +1857,8 @@ void encodeM17STR(dsd_opts * opts, dsd_state * state)
{
hpf (state, voice1, 160);
hpf (state, voice2, 160);
pbf (state, voice1, 160);
pbf (state, voice2, 160);
}
//convert out audio input into CODEC2 (3200bps) 8 byte data stream