Added CTCSS decoder in NFM RX

RSSI output is now pitch instead of PWM
Disabled RSSI output in WBFM mode
This commit is contained in:
furrtek
2017-11-28 08:52:04 +01:00
parent f128b9b0b7
commit d77337dd77
19 changed files with 284 additions and 160 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
*
* This file is part of PortaPack.
*
@@ -115,7 +116,7 @@ constexpr fir_taps_real<32> taps_11k0_channel {
} },
};
/// NBFM 8K50F3E emission type ////////////////////////////////////////////
// NBFM 8K50F3E emission type /////////////////////////////////////////////
// IFIR image-reject filter: fs=3072000, pass=4250, stop=340250, decim=8, fout=384000
constexpr fir_taps_real<24> taps_4k25_decim_0 {
@@ -152,6 +153,50 @@ constexpr fir_taps_real<32> taps_4k25_channel {
} },
};
/* CTCSS audio filter */
/* 12kHz int16_t input
* -> FIR filter, <300Hz pass, >300Hz stop, gain of 1
* -> 6kHz int16_t output, gain of 1.0 (I think).
* Padded to multiple of four taps for unrolled FIR code.
* sum(abs(taps)): 125270
*/
/*constexpr fir_taps_real<64> taps_64_lp_025_025 {
.pass_frequency_normalized = 0.025f,
.stop_frequency_normalized = 0.025f,
.taps = { {
0, 0, -3, -7, -13, -20, -27, -32,
-34, -33, -25, -10, 13, 47, 94, 152,
223, 307, 402, 508, 622, 742, 866, 991,
1113, 1229, 1336, 1430, 1510, 1571, 1614, 1635,
1635, 1614, 1571, 1510, 1430, 1336, 1229, 1113,
991, 866, 742, 622, 508, 402, 307, 223,
152, 94, 47, 13, -10, -25, -33, -34,
-32, -27, -20, -13, -7, -3, 0, 0
} },
};*/
/* CTCSS audio filter */
/* 24kHz int16_t input
* -> FIR filter, <300Hz pass, >300Hz stop, gain of 1
* -> 12kHz int16_t output, gain of 1.0 (I think).
* Padded to multiple of four taps for unrolled FIR code.
* sum(abs(taps)): 125270
*/
constexpr fir_taps_real<64> taps_64_lp_025_025 {
.pass_frequency_normalized = 0.0125f,
.stop_frequency_normalized = 0.0125f,
.taps = { {
0, 0, 2, 6, 12, 20, 32, 46,
64, 85, 110, 138, 169, 204, 241, 281,
323, 367, 412, 457, 502, 547, 590, 631,
669, 704, 735, 762, 784, 801, 812, 818,
818, 812, 801, 784, 762, 735, 704, 669,
631, 590, 547, 502, 457, 412, 367, 323,
281, 241, 204, 169, 138, 110, 85, 64,
46, 32, 20, 12, 6, 2, 0, 0
} },
};
// DSB AM 6K00A3E emission type ///////////////////////////////////////////
// IFIR image-reject filter: fs=3072000, pass=3000, stop=339000, decim=8, fout=384000

View File

@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
* Copyright (C) 2017 Furrtek
*
* This file is part of PortaPack.
*
@@ -43,6 +44,12 @@ constexpr iir_biquad_config_t audio_24k_hpf_300hz_config {
};
// scipy.signal.butter(2, 30 / 12000.0, 'highpass', analog=False)
constexpr iir_biquad_config_t audio_24k_hpf_30hz_config {
{ 0.99446179f, -1.98892358f, 0.99446179f },
{ 1.00000000f, -1.98889291f, 0.98895425f }
};
// scipy.signal.butter(2, 300 / 8000.0, 'highpass', analog=False)
constexpr iir_biquad_config_t audio_16k_hpf_300hz_config {
{ 0.92006616f, -1.84013232f, 0.92006616f },

View File

@@ -80,7 +80,7 @@ public:
TonesConfigure = 32,
AFSKTxConfigure = 33,
PWMRSSIConfigure = 34,
PitchRSSIConfigure = 34,
OOKConfigure = 35,
RDSConfigure = 36,
AudioTXConfig = 37,
@@ -103,6 +103,7 @@ public:
FIFOData = 61,
AudioLevelReport = 70,
CodedSquelch = 71,
MAX
};
@@ -351,6 +352,18 @@ public:
uint32_t value;
};
class CodedSquelchMessage : public Message {
public:
constexpr CodedSquelchMessage(
const uint32_t value
) : Message { ID::CodedSquelch },
value { value }
{
}
uint32_t value;
};
class ShutdownMessage : public Message {
public:
constexpr ShutdownMessage(
@@ -667,22 +680,19 @@ public:
const bool trigger_word;
};
class PWMRSSIConfigureMessage : public Message {
class PitchRSSIConfigureMessage : public Message {
public:
constexpr PWMRSSIConfigureMessage(
constexpr PitchRSSIConfigureMessage(
const bool enabled,
const uint32_t synth_div,
const int32_t avg
) : Message { ID::PWMRSSIConfigure },
const int32_t rssi
) : Message { ID::PitchRSSIConfigure },
enabled(enabled),
synth_div(synth_div),
avg(avg)
rssi(rssi)
{
}
const bool enabled;
const uint32_t synth_div;
const int32_t avg;
const int32_t rssi;
};
class TonesConfigureMessage : public Message {