mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-15 12:38:11 +00:00
Merge branch 'next'
This commit is contained in:
commit
8b6442ee79
@ -1,3 +1,5 @@
|
|||||||
|
> ⚠ **BEFORE BUYING YOURS:** Beware of hardware mods that use a custom firmware, which are [NOT COMPATIBLE](https://github.com/eried/portapack-mayhem/issues/264) with older forks, and they do not follow the license. **ASK THE SELLER if the unit works with an specific firmware, for example, pointing to the [![GitHub release (latest by date)](https://img.shields.io/github/v/release/eried/portapack-mayhem?label=latest%20release&style=social)](https://github.com/eried/portapack-mayhem/releases/latest) on this repository**
|
||||||
|
|
||||||
# PortaPack Mayhem
|
# PortaPack Mayhem
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.com/eried/portapack-mayhem.svg?branch=master)](https://travis-ci.com/eried/portapack-mayhem) [![buddy pipeline](https://app.buddy.works/eried/portapack/pipelines/pipeline/252276/badge.svg?token=48cd59d53de0589a8fbe26bc751d77a59a011cf72581da049343879402991c34 "buddy pipeline")](https://app.buddy.works/eried/portapack/pipelines/pipeline/252276) [![CodeScene Code Health](https://codescene.io/projects/8381/status-badges/code-health)](https://codescene.io/projects/8381) [![GitHub All Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/total)](https://github.com/eried/portapack-mayhem/releases) [![GitHub Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/latest/total)](https://github.com/eried/portapack-mayhem/releases/latest) [![Docker Hub Pulls](https://img.shields.io/docker/pulls/eried/portapack.svg)](https://hub.docker.com/r/eried/portapack) [![Discord Chat](https://img.shields.io/discord/719669764804444213.svg)](https://discord.gg/tuwVMv3) [![Check bounties!](https://img.shields.io/bountysource/team/portapack-mayhem/activity?color=%2333ccff&label=bountysource%20%28USD%29&style=plastic)](https://www.bountysource.com/teams/portapack-mayhem/issues)
|
[![Build Status](https://travis-ci.com/eried/portapack-mayhem.svg?branch=master)](https://travis-ci.com/eried/portapack-mayhem) [![buddy pipeline](https://app.buddy.works/eried/portapack/pipelines/pipeline/252276/badge.svg?token=48cd59d53de0589a8fbe26bc751d77a59a011cf72581da049343879402991c34 "buddy pipeline")](https://app.buddy.works/eried/portapack/pipelines/pipeline/252276) [![CodeScene Code Health](https://codescene.io/projects/8381/status-badges/code-health)](https://codescene.io/projects/8381) [![GitHub All Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/total)](https://github.com/eried/portapack-mayhem/releases) [![GitHub Releases](https://img.shields.io/github/downloads/eried/portapack-mayhem/latest/total)](https://github.com/eried/portapack-mayhem/releases/latest) [![Docker Hub Pulls](https://img.shields.io/docker/pulls/eried/portapack.svg)](https://hub.docker.com/r/eried/portapack) [![Discord Chat](https://img.shields.io/discord/719669764804444213.svg)](https://discord.gg/tuwVMv3) [![Check bounties!](https://img.shields.io/bountysource/team/portapack-mayhem/activity?color=%2333ccff&label=bountysource%20%28USD%29&style=plastic)](https://www.bountysource.com/teams/portapack-mayhem/issues)
|
||||||
@ -39,7 +41,7 @@ This fork (**Mayhem**) uses *major.minor.release* [semantic versioning](https://
|
|||||||
## What about Havoc/GridRF/jamesshao8/jboone's?
|
## What about Havoc/GridRF/jamesshao8/jboone's?
|
||||||
* jboone's PortaPack: the [vanilla](https://en.wikipedia.org/wiki/Vanilla_software) experience
|
* jboone's PortaPack: the [vanilla](https://en.wikipedia.org/wiki/Vanilla_software) experience
|
||||||
* Havoc: It was the most popular fork of jboone's PortaPack, currrently, it is not being maintained nor updated
|
* Havoc: It was the most popular fork of jboone's PortaPack, currrently, it is not being maintained nor updated
|
||||||
* jamesshao8: He keeps his own version of the fork, while not attached as a fork to anything
|
* jamesshao8: He keeps his own version of the fork, while not attached as a fork to anything. Latest functions do not follow the license and are not being published with source code, so keep this in mind
|
||||||
* GridRF: They sell PortaPack clones with their own firmware based on a old version, which has no sourcecode available
|
* GridRF: They sell PortaPack clones with their own firmware based on a old version, which has no sourcecode available
|
||||||
|
|
||||||
## How can I collaborate
|
## How can I collaborate
|
||||||
|
@ -274,6 +274,7 @@ void JammerView::start_tx() {
|
|||||||
transmitter_model.enable();
|
transmitter_model.enable();
|
||||||
|
|
||||||
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||||
|
mscounter = 0; //euquiq: Reset internal ms counter for do_timer()
|
||||||
} else {
|
} else {
|
||||||
if (out_of_ranges)
|
if (out_of_ranges)
|
||||||
nav_.display_modal("Error", "Jamming bandwidth too large.\nMust be less than 24MHz.");
|
nav_.display_modal("Error", "Jamming bandwidth too large.\nMust be less than 24MHz.");
|
||||||
@ -289,6 +290,59 @@ void JammerView::stop_tx() {
|
|||||||
radio::disable();
|
radio::disable();
|
||||||
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
|
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
|
||||||
jamming = false;
|
jamming = false;
|
||||||
|
cooling = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//called each 1/60th of second
|
||||||
|
void JammerView::on_timer() {
|
||||||
|
if (++mscounter == 60) {
|
||||||
|
mscounter = 0;
|
||||||
|
if (jamming)
|
||||||
|
{
|
||||||
|
if (cooling)
|
||||||
|
{
|
||||||
|
if (++seconds >= field_timepause.value())
|
||||||
|
{ //Re-start TX
|
||||||
|
transmitter_model.enable();
|
||||||
|
button_transmit.set_text("STOP");
|
||||||
|
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||||
|
|
||||||
|
int32_t jitter_amount = field_jitter.value();
|
||||||
|
if (jitter_amount)
|
||||||
|
{
|
||||||
|
lfsr_v = lfsr_iterate(lfsr_v);
|
||||||
|
jitter_amount = (jitter_amount / 2) - (lfsr_v & jitter_amount);
|
||||||
|
mscounter += jitter_amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
cooling = false;
|
||||||
|
seconds = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (++seconds >= field_timetx.value()) //Start cooling period:
|
||||||
|
{
|
||||||
|
transmitter_model.disable();
|
||||||
|
button_transmit.set_text("PAUSED");
|
||||||
|
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
|
||||||
|
|
||||||
|
int32_t jitter_amount = field_jitter.value();
|
||||||
|
if (jitter_amount)
|
||||||
|
{
|
||||||
|
lfsr_v = lfsr_iterate(lfsr_v);
|
||||||
|
jitter_amount = (jitter_amount / 2) - (lfsr_v & jitter_amount);
|
||||||
|
mscounter += jitter_amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
cooling = true;
|
||||||
|
seconds = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JammerView::JammerView(
|
JammerView::JammerView(
|
||||||
@ -309,6 +363,9 @@ JammerView::JammerView(
|
|||||||
&text_range_total,
|
&text_range_total,
|
||||||
&options_speed,
|
&options_speed,
|
||||||
&options_hop,
|
&options_hop,
|
||||||
|
&field_timetx,
|
||||||
|
&field_timepause,
|
||||||
|
&field_jitter,
|
||||||
&button_transmit
|
&button_transmit
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -321,8 +378,11 @@ JammerView::JammerView(
|
|||||||
options_hop.set_selected_index(1); // 50ms
|
options_hop.set_selected_index(1); // 50ms
|
||||||
button_transmit.set_style(&style_val);
|
button_transmit.set_style(&style_val);
|
||||||
|
|
||||||
|
field_timetx.set_value(30);
|
||||||
|
field_timepause.set_value(1);
|
||||||
|
|
||||||
button_transmit.on_select = [this](Button&) {
|
button_transmit.on_select = [this](Button&) {
|
||||||
if (jamming)
|
if (jamming || cooling)
|
||||||
stop_tx();
|
stop_tx();
|
||||||
else
|
else
|
||||||
start_tx();
|
start_tx();
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#include "transmitter_model.hpp"
|
#include "transmitter_model.hpp"
|
||||||
#include "message.hpp"
|
#include "message.hpp"
|
||||||
#include "jammer.hpp"
|
#include "jammer.hpp"
|
||||||
|
#include "lfsr_random.hpp"
|
||||||
|
|
||||||
using namespace jammer;
|
using namespace jammer;
|
||||||
|
|
||||||
@ -57,78 +58,11 @@ private:
|
|||||||
.foreground = Color::grey(),
|
.foreground = Color::grey(),
|
||||||
};
|
};
|
||||||
|
|
||||||
/*static constexpr jammer_range_t range_presets[] = {
|
|
||||||
// GSM900 Orange
|
|
||||||
{ true, 935000000, 945000000 }, // BW:10M
|
|
||||||
// GSM1800 Orange
|
|
||||||
{ true, 1808000000, 1832000000 }, // BW:24M
|
|
||||||
|
|
||||||
// GSM900 SFR
|
|
||||||
{ true, 950000000, 960000000 }, // BW:10M
|
|
||||||
// GSM1800 SFR
|
|
||||||
{ true, 1832000000, 1853000000 }, // BW:21M
|
|
||||||
|
|
||||||
// GSM900 Bouygues
|
|
||||||
{ true, 925000000, 935000000 }, // BW:10M
|
|
||||||
// GSM1800 Bouygues
|
|
||||||
{ true, 1858000000, 1880000000 }, // BW:22M
|
|
||||||
|
|
||||||
// GSM900 Free
|
|
||||||
{ true, 945000000, 950000000 }, // BW:5M
|
|
||||||
|
|
||||||
// GSM-R
|
|
||||||
{ true, 921000000, 925000000 }, // BW:4M
|
|
||||||
|
|
||||||
// DECT
|
|
||||||
{ true, 1880000000, 1900000000 }, // BW: 20MHz
|
|
||||||
|
|
||||||
// PMV AFSK
|
|
||||||
{ true, 162930000, 162970000 }, // BW: 40kHz
|
|
||||||
|
|
||||||
// ISM 433
|
|
||||||
{ true, 433050000, 434790000 }, // Center: 433.92MHz BW: 0.2%
|
|
||||||
|
|
||||||
// ISM 868
|
|
||||||
{ true, 868000000, 868200000 }, // Center: 868.2MHz BW: 40kHz
|
|
||||||
|
|
||||||
// GPS L1
|
|
||||||
{ true, 1575420000 - 500000, 1575420000 + 500000 }, // BW: 1MHz
|
|
||||||
// GPS L2
|
|
||||||
{ true, 1227600000 - 1000000, 1227600000 + 1000000 }, // BW: 2MHz
|
|
||||||
|
|
||||||
// WLAN 2.4G CH1
|
|
||||||
{ true, 2412000000 - 11000000, 2412000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH2
|
|
||||||
{ true, 2417000000 - 11000000, 2417000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH3
|
|
||||||
{ true, 2422000000 - 11000000, 2422000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH4
|
|
||||||
{ true, 2427000000 - 11000000, 2427000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH5
|
|
||||||
{ true, 2432000000 - 11000000, 2432000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH6
|
|
||||||
{ true, 2437000000 - 11000000, 2437000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH7
|
|
||||||
{ true, 2442000000 - 11000000, 2442000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH8
|
|
||||||
{ true, 2447000000 - 11000000, 2447000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH9
|
|
||||||
{ true, 2452000000 - 11000000, 2452000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH10
|
|
||||||
{ true, 2457000000 - 11000000, 2457000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH11
|
|
||||||
{ true, 2462000000 - 11000000, 2462000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH12
|
|
||||||
{ true, 2467000000 - 11000000, 2467000000 + 11000000}, // BW: 22MHz
|
|
||||||
// WLAN 2.4G CH13
|
|
||||||
{ true, 2472000000 - 11000000, 2472000000 + 11000000}, // BW: 22MHz
|
|
||||||
};*/
|
|
||||||
|
|
||||||
Labels labels {
|
Labels labels {
|
||||||
{ { 2 * 8, 9 * 8 + 4 }, "Start", Color::light_grey() },
|
{ { 2 * 8, 8 * 8 + 4 }, "Start", Color::light_grey() },
|
||||||
{ { 23 * 8, 9 * 8 + 4 }, "Stop", Color::light_grey() },
|
{ { 23 * 8, 8 * 8 + 4 }, "Stop", Color::light_grey() },
|
||||||
{ { 12 * 8, 6 * 8 }, "Center", Color::light_grey() },
|
{ { 12 * 8, 5 * 8 - 4}, "Center", Color::light_grey() },
|
||||||
{ { 12 * 8 + 4, 14 * 8 }, "Width", Color::light_grey() }
|
{ { 12 * 8 + 4, 13 * 8 }, "Width", Color::light_grey() }
|
||||||
};
|
};
|
||||||
|
|
||||||
Checkbox check_enabled {
|
Checkbox check_enabled {
|
||||||
@ -143,19 +77,19 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Button button_start {
|
Button button_start {
|
||||||
{ 0 * 8, 6 * 16, 11 * 8, 28 },
|
{ 0 * 8, 11 * 8, 11 * 8, 28 },
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
Button button_stop {
|
Button button_stop {
|
||||||
{ 19 * 8, 6 * 16, 11 * 8, 28 },
|
{ 19 * 8, 11 * 8, 11 * 8, 28 },
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
Button button_center {
|
Button button_center {
|
||||||
{ 76, 4 * 16, 11 * 8, 28 },
|
{ 76, 4 * 15 - 4, 11 * 8, 28 },
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
Button button_width {
|
Button button_width {
|
||||||
{ 76, 8 * 16, 11 * 8, 28 },
|
{ 76, 8 * 15, 11 * 8, 28 },
|
||||||
""
|
""
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -178,12 +112,17 @@ private:
|
|||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
|
|
||||||
void start_tx();
|
void start_tx();
|
||||||
|
void on_timer();
|
||||||
void stop_tx();
|
void stop_tx();
|
||||||
void set_jammer_channel(uint32_t i, uint32_t width, uint64_t center, uint32_t duration);
|
void set_jammer_channel(uint32_t i, uint32_t width, uint64_t center, uint32_t duration);
|
||||||
void on_retune(const rf::Frequency freq, const uint32_t range);
|
void on_retune(const rf::Frequency freq, const uint32_t range);
|
||||||
|
|
||||||
JammerChannel * jammer_channels = (JammerChannel*)shared_memory.bb_data.data;
|
JammerChannel * jammer_channels = (JammerChannel*)shared_memory.bb_data.data;
|
||||||
bool jamming { false };
|
bool jamming { false };
|
||||||
|
bool cooling { false }; //euquiq: Indicates jammer in cooldown
|
||||||
|
uint16_t seconds = 0; //euquiq: seconds counter for toggling tx / cooldown
|
||||||
|
int16_t mscounter = 0; //euquiq: Internal ms counter for do_timer()
|
||||||
|
lfsr_word_t lfsr_v = 1; //euquiq: Used to generate "random" Jitter
|
||||||
|
|
||||||
static constexpr Style style_val {
|
static constexpr Style style_val {
|
||||||
.font = font::fixed_8x16,
|
.font = font::fixed_8x16,
|
||||||
@ -209,13 +148,19 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Labels labels {
|
Labels labels {
|
||||||
{ { 3 * 8, 12 * 16 }, "Type:", Color::light_grey() },
|
{ { 2 * 8, 23 * 8 }, "Type:", Color::light_grey() },
|
||||||
{ { 2 * 8, 13 * 16 }, "Speed:", Color::light_grey() },
|
{ { 1 * 8, 25 * 8 }, "Speed:", Color::light_grey() },
|
||||||
{ { 5 * 8, 14 * 16 }, "Hop:", Color::light_grey() }
|
{ { 3 * 8, 27 * 8 }, "Hop:", Color::light_grey() },
|
||||||
|
{ { 4 * 8, 29 * 8 }, "TX:", Color::light_grey() },
|
||||||
|
{ { 1 * 8, 31 * 8 }, "Sle3p:", Color::light_grey() }, //euquiq: Token of appreciation to TheSle3p, which made this ehnancement a reality with his bounty.
|
||||||
|
{ { 0 * 8, 33 * 8 }, "Jitter:", Color::light_grey() }, //Maybe the repository curator can keep the "mystype" for some versions.
|
||||||
|
{ { 11 * 8, 29 * 8 }, "Secs.", Color::light_grey() },
|
||||||
|
{ { 11 * 8, 31 * 8 }, "Secs.", Color::light_grey() },
|
||||||
|
{ { 11 * 8, 33 * 8 }, "/60", Color::light_grey() }
|
||||||
};
|
};
|
||||||
|
|
||||||
OptionsField options_type {
|
OptionsField options_type {
|
||||||
{ 9 * 8, 12 * 16 },
|
{ 7 * 8, 23 * 8 },
|
||||||
8,
|
8,
|
||||||
{
|
{
|
||||||
{ "Rand FSK", 0 },
|
{ "Rand FSK", 0 },
|
||||||
@ -226,16 +171,16 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Text text_range_number {
|
Text text_range_number {
|
||||||
{ 22 * 8, 12 * 16, 2 * 8, 16 },
|
{ 16 * 8, 23 * 8, 2 * 8, 16 },
|
||||||
"--"
|
"--"
|
||||||
};
|
};
|
||||||
Text text_range_total {
|
Text text_range_total {
|
||||||
{ 24 * 8, 12 * 16, 3 * 8, 16 },
|
{ 18 * 8, 23 * 8, 3 * 8, 16 },
|
||||||
"/--"
|
"/--"
|
||||||
};
|
};
|
||||||
|
|
||||||
OptionsField options_speed {
|
OptionsField options_speed {
|
||||||
{ 9 * 8, 13 * 16 },
|
{ 7 * 8, 25 * 8 },
|
||||||
6,
|
6,
|
||||||
{
|
{
|
||||||
{ "10Hz ", 10 },
|
{ "10Hz ", 10 },
|
||||||
@ -247,7 +192,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
OptionsField options_hop {
|
OptionsField options_hop {
|
||||||
{ 9 * 8, 14 * 16 },
|
{ 7 * 8, 27 * 8 },
|
||||||
5,
|
5,
|
||||||
{
|
{
|
||||||
{ "10ms ", 1 },
|
{ "10ms ", 1 },
|
||||||
@ -260,8 +205,32 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
NumberField field_timetx {
|
||||||
|
{ 7 * 8, 29 * 8 },
|
||||||
|
3,
|
||||||
|
{ 1, 180 },
|
||||||
|
1,
|
||||||
|
' ',
|
||||||
|
};
|
||||||
|
|
||||||
|
NumberField field_timepause {
|
||||||
|
{ 8 * 8, 31 * 8 },
|
||||||
|
2,
|
||||||
|
{ 1, 60 },
|
||||||
|
1,
|
||||||
|
' ',
|
||||||
|
};
|
||||||
|
|
||||||
|
NumberField field_jitter {
|
||||||
|
{ 8 * 8, 33 * 8 },
|
||||||
|
2,
|
||||||
|
{ 1, 60 },
|
||||||
|
1,
|
||||||
|
' ',
|
||||||
|
};
|
||||||
|
|
||||||
Button button_transmit {
|
Button button_transmit {
|
||||||
{ 9 * 8, 16 * 16, 96, 48 },
|
{ 148, 212, 80, 80},
|
||||||
"START"
|
"START"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -272,6 +241,14 @@ private:
|
|||||||
this->on_retune(message->freq, message->range);
|
this->on_retune(message->freq, message->range);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
MessageHandlerRegistration message_handler_frame_sync {
|
||||||
|
Message::ID::DisplayFrameSync,
|
||||||
|
[this](const Message* const) {
|
||||||
|
this->on_timer();
|
||||||
|
}
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
|
||||||
|
@ -94,13 +94,16 @@ void FrequencyScale::set_spectrum_sampling_rate(const int new_sampling_rate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FrequencyScale::set_channel_filter(
|
void FrequencyScale::set_channel_filter(
|
||||||
const int pass_frequency,
|
const int low_frequency,
|
||||||
const int stop_frequency
|
const int high_frequency,
|
||||||
|
const int transition
|
||||||
) {
|
) {
|
||||||
if( (channel_filter_pass_frequency != pass_frequency) ||
|
if( (channel_filter_low_frequency != low_frequency) ||
|
||||||
(channel_filter_stop_frequency != stop_frequency) ) {
|
(channel_filter_high_frequency != high_frequency) ||
|
||||||
channel_filter_pass_frequency = pass_frequency;
|
(channel_filter_transition != transition) ) {
|
||||||
channel_filter_stop_frequency = stop_frequency;
|
channel_filter_low_frequency = low_frequency;
|
||||||
|
channel_filter_high_frequency = high_frequency;
|
||||||
|
channel_filter_transition = transition;
|
||||||
set_dirty();
|
set_dirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -184,41 +187,28 @@ void FrequencyScale::draw_frequency_ticks(Painter& painter, const Rect r) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FrequencyScale::draw_filter_ranges(Painter& painter, const Rect r) {
|
void FrequencyScale::draw_filter_ranges(Painter& painter, const Rect r) {
|
||||||
if( channel_filter_pass_frequency ) {
|
if( channel_filter_low_frequency != channel_filter_high_frequency ) {
|
||||||
const auto x_center = r.width() / 2;
|
const auto x_center = r.width() / 2;
|
||||||
|
|
||||||
const auto pass_offset = channel_filter_pass_frequency * spectrum_bins / spectrum_sampling_rate;
|
const auto x_low = x_center + channel_filter_low_frequency * spectrum_bins / spectrum_sampling_rate;
|
||||||
const auto stop_offset = channel_filter_stop_frequency * spectrum_bins / spectrum_sampling_rate;
|
const auto x_high = x_center + channel_filter_high_frequency * spectrum_bins / spectrum_sampling_rate;
|
||||||
|
|
||||||
const auto pass_x_lo = x_center - pass_offset;
|
if( channel_filter_transition ) {
|
||||||
const auto pass_x_hi = x_center + pass_offset;
|
const auto trans = channel_filter_transition * spectrum_bins / spectrum_sampling_rate;
|
||||||
|
|
||||||
if( channel_filter_stop_frequency ) {
|
const Rect r_all {
|
||||||
const auto stop_x_lo = x_center - stop_offset;
|
r.left() + x_low - trans, r.bottom() - filter_band_height,
|
||||||
const auto stop_x_hi = x_center + stop_offset;
|
x_high - x_low + trans*2, filter_band_height
|
||||||
|
|
||||||
const Rect r_stop_lo {
|
|
||||||
r.left() + stop_x_lo, r.bottom() - filter_band_height,
|
|
||||||
pass_x_lo - stop_x_lo, filter_band_height
|
|
||||||
};
|
};
|
||||||
painter.fill_rectangle(
|
painter.fill_rectangle(
|
||||||
r_stop_lo,
|
r_all,
|
||||||
Color::yellow()
|
|
||||||
);
|
|
||||||
|
|
||||||
const Rect r_stop_hi {
|
|
||||||
r.left() + pass_x_hi, r.bottom() - filter_band_height,
|
|
||||||
stop_x_hi - pass_x_hi, filter_band_height
|
|
||||||
};
|
|
||||||
painter.fill_rectangle(
|
|
||||||
r_stop_hi,
|
|
||||||
Color::yellow()
|
Color::yellow()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Rect r_pass {
|
const Rect r_pass {
|
||||||
r.left() + pass_x_lo, r.bottom() - filter_band_height,
|
r.left() + x_low, r.bottom() - filter_band_height,
|
||||||
pass_x_hi - pass_x_lo, filter_band_height
|
x_high - x_low, filter_band_height
|
||||||
};
|
};
|
||||||
painter.fill_rectangle(
|
painter.fill_rectangle(
|
||||||
r_pass,
|
r_pass,
|
||||||
@ -390,8 +380,9 @@ void WaterfallWidget::on_channel_spectrum(const ChannelSpectrum& spectrum) {
|
|||||||
sampling_rate = spectrum.sampling_rate;
|
sampling_rate = spectrum.sampling_rate;
|
||||||
frequency_scale.set_spectrum_sampling_rate(sampling_rate);
|
frequency_scale.set_spectrum_sampling_rate(sampling_rate);
|
||||||
frequency_scale.set_channel_filter(
|
frequency_scale.set_channel_filter(
|
||||||
spectrum.channel_filter_pass_frequency,
|
spectrum.channel_filter_low_frequency,
|
||||||
spectrum.channel_filter_stop_frequency
|
spectrum.channel_filter_high_frequency,
|
||||||
|
spectrum.channel_filter_transition
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
bool on_key(const KeyEvent key) override;
|
bool on_key(const KeyEvent key) override;
|
||||||
|
|
||||||
void set_spectrum_sampling_rate(const int new_sampling_rate);
|
void set_spectrum_sampling_rate(const int new_sampling_rate);
|
||||||
void set_channel_filter(const int pass_frequency, const int stop_frequency);
|
void set_channel_filter(const int low_frequency, const int high_frequency, const int transition);
|
||||||
|
|
||||||
void paint(Painter& painter) override;
|
void paint(Painter& painter) override;
|
||||||
|
|
||||||
@ -96,8 +96,9 @@ private:
|
|||||||
SignalToken signal_token_tick_second { };
|
SignalToken signal_token_tick_second { };
|
||||||
int spectrum_sampling_rate { 0 };
|
int spectrum_sampling_rate { 0 };
|
||||||
const int spectrum_bins = std::tuple_size<decltype(ChannelSpectrum::db)>::value;
|
const int spectrum_bins = std::tuple_size<decltype(ChannelSpectrum::db)>::value;
|
||||||
int channel_filter_pass_frequency { 0 };
|
int channel_filter_low_frequency { 0 };
|
||||||
int channel_filter_stop_frequency { 0 };
|
int channel_filter_high_frequency { 0 };
|
||||||
|
int channel_filter_transition { 0 };
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
void clear_background(Painter& painter, const Rect r);
|
void clear_background(Painter& painter, const Rect r);
|
||||||
|
@ -488,7 +488,7 @@ TransmittersMenuView::TransmittersMenuView(NavigationView& nav) {
|
|||||||
{ "APRS", ui::Color::green(), &bitmap_icon_aprs, [&nav](){ nav.push<APRSTXView>(); } },
|
{ "APRS", ui::Color::green(), &bitmap_icon_aprs, [&nav](){ nav.push<APRSTXView>(); } },
|
||||||
{ "BHT Xy/EP", ui::Color::green(), &bitmap_icon_bht, [&nav](){ nav.push<BHTView>(); } },
|
{ "BHT Xy/EP", ui::Color::green(), &bitmap_icon_bht, [&nav](){ nav.push<BHTView>(); } },
|
||||||
{ "GPS Sim", ui::Color::yellow(), &bitmap_icon_gps_sim, [&nav](){ nav.push<GpsSimAppView>(); } },
|
{ "GPS Sim", ui::Color::yellow(), &bitmap_icon_gps_sim, [&nav](){ nav.push<GpsSimAppView>(); } },
|
||||||
{ "Jammer", ui::Color::yellow(), &bitmap_icon_jammer, [&nav](){ nav.push<JammerView>(); } },
|
{ "Jammer", ui::Color::green(), &bitmap_icon_jammer, [&nav](){ nav.push<JammerView>(); } },
|
||||||
{ "Key fob", ui::Color::orange(), &bitmap_icon_keyfob, [&nav](){ nav.push<KeyfobView>(); } },
|
{ "Key fob", ui::Color::orange(), &bitmap_icon_keyfob, [&nav](){ nav.push<KeyfobView>(); } },
|
||||||
{ "LGE tool", ui::Color::yellow(), &bitmap_icon_lge, [&nav](){ nav.push<LGEView>(); } },
|
{ "LGE tool", ui::Color::yellow(), &bitmap_icon_lge, [&nav](){ nav.push<LGEView>(); } },
|
||||||
{ "Morse", ui::Color::green(), &bitmap_icon_morse, [&nav](){ nav.push<MorseView>(); } },
|
{ "Morse", ui::Color::green(), &bitmap_icon_morse, [&nav](){ nav.push<MorseView>(); } },
|
||||||
|
@ -214,7 +214,7 @@ public:
|
|||||||
InformationView(NavigationView& nav);
|
InformationView(NavigationView& nav);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr auto version_string = "v1.3.0";
|
static constexpr auto version_string = "v1.3.1";
|
||||||
NavigationView& nav_;
|
NavigationView& nav_;
|
||||||
|
|
||||||
Rectangle backdrop {
|
Rectangle backdrop {
|
||||||
|
@ -35,7 +35,7 @@ void NarrowbandAMAudio::execute(const buffer_c8_t& buffer) {
|
|||||||
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
||||||
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
||||||
|
|
||||||
channel_spectrum.feed(decim_1_out, channel_filter_pass_f, channel_filter_stop_f);
|
channel_spectrum.feed(decim_1_out, channel_filter_low_f, channel_filter_high_f, channel_filter_transition);
|
||||||
|
|
||||||
const auto decim_2_out = decim_2.execute(decim_1_out, dst_buffer);
|
const auto decim_2_out = decim_2.execute(decim_1_out, dst_buffer);
|
||||||
const auto channel_out = channel_filter.execute(decim_2_out, dst_buffer);
|
const auto channel_out = channel_filter.execute(decim_2_out, dst_buffer);
|
||||||
@ -93,8 +93,9 @@ void NarrowbandAMAudio::configure(const AMConfigureMessage& message) {
|
|||||||
decim_1.configure(message.decim_1_filter.taps, 131072);
|
decim_1.configure(message.decim_1_filter.taps, 131072);
|
||||||
decim_2.configure(message.decim_2_filter.taps, decim_2_decimation_factor);
|
decim_2.configure(message.decim_2_filter.taps, decim_2_decimation_factor);
|
||||||
channel_filter.configure(message.channel_filter.taps, channel_filter_decimation_factor);
|
channel_filter.configure(message.channel_filter.taps, channel_filter_decimation_factor);
|
||||||
channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs;
|
channel_filter_low_f = message.channel_filter.low_frequency_normalized * channel_filter_input_fs;
|
||||||
channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs;
|
channel_filter_high_f = message.channel_filter.high_frequency_normalized * channel_filter_input_fs;
|
||||||
|
channel_filter_transition = message.channel_filter.transition_normalized * channel_filter_input_fs;
|
||||||
channel_spectrum.set_decimation_factor(1.0f);
|
channel_spectrum.set_decimation_factor(1.0f);
|
||||||
modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB);
|
modulation_ssb = (message.modulation == AMConfigureMessage::Modulation::SSB);
|
||||||
audio_output.configure(message.audio_hpf_config);
|
audio_output.configure(message.audio_hpf_config);
|
||||||
|
@ -64,8 +64,9 @@ private:
|
|||||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
||||||
dsp::decimate::FIRAndDecimateComplex decim_2 { };
|
dsp::decimate::FIRAndDecimateComplex decim_2 { };
|
||||||
dsp::decimate::FIRAndDecimateComplex channel_filter { };
|
dsp::decimate::FIRAndDecimateComplex channel_filter { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
int32_t channel_filter_low_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
int32_t channel_filter_high_f = 0;
|
||||||
|
int32_t channel_filter_transition = 0;
|
||||||
|
|
||||||
bool modulation_ssb = false;
|
bool modulation_ssb = false;
|
||||||
dsp::demodulate::AM demod_am { };
|
dsp::demodulate::AM demod_am { };
|
||||||
|
@ -52,7 +52,7 @@ void CaptureProcessor::execute(const buffer_c8_t& buffer) {
|
|||||||
spectrum_samples += channel.count;
|
spectrum_samples += channel.count;
|
||||||
if( spectrum_samples >= spectrum_interval_samples ) {
|
if( spectrum_samples >= spectrum_interval_samples ) {
|
||||||
spectrum_samples -= spectrum_interval_samples;
|
spectrum_samples -= spectrum_interval_samples;
|
||||||
channel_spectrum.feed(channel, channel_filter_pass_f, channel_filter_stop_f);
|
channel_spectrum.feed(channel, channel_filter_low_f, channel_filter_high_f, channel_filter_transition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -85,8 +85,9 @@ void CaptureProcessor::samplerate_config(const SamplerateConfigMessage& message)
|
|||||||
size_t decim_1_input_fs = decim_0_output_fs;
|
size_t decim_1_input_fs = decim_0_output_fs;
|
||||||
size_t decim_1_output_fs = decim_1_input_fs / decim_1.decimation_factor;
|
size_t decim_1_output_fs = decim_1_input_fs / decim_1.decimation_factor;
|
||||||
|
|
||||||
channel_filter_pass_f = taps_200k_decim_1.pass_frequency_normalized * decim_1_input_fs; // 162760.416666667
|
channel_filter_low_f = taps_200k_decim_1.low_frequency_normalized * decim_1_input_fs;
|
||||||
channel_filter_stop_f = taps_200k_decim_1.stop_frequency_normalized * decim_1_input_fs; // 337239.583333333
|
channel_filter_high_f = taps_200k_decim_1.high_frequency_normalized * decim_1_input_fs;
|
||||||
|
channel_filter_transition = taps_200k_decim_1.transition_normalized * decim_1_input_fs;
|
||||||
|
|
||||||
spectrum_interval_samples = decim_1_output_fs / spectrum_rate_hz;
|
spectrum_interval_samples = decim_1_output_fs / spectrum_rate_hz;
|
||||||
spectrum_samples = 0;
|
spectrum_samples = 0;
|
||||||
|
@ -60,8 +60,9 @@ private:
|
|||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
int32_t channel_filter_low_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
int32_t channel_filter_high_f = 0;
|
||||||
|
int32_t channel_filter_transition = 0;
|
||||||
|
|
||||||
std::unique_ptr<StreamInput> stream { };
|
std::unique_ptr<StreamInput> stream { };
|
||||||
|
|
||||||
|
@ -30,8 +30,9 @@
|
|||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
ReplayProcessor::ReplayProcessor() {
|
ReplayProcessor::ReplayProcessor() {
|
||||||
channel_filter_pass_f = taps_200k_decim_1.pass_frequency_normalized * 1000000; // 162760.416666667
|
channel_filter_low_f = taps_200k_decim_1.low_frequency_normalized * 1000000;
|
||||||
channel_filter_stop_f = taps_200k_decim_1.stop_frequency_normalized * 1000000; // 337239.583333333
|
channel_filter_high_f = taps_200k_decim_1.high_frequency_normalized * 1000000;
|
||||||
|
channel_filter_transition = taps_200k_decim_1.transition_normalized * 1000000;
|
||||||
|
|
||||||
spectrum_samples = 0;
|
spectrum_samples = 0;
|
||||||
|
|
||||||
|
@ -55,8 +55,9 @@ private:
|
|||||||
baseband_fs
|
baseband_fs
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t channel_filter_pass_f = 0;
|
int32_t channel_filter_low_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
int32_t channel_filter_high_f = 0;
|
||||||
|
int32_t channel_filter_transition = 0;
|
||||||
|
|
||||||
std::unique_ptr<StreamOutput> stream { };
|
std::unique_ptr<StreamOutput> stream { };
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ void NarrowbandFMAudio::execute(const buffer_c8_t& buffer) {
|
|||||||
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
const auto decim_0_out = decim_0.execute(buffer, dst_buffer);
|
||||||
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
const auto decim_1_out = decim_1.execute(decim_0_out, dst_buffer);
|
||||||
|
|
||||||
channel_spectrum.feed(decim_1_out, channel_filter_pass_f, channel_filter_stop_f);
|
channel_spectrum.feed(decim_1_out, channel_filter_low_f, channel_filter_high_f, channel_filter_transition);
|
||||||
|
|
||||||
const auto channel_out = channel_filter.execute(decim_1_out, dst_buffer);
|
const auto channel_out = channel_filter.execute(decim_1_out, dst_buffer);
|
||||||
|
|
||||||
@ -145,8 +145,9 @@ void NarrowbandFMAudio::configure(const NBFMConfigureMessage& message) {
|
|||||||
decim_1.configure(message.decim_1_filter.taps, 131072);
|
decim_1.configure(message.decim_1_filter.taps, 131072);
|
||||||
channel_filter.configure(message.channel_filter.taps, message.channel_decimation);
|
channel_filter.configure(message.channel_filter.taps, message.channel_decimation);
|
||||||
demod.configure(demod_input_fs, message.deviation);
|
demod.configure(demod_input_fs, message.deviation);
|
||||||
channel_filter_pass_f = message.channel_filter.pass_frequency_normalized * channel_filter_input_fs;
|
channel_filter_low_f = message.channel_filter.low_frequency_normalized * channel_filter_input_fs;
|
||||||
channel_filter_stop_f = message.channel_filter.stop_frequency_normalized * channel_filter_input_fs;
|
channel_filter_high_f = message.channel_filter.high_frequency_normalized * channel_filter_input_fs;
|
||||||
|
channel_filter_transition = message.channel_filter.transition_normalized * channel_filter_input_fs;
|
||||||
channel_spectrum.set_decimation_factor(1.0f);
|
channel_spectrum.set_decimation_factor(1.0f);
|
||||||
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config, (float)message.squelch_level / 100.0);
|
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config, (float)message.squelch_level / 100.0);
|
||||||
|
|
||||||
|
@ -73,8 +73,9 @@ private:
|
|||||||
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { };
|
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
||||||
dsp::decimate::FIRAndDecimateComplex channel_filter { };
|
dsp::decimate::FIRAndDecimateComplex channel_filter { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
int32_t channel_filter_low_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
int32_t channel_filter_high_f = 0;
|
||||||
|
int32_t channel_filter_transition = 0;
|
||||||
|
|
||||||
// For CTCSS decoding
|
// For CTCSS decoding
|
||||||
dsp::decimate::FIR64AndDecimateBy2Real ctcss_filter { };
|
dsp::decimate::FIR64AndDecimateBy2Real ctcss_filter { };
|
||||||
|
@ -29,8 +29,9 @@
|
|||||||
#include "utility.hpp"
|
#include "utility.hpp"
|
||||||
|
|
||||||
ReplayProcessor::ReplayProcessor() {
|
ReplayProcessor::ReplayProcessor() {
|
||||||
channel_filter_pass_f = taps_200k_decim_1.pass_frequency_normalized * 1000000; // 162760.416666667
|
channel_filter_low_f = taps_200k_decim_1.low_frequency_normalized * 1000000;
|
||||||
channel_filter_stop_f = taps_200k_decim_1.stop_frequency_normalized * 1000000; // 337239.583333333
|
channel_filter_high_f = taps_200k_decim_1.high_frequency_normalized * 1000000;
|
||||||
|
channel_filter_transition = taps_200k_decim_1.transition_normalized * 1000000;
|
||||||
|
|
||||||
spectrum_samples = 0;
|
spectrum_samples = 0;
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ void ReplayProcessor::execute(const buffer_c8_t& buffer) {
|
|||||||
spectrum_samples += buffer.count;
|
spectrum_samples += buffer.count;
|
||||||
if( spectrum_samples >= spectrum_interval_samples ) {
|
if( spectrum_samples >= spectrum_interval_samples ) {
|
||||||
spectrum_samples -= spectrum_interval_samples;
|
spectrum_samples -= spectrum_interval_samples;
|
||||||
channel_spectrum.feed(iq_buffer, channel_filter_pass_f, channel_filter_stop_f);
|
channel_spectrum.feed(iq_buffer, channel_filter_low_f, channel_filter_high_f, channel_filter_transition);
|
||||||
|
|
||||||
txprogress_message.progress = bytes_read; // Inform UI about progress
|
txprogress_message.progress = bytes_read; // Inform UI about progress
|
||||||
txprogress_message.done = false;
|
txprogress_message.done = false;
|
||||||
|
@ -54,8 +54,9 @@ private:
|
|||||||
baseband_fs / 8
|
baseband_fs / 8
|
||||||
};
|
};
|
||||||
|
|
||||||
uint32_t channel_filter_pass_f = 0;
|
int32_t channel_filter_low_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
int32_t channel_filter_high_f = 0;
|
||||||
|
int32_t channel_filter_transition = 0;
|
||||||
|
|
||||||
std::unique_ptr<StreamOutput> stream { };
|
std::unique_ptr<StreamOutput> stream { };
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ void WidebandFMAudio::execute(const buffer_c8_t& buffer) {
|
|||||||
spectrum_samples += channel.count;
|
spectrum_samples += channel.count;
|
||||||
if( spectrum_samples >= spectrum_interval_samples ) {
|
if( spectrum_samples >= spectrum_interval_samples ) {
|
||||||
spectrum_samples -= spectrum_interval_samples;
|
spectrum_samples -= spectrum_interval_samples;
|
||||||
channel_spectrum.feed(channel, channel_filter_pass_f, channel_filter_stop_f);
|
channel_spectrum.feed(channel, channel_filter_low_f, channel_filter_high_f, channel_filter_transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 384kHz complex<int16_t>[256]
|
/* 384kHz complex<int16_t>[256]
|
||||||
@ -169,8 +169,9 @@ void WidebandFMAudio::configure(const WFMConfigureMessage& message) {
|
|||||||
|
|
||||||
decim_0.configure(message.decim_0_filter.taps, 33554432);
|
decim_0.configure(message.decim_0_filter.taps, 33554432);
|
||||||
decim_1.configure(message.decim_1_filter.taps, 131072);
|
decim_1.configure(message.decim_1_filter.taps, 131072);
|
||||||
channel_filter_pass_f = message.decim_1_filter.pass_frequency_normalized * decim_1_input_fs;
|
channel_filter_low_f = message.decim_1_filter.low_frequency_normalized * decim_1_input_fs;
|
||||||
channel_filter_stop_f = message.decim_1_filter.stop_frequency_normalized * decim_1_input_fs;
|
channel_filter_high_f = message.decim_1_filter.high_frequency_normalized * decim_1_input_fs;
|
||||||
|
channel_filter_transition = message.decim_1_filter.transition_normalized * decim_1_input_fs;
|
||||||
demod.configure(demod_input_fs, message.deviation);
|
demod.configure(demod_input_fs, message.deviation);
|
||||||
audio_filter.configure(message.audio_filter.taps);
|
audio_filter.configure(message.audio_filter.taps);
|
||||||
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config);
|
audio_output.configure(message.audio_hpf_config, message.audio_deemph_config);
|
||||||
|
@ -67,8 +67,9 @@ private:
|
|||||||
|
|
||||||
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
||||||
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
||||||
uint32_t channel_filter_pass_f = 0;
|
int32_t channel_filter_low_f = 0;
|
||||||
uint32_t channel_filter_stop_f = 0;
|
int32_t channel_filter_high_f = 0;
|
||||||
|
int32_t channel_filter_transition = 0;
|
||||||
|
|
||||||
dsp::demodulate::FM demod { };
|
dsp::demodulate::FM demod { };
|
||||||
dsp::decimate::DecimateBy2CIC4Real audio_dec_1 { };
|
dsp::decimate::DecimateBy2CIC4Real audio_dec_1 { };
|
||||||
|
@ -53,7 +53,7 @@ void WidebandSpectrum::execute(const buffer_c8_t& buffer) {
|
|||||||
};
|
};
|
||||||
channel_spectrum.feed(
|
channel_spectrum.feed(
|
||||||
buffer_c16,
|
buffer_c16,
|
||||||
0, 0
|
0, 0, 0
|
||||||
);
|
);
|
||||||
phase = 0;
|
phase = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,12 +78,14 @@ void SpectrumCollector::set_decimation_factor(
|
|||||||
|
|
||||||
void SpectrumCollector::feed(
|
void SpectrumCollector::feed(
|
||||||
const buffer_c16_t& channel,
|
const buffer_c16_t& channel,
|
||||||
const uint32_t filter_pass_frequency,
|
const int32_t filter_low_frequency,
|
||||||
const uint32_t filter_stop_frequency
|
const int32_t filter_high_frequency,
|
||||||
|
const int32_t filter_transition
|
||||||
) {
|
) {
|
||||||
// Called from baseband processing thread.
|
// Called from baseband processing thread.
|
||||||
channel_filter_pass_frequency = filter_pass_frequency;
|
channel_filter_low_frequency = filter_low_frequency;
|
||||||
channel_filter_stop_frequency = filter_stop_frequency;
|
channel_filter_high_frequency = filter_high_frequency;
|
||||||
|
channel_filter_transition = filter_transition;
|
||||||
|
|
||||||
channel_spectrum_decimator.feed(
|
channel_spectrum_decimator.feed(
|
||||||
channel,
|
channel,
|
||||||
@ -136,8 +138,9 @@ void SpectrumCollector::update() {
|
|||||||
|
|
||||||
ChannelSpectrum spectrum;
|
ChannelSpectrum spectrum;
|
||||||
spectrum.sampling_rate = channel_spectrum_sampling_rate;
|
spectrum.sampling_rate = channel_spectrum_sampling_rate;
|
||||||
spectrum.channel_filter_pass_frequency = channel_filter_pass_frequency;
|
spectrum.channel_filter_low_frequency = channel_filter_low_frequency;
|
||||||
spectrum.channel_filter_stop_frequency = channel_filter_stop_frequency;
|
spectrum.channel_filter_high_frequency = channel_filter_high_frequency;
|
||||||
|
spectrum.channel_filter_transition = channel_filter_transition;
|
||||||
for(size_t i=0; i<spectrum.db.size(); i++) {
|
for(size_t i=0; i<spectrum.db.size(); i++) {
|
||||||
const auto corrected_sample = spectrum_window_hamming_3(channel_spectrum, i);
|
const auto corrected_sample = spectrum_window_hamming_3(channel_spectrum, i);
|
||||||
const auto mag2 = magnitude_squared(corrected_sample * (1.0f / 32768.0f));
|
const auto mag2 = magnitude_squared(corrected_sample * (1.0f / 32768.0f));
|
||||||
|
@ -40,8 +40,9 @@ public:
|
|||||||
|
|
||||||
void feed(
|
void feed(
|
||||||
const buffer_c16_t& channel,
|
const buffer_c16_t& channel,
|
||||||
const uint32_t filter_pass_frequency,
|
const int32_t filter_low_frequency,
|
||||||
const uint32_t filter_stop_frequency
|
const int32_t filter_high_frequency,
|
||||||
|
const int32_t filter_transition
|
||||||
);
|
);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -53,8 +54,9 @@ private:
|
|||||||
bool streaming { false };
|
bool streaming { false };
|
||||||
std::array<std::complex<float>, 256> channel_spectrum { };
|
std::array<std::complex<float>, 256> channel_spectrum { };
|
||||||
uint32_t channel_spectrum_sampling_rate { 0 };
|
uint32_t channel_spectrum_sampling_rate { 0 };
|
||||||
uint32_t channel_filter_pass_frequency { 0 };
|
int32_t channel_filter_low_frequency { 0 };
|
||||||
uint32_t channel_filter_stop_frequency { 0 };
|
int32_t channel_filter_high_frequency { 0 };
|
||||||
|
int32_t channel_filter_transition { 0 };
|
||||||
|
|
||||||
void post_message(const buffer_c16_t& data);
|
void post_message(const buffer_c16_t& data);
|
||||||
|
|
||||||
|
@ -30,15 +30,17 @@
|
|||||||
|
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
struct fir_taps_real {
|
struct fir_taps_real {
|
||||||
float pass_frequency_normalized;
|
float low_frequency_normalized;
|
||||||
float stop_frequency_normalized;
|
float high_frequency_normalized;
|
||||||
|
float transition_normalized;
|
||||||
std::array<int16_t, N> taps;
|
std::array<int16_t, N> taps;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
struct fir_taps_complex {
|
struct fir_taps_complex {
|
||||||
float pass_frequency_normalized;
|
float low_frequency_normalized;
|
||||||
float stop_frequency_normalized;
|
float high_frequency_normalized;
|
||||||
|
float transition_normalized;
|
||||||
std::array<complex16_t, N> taps;
|
std::array<complex16_t, N> taps;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -46,8 +48,9 @@ struct fir_taps_complex {
|
|||||||
|
|
||||||
// IFIR image-reject filter: fs=3072000, pass=8000, stop=344000, decim=8, fout=384000
|
// IFIR image-reject filter: fs=3072000, pass=8000, stop=344000, decim=8, fout=384000
|
||||||
constexpr fir_taps_real<24> taps_16k0_decim_0 {
|
constexpr fir_taps_real<24> taps_16k0_decim_0 {
|
||||||
.pass_frequency_normalized = 8000.0f / 3072000.0f,
|
.low_frequency_normalized = -8000.0f / 3072000.0f,
|
||||||
.stop_frequency_normalized = 344000.0f / 3072000.0f,
|
.high_frequency_normalized = 8000.0f / 3072000.0f,
|
||||||
|
.transition_normalized = 336000.0f / 3072000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
1, 67, 165, 340, 599, 944, 1361, 1820,
|
1, 67, 165, 340, 599, 944, 1361, 1820,
|
||||||
2278, 2684, 2988, 3152, 3152, 2988, 2684, 2278,
|
2278, 2684, 2988, 3152, 3152, 2988, 2684, 2278,
|
||||||
@ -57,8 +60,9 @@ constexpr fir_taps_real<24> taps_16k0_decim_0 {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=384000, pass=8000, stop=40000, decim=8, fout=48000
|
// IFIR prototype filter: fs=384000, pass=8000, stop=40000, decim=8, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_16k0_decim_1 {
|
constexpr fir_taps_real<32> taps_16k0_decim_1 {
|
||||||
.pass_frequency_normalized = 8000.0f / 384000.0f,
|
.low_frequency_normalized = -8000.0f / 384000.0f,
|
||||||
.stop_frequency_normalized = 40000.0f / 384000.0f,
|
.high_frequency_normalized = 8000.0f / 384000.0f,
|
||||||
|
.transition_normalized = 32000.0f / 384000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-26, -125, -180, -275, -342, -359, -286, -90,
|
-26, -125, -180, -275, -342, -359, -286, -90,
|
||||||
250, 733, 1337, 2011, 2688, 3289, 3740, 3982,
|
250, 733, 1337, 2011, 2688, 3289, 3740, 3982,
|
||||||
@ -69,8 +73,9 @@ constexpr fir_taps_real<32> taps_16k0_decim_1 {
|
|||||||
|
|
||||||
// Channel filter: fs=48000, pass=8000, stop=12400, decim=1, fout=48000
|
// Channel filter: fs=48000, pass=8000, stop=12400, decim=1, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_16k0_channel {
|
constexpr fir_taps_real<32> taps_16k0_channel {
|
||||||
.pass_frequency_normalized = 8000.0f / 48000.0f,
|
.low_frequency_normalized = -8000.0f / 48000.0f,
|
||||||
.stop_frequency_normalized = 12400.0f / 48000.0f,
|
.high_frequency_normalized = 8000.0f / 48000.0f,
|
||||||
|
.transition_normalized = 4400.0f / 48000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-73, -285, -376, -8, 609, 538, -584, -1387,
|
-73, -285, -376, -8, 609, 538, -584, -1387,
|
||||||
-148, 2173, 1959, -2146, -5267, -297, 12915, 24737,
|
-148, 2173, 1959, -2146, -5267, -297, 12915, 24737,
|
||||||
@ -83,8 +88,9 @@ constexpr fir_taps_real<32> taps_16k0_channel {
|
|||||||
|
|
||||||
// IFIR image-reject filter: fs=3072000, pass=5500, stop=341500, decim=8, fout=384000
|
// IFIR image-reject filter: fs=3072000, pass=5500, stop=341500, decim=8, fout=384000
|
||||||
constexpr fir_taps_real<24> taps_11k0_decim_0 {
|
constexpr fir_taps_real<24> taps_11k0_decim_0 {
|
||||||
.pass_frequency_normalized = 5500.0f / 3072000.0f,
|
.low_frequency_normalized = -5500.0f / 3072000.0f,
|
||||||
.stop_frequency_normalized = 341500.0f / 3072000.0f,
|
.high_frequency_normalized = 5500.0f / 3072000.0f,
|
||||||
|
.transition_normalized = 336000.0f / 3072000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
38, 102, 220, 406, 668, 1004, 1397, 1822,
|
38, 102, 220, 406, 668, 1004, 1397, 1822,
|
||||||
2238, 2603, 2875, 3020, 3020, 2875, 2603, 2238,
|
2238, 2603, 2875, 3020, 3020, 2875, 2603, 2238,
|
||||||
@ -94,8 +100,9 @@ constexpr fir_taps_real<24> taps_11k0_decim_0 {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=384000, pass=5500, stop=42500, decim=8, fout=48000
|
// IFIR prototype filter: fs=384000, pass=5500, stop=42500, decim=8, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_11k0_decim_1 {
|
constexpr fir_taps_real<32> taps_11k0_decim_1 {
|
||||||
.pass_frequency_normalized = 5500.0f / 384000.0f,
|
.low_frequency_normalized = -5500.0f / 384000.0f,
|
||||||
.stop_frequency_normalized = 42500.0f / 384000.0f,
|
.high_frequency_normalized = 5500.0f / 384000.0f,
|
||||||
|
.transition_normalized = 37000.0f / 384000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-42, -87, -157, -234, -298, -318, -255, -75,
|
-42, -87, -157, -234, -298, -318, -255, -75,
|
||||||
246, 713, 1306, 1976, 2656, 3265, 3724, 3971,
|
246, 713, 1306, 1976, 2656, 3265, 3724, 3971,
|
||||||
@ -106,8 +113,9 @@ constexpr fir_taps_real<32> taps_11k0_decim_1 {
|
|||||||
|
|
||||||
// Channel filter: fs=48000, pass=5500, stop=8900, decim=1, fout=48000
|
// Channel filter: fs=48000, pass=5500, stop=8900, decim=1, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_11k0_channel {
|
constexpr fir_taps_real<32> taps_11k0_channel {
|
||||||
.pass_frequency_normalized = 5500.0f / 48000.0f,
|
.low_frequency_normalized = -5500.0f / 48000.0f,
|
||||||
.stop_frequency_normalized = 8900.0f / 48000.0f,
|
.high_frequency_normalized = 5500.0f / 48000.0f,
|
||||||
|
.transition_normalized = 3400.0f / 48000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-68, -345, -675, -867, -582, 247, 1222, 1562,
|
-68, -345, -675, -867, -582, 247, 1222, 1562,
|
||||||
634, -1379, -3219, -3068, 310, 6510, 13331, 17795,
|
634, -1379, -3219, -3068, 310, 6510, 13331, 17795,
|
||||||
@ -120,8 +128,9 @@ constexpr fir_taps_real<32> taps_11k0_channel {
|
|||||||
|
|
||||||
// IFIR image-reject filter: fs=3072000, pass=4250, stop=340250, decim=8, fout=384000
|
// IFIR image-reject filter: fs=3072000, pass=4250, stop=340250, decim=8, fout=384000
|
||||||
constexpr fir_taps_real<24> taps_4k25_decim_0 {
|
constexpr fir_taps_real<24> taps_4k25_decim_0 {
|
||||||
.pass_frequency_normalized = 4250.0f / 3072000.0f,
|
.low_frequency_normalized = -4250.0f / 3072000.0f,
|
||||||
.stop_frequency_normalized = 340250.0f / 3072000.0f,
|
.high_frequency_normalized = 4250.0f / 3072000.0f,
|
||||||
|
.transition_normalized = 33600.0f / 3072000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
38, 103, 222, 409, 671, 1006, 1399, 1821,
|
38, 103, 222, 409, 671, 1006, 1399, 1821,
|
||||||
2236, 2599, 2868, 3012, 3012, 2868, 2599, 2236,
|
2236, 2599, 2868, 3012, 3012, 2868, 2599, 2236,
|
||||||
@ -131,8 +140,9 @@ constexpr fir_taps_real<24> taps_4k25_decim_0 {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=384000, pass=4250, stop=43750, decim=8, fout=48000
|
// IFIR prototype filter: fs=384000, pass=4250, stop=43750, decim=8, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_4k25_decim_1 {
|
constexpr fir_taps_real<32> taps_4k25_decim_1 {
|
||||||
.pass_frequency_normalized = 4250.0f / 384000.0f,
|
.low_frequency_normalized = -4250.0f / 384000.0f,
|
||||||
.stop_frequency_normalized = 43750.0f / 384000.0f,
|
.high_frequency_normalized = 4250.0f / 384000.0f,
|
||||||
|
.transition_normalized = 39500.0f / 384000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-33, -74, -139, -214, -280, -306, -254, -87,
|
-33, -74, -139, -214, -280, -306, -254, -87,
|
||||||
222, 682, 1274, 1951, 2644, 3268, 3741, 3996,
|
222, 682, 1274, 1951, 2644, 3268, 3741, 3996,
|
||||||
@ -143,8 +153,9 @@ constexpr fir_taps_real<32> taps_4k25_decim_1 {
|
|||||||
|
|
||||||
// Channel filter: fs=48000, pass=4250, stop=7900, decim=1, fout=48000
|
// Channel filter: fs=48000, pass=4250, stop=7900, decim=1, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_4k25_channel {
|
constexpr fir_taps_real<32> taps_4k25_channel {
|
||||||
.pass_frequency_normalized = 4250.0f / 48000.0f,
|
.low_frequency_normalized = -4250.0f / 48000.0f,
|
||||||
.stop_frequency_normalized = 7900.0f / 48000.0f,
|
.high_frequency_normalized = 4250.0f / 48000.0f,
|
||||||
|
.transition_normalized = 3650.0f / 48000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-58, -14, 153, 484, 871, 1063, 770, -141,
|
-58, -14, 153, 484, 871, 1063, 770, -141,
|
||||||
-1440, -2488, -2435, -614, 3035, 7771, 12226, 14927,
|
-1440, -2488, -2435, -614, 3035, 7771, 12226, 14927,
|
||||||
@ -161,8 +172,6 @@ constexpr fir_taps_real<32> taps_4k25_channel {
|
|||||||
* sum(abs(taps)): 125270
|
* sum(abs(taps)): 125270
|
||||||
*/
|
*/
|
||||||
/*constexpr fir_taps_real<64> taps_64_lp_025_025 {
|
/*constexpr fir_taps_real<64> taps_64_lp_025_025 {
|
||||||
.pass_frequency_normalized = 0.025f,
|
|
||||||
.stop_frequency_normalized = 0.025f,
|
|
||||||
.taps = { {
|
.taps = { {
|
||||||
0, 0, -3, -7, -13, -20, -27, -32,
|
0, 0, -3, -7, -13, -20, -27, -32,
|
||||||
-34, -33, -25, -10, 13, 47, 94, 152,
|
-34, -33, -25, -10, 13, 47, 94, 152,
|
||||||
@ -183,8 +192,9 @@ constexpr fir_taps_real<32> taps_4k25_channel {
|
|||||||
* sum(abs(taps)): 125270
|
* sum(abs(taps)): 125270
|
||||||
*/
|
*/
|
||||||
constexpr fir_taps_real<64> taps_64_lp_025_025 {
|
constexpr fir_taps_real<64> taps_64_lp_025_025 {
|
||||||
.pass_frequency_normalized = 0.0125f,
|
.low_frequency_normalized = 0,
|
||||||
.stop_frequency_normalized = 0.0125f,
|
.high_frequency_normalized = 0,
|
||||||
|
.transition_normalized = 0,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
0, 0, 2, 6, 12, 20, 32, 46,
|
0, 0, 2, 6, 12, 20, 32, 46,
|
||||||
64, 85, 110, 138, 169, 204, 241, 281,
|
64, 85, 110, 138, 169, 204, 241, 281,
|
||||||
@ -201,8 +211,9 @@ constexpr fir_taps_real<64> taps_64_lp_025_025 {
|
|||||||
|
|
||||||
// IFIR image-reject filter: fs=3072000, pass=3000, stop=339000, decim=8, fout=384000
|
// IFIR image-reject filter: fs=3072000, pass=3000, stop=339000, decim=8, fout=384000
|
||||||
constexpr fir_taps_real<24> taps_6k0_decim_0 {
|
constexpr fir_taps_real<24> taps_6k0_decim_0 {
|
||||||
.pass_frequency_normalized = 3000.0f / 3072000.0f,
|
.low_frequency_normalized = -3000.0f / 3072000.0f,
|
||||||
.stop_frequency_normalized = 339000.0f / 3072000.0f,
|
.high_frequency_normalized = 3000.0f / 3072000.0f,
|
||||||
|
.transition_normalized = 336000.0f / 3072000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
39, 104, 224, 412, 674, 1008, 1400, 1821,
|
39, 104, 224, 412, 674, 1008, 1400, 1821,
|
||||||
2234, 2594, 2863, 3006, 3006, 2863, 2594, 2234,
|
2234, 2594, 2863, 3006, 3006, 2863, 2594, 2234,
|
||||||
@ -212,8 +223,9 @@ constexpr fir_taps_real<24> taps_6k0_decim_0 {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=384000, pass=3000, stop=45000, decim=8, fout=48000
|
// IFIR prototype filter: fs=384000, pass=3000, stop=45000, decim=8, fout=48000
|
||||||
constexpr fir_taps_real<32> taps_6k0_decim_1 {
|
constexpr fir_taps_real<32> taps_6k0_decim_1 {
|
||||||
.pass_frequency_normalized = 3000.0f / 384000.0f,
|
.low_frequency_normalized = -3000.0f / 384000.0f,
|
||||||
.stop_frequency_normalized = 45000.0f / 384000.0f,
|
.high_frequency_normalized = 3000.0f / 384000.0f,
|
||||||
|
.transition_normalized = 43000.0f / 384000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-26, -63, -123, -195, -263, -295, -253, -99,
|
-26, -63, -123, -195, -263, -295, -253, -99,
|
||||||
199, 651, 1242, 1927, 2633, 3273, 3760, 4023,
|
199, 651, 1242, 1927, 2633, 3273, 3760, 4023,
|
||||||
@ -224,8 +236,9 @@ constexpr fir_taps_real<32> taps_6k0_decim_1 {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=48000, pass=3000, stop=6700, decim=4, fout=12000
|
// IFIR prototype filter: fs=48000, pass=3000, stop=6700, decim=4, fout=12000
|
||||||
constexpr fir_taps_real<32> taps_6k0_decim_2 {
|
constexpr fir_taps_real<32> taps_6k0_decim_2 {
|
||||||
.pass_frequency_normalized = 3000.0f / 48000.0f,
|
.low_frequency_normalized = -3000.0f / 48000.0f,
|
||||||
.stop_frequency_normalized = 6700.0f / 48000.0f,
|
.high_frequency_normalized = 3000.0f / 48000.0f,
|
||||||
|
.transition_normalized = 3700.0f / 48000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
95, 178, 247, 208, -21, -474, -1080, -1640,
|
95, 178, 247, 208, -21, -474, -1080, -1640,
|
||||||
-1857, -1411, -83, 2134, 4978, 7946, 10413, 11815,
|
-1857, -1411, -83, 2134, 4978, 7946, 10413, 11815,
|
||||||
@ -239,8 +252,9 @@ constexpr fir_taps_real<32> taps_6k0_decim_2 {
|
|||||||
* slightly larger than 32767 (33312).
|
* slightly larger than 32767 (33312).
|
||||||
*/
|
*/
|
||||||
constexpr fir_taps_complex<64> taps_6k0_dsb_channel {
|
constexpr fir_taps_complex<64> taps_6k0_dsb_channel {
|
||||||
.pass_frequency_normalized = 3000.0f / 12000.0f,
|
.low_frequency_normalized = -3000.0f / 12000.0f,
|
||||||
.stop_frequency_normalized = 3300.0f / 12000.0f,
|
.high_frequency_normalized = 3000.0f / 12000.0f,
|
||||||
|
.transition_normalized = 300.0f / 12000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
{ -69, 0 }, { -140, 0 }, { 119, 0 }, { 89, 0 },
|
{ -69, 0 }, { -140, 0 }, { 119, 0 }, { 89, 0 },
|
||||||
{ -132, 0 }, { -134, 0 }, { 197, 0 }, { 167, 0 },
|
{ -132, 0 }, { -134, 0 }, { 197, 0 }, { 167, 0 },
|
||||||
@ -265,8 +279,9 @@ constexpr fir_taps_complex<64> taps_6k0_dsb_channel {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=12000, pass=3000, stop=3300, decim=1, fout=12000
|
// IFIR prototype filter: fs=12000, pass=3000, stop=3300, decim=1, fout=12000
|
||||||
constexpr fir_taps_complex<64> taps_2k8_usb_channel {
|
constexpr fir_taps_complex<64> taps_2k8_usb_channel {
|
||||||
.pass_frequency_normalized = 3000.0f / 12000.0f,
|
.low_frequency_normalized = 0,
|
||||||
.stop_frequency_normalized = 3300.0f / 12000.0f,
|
.high_frequency_normalized = 3000.0f / 12000.0f,
|
||||||
|
.transition_normalized = 300.0f / 12000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
{ -146, 0 }, { -41, -45 }, { -1, 10 }, { -95, 69 },
|
{ -146, 0 }, { -41, -45 }, { -1, 10 }, { -95, 69 },
|
||||||
{ -194, -41 }, { -91, -158 }, { 14, -43 }, { -150, 67 },
|
{ -194, -41 }, { -91, -158 }, { 14, -43 }, { -150, 67 },
|
||||||
@ -291,8 +306,9 @@ constexpr fir_taps_complex<64> taps_2k8_usb_channel {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=12000, pass=3000, stop=3300, decim=1, fout=12000
|
// IFIR prototype filter: fs=12000, pass=3000, stop=3300, decim=1, fout=12000
|
||||||
constexpr fir_taps_complex<64> taps_2k8_lsb_channel {
|
constexpr fir_taps_complex<64> taps_2k8_lsb_channel {
|
||||||
.pass_frequency_normalized = 3000.0f / 12000.0f,
|
.low_frequency_normalized = -3000.0f / 12000.0f,
|
||||||
.stop_frequency_normalized = 3300.0f / 12000.0f,
|
.high_frequency_normalized = 0,
|
||||||
|
.transition_normalized = 300.0f / 12000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
{ -146, 0 }, { -41, 45 }, { -1, -10 }, { -95, -69 },
|
{ -146, 0 }, { -41, 45 }, { -1, -10 }, { -95, -69 },
|
||||||
{ -194, 41 }, { -91, 158 }, { 14, 43 }, { -150, -67 },
|
{ -194, 41 }, { -91, 158 }, { 14, 43 }, { -150, -67 },
|
||||||
@ -316,8 +332,9 @@ constexpr fir_taps_complex<64> taps_2k8_lsb_channel {
|
|||||||
// USB AM 700Hz filter: fs=12000, start=600, end=800, width=200, stop=40db, decim=1, fout=12000
|
// USB AM 700Hz filter: fs=12000, start=600, end=800, width=200, stop=40db, decim=1, fout=12000
|
||||||
|
|
||||||
constexpr fir_taps_complex<64> taps_0k7_usb_channel {
|
constexpr fir_taps_complex<64> taps_0k7_usb_channel {
|
||||||
.pass_frequency_normalized = 3000.0f / 12000.0f,
|
.low_frequency_normalized = 600.0f / 12000.0f,
|
||||||
.stop_frequency_normalized = 3300.0f / 12000.0f,
|
.high_frequency_normalized = 800.0f / 12000.0f,
|
||||||
|
.transition_normalized = 200.0f / 12000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
{ 531, 0 }, { 192, 73 }, { 181, 163 }, { 129, 254 },
|
{ 531, 0 }, { 192, 73 }, { 181, 163 }, { 129, 254 },
|
||||||
{ 34, 328 }, { -97, 364 }, { -251, 345 }, { -403, 261 },
|
{ 34, 328 }, { -97, 364 }, { -251, 345 }, { -403, 261 },
|
||||||
@ -342,8 +359,9 @@ constexpr fir_taps_complex<64> taps_0k7_usb_channel {
|
|||||||
|
|
||||||
// IFIR image-reject filter: fs=3072000, pass=100000, stop=484000, decim=4, fout=768000
|
// IFIR image-reject filter: fs=3072000, pass=100000, stop=484000, decim=4, fout=768000
|
||||||
constexpr fir_taps_real<24> taps_200k_wfm_decim_0 = {
|
constexpr fir_taps_real<24> taps_200k_wfm_decim_0 = {
|
||||||
.pass_frequency_normalized = 100000.0f / 3072000.0f,
|
.low_frequency_normalized = -100000.0f / 3072000.0f,
|
||||||
.stop_frequency_normalized = 484000.0f / 3072000.0f,
|
.high_frequency_normalized = 100000.0f / 3072000.0f,
|
||||||
|
.transition_normalized = 384000.0f / 3072000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
48, -18, -151, -364, -557, -548, -139, 789,
|
48, -18, -151, -364, -557, -548, -139, 789,
|
||||||
2187, 3800, 5230, 6071, 6071, 5230, 3800, 2187,
|
2187, 3800, 5230, 6071, 6071, 5230, 3800, 2187,
|
||||||
@ -353,8 +371,9 @@ constexpr fir_taps_real<24> taps_200k_wfm_decim_0 = {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=768000, pass=100000, stop=284000, decim=2, fout=384000
|
// IFIR prototype filter: fs=768000, pass=100000, stop=284000, decim=2, fout=384000
|
||||||
constexpr fir_taps_real<16> taps_200k_wfm_decim_1 = {
|
constexpr fir_taps_real<16> taps_200k_wfm_decim_1 = {
|
||||||
.pass_frequency_normalized = 100000.0f / 768000.0f,
|
.low_frequency_normalized = -100000.0f / 768000.0f,
|
||||||
.stop_frequency_normalized = 284000.0f / 768000.0f,
|
.high_frequency_normalized = 100000.0f / 768000.0f,
|
||||||
|
.transition_normalized = 184000.0f / 768000.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-67, -123, 388, 622, -1342, -2185, 4599, 14486,
|
-67, -123, 388, 622, -1342, -2185, 4599, 14486,
|
||||||
14486, 4599, -2185, -1342, 622, 388, -123, -67,
|
14486, 4599, -2185, -1342, 622, 388, -123, -67,
|
||||||
@ -369,8 +388,9 @@ constexpr fir_taps_real<16> taps_200k_wfm_decim_1 = {
|
|||||||
* sum(abs(taps)): 125270
|
* sum(abs(taps)): 125270
|
||||||
*/
|
*/
|
||||||
constexpr fir_taps_real<64> taps_64_lp_156_198 {
|
constexpr fir_taps_real<64> taps_64_lp_156_198 {
|
||||||
.pass_frequency_normalized = 0.156f,
|
.low_frequency_normalized = -0.156f,
|
||||||
.stop_frequency_normalized = 0.196f,
|
.high_frequency_normalized = 0.156f,
|
||||||
|
.transition_normalized = 0.04f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-27, 166, 104, -36, -174, -129, 109, 287,
|
-27, 166, 104, -36, -174, -129, 109, 287,
|
||||||
148, -232, -430, -130, 427, 597, 49, -716,
|
148, -232, -430, -130, 427, 597, 49, -716,
|
||||||
@ -387,8 +407,9 @@ constexpr fir_taps_real<64> taps_64_lp_156_198 {
|
|||||||
|
|
||||||
// IFIR image-reject filter: fs=2457600, pass=100000, stop=407200, decim=4, fout=614400
|
// IFIR image-reject filter: fs=2457600, pass=100000, stop=407200, decim=4, fout=614400
|
||||||
static constexpr fir_taps_real<24> taps_200k_decim_0 = {
|
static constexpr fir_taps_real<24> taps_200k_decim_0 = {
|
||||||
.pass_frequency_normalized = 100000.0f / 2457600.0f,
|
.low_frequency_normalized = -100000.0f / 2457600.0f,
|
||||||
.stop_frequency_normalized = 407200.0f / 2457600.0f,
|
.high_frequency_normalized = 100000.0f / 2457600.0f,
|
||||||
|
.transition_normalized = 307200.0f / 2457600.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
90, 94, 4, -240, -570, -776, -563, 309,
|
90, 94, 4, -240, -570, -776, -563, 309,
|
||||||
1861, 3808, 5618, 6710, 6710, 5618, 3808, 1861,
|
1861, 3808, 5618, 6710, 6710, 5618, 3808, 1861,
|
||||||
@ -398,8 +419,9 @@ static constexpr fir_taps_real<24> taps_200k_decim_0 = {
|
|||||||
|
|
||||||
// IFIR prototype filter: fs=614400, pass=100000, stop=207200, decim=2, fout=307200
|
// IFIR prototype filter: fs=614400, pass=100000, stop=207200, decim=2, fout=307200
|
||||||
static constexpr fir_taps_real<16> taps_200k_decim_1 = {
|
static constexpr fir_taps_real<16> taps_200k_decim_1 = {
|
||||||
.pass_frequency_normalized = 100000.0f / 614400.0f,
|
.low_frequency_normalized = -100000.0f / 614400.0f,
|
||||||
.stop_frequency_normalized = 207200.0f / 614400.0f,
|
.high_frequency_normalized = 100000.0f / 614400.0f,
|
||||||
|
.transition_normalized = 107200.0f / 614400.0f,
|
||||||
.taps = { {
|
.taps = { {
|
||||||
-132, -256, 545, 834, -1507, -2401, 4666, 14583,
|
-132, -256, 545, 834, -1507, -2401, 4666, 14583,
|
||||||
14583, 4666, -2401, -1507, 834, 545, -256, -132,
|
14583, 4666, -2401, -1507, 834, 545, -256, -132,
|
||||||
|
@ -298,8 +298,9 @@ public:
|
|||||||
struct ChannelSpectrum {
|
struct ChannelSpectrum {
|
||||||
std::array<uint8_t, 256> db { { 0 } };
|
std::array<uint8_t, 256> db { { 0 } };
|
||||||
uint32_t sampling_rate { 0 };
|
uint32_t sampling_rate { 0 };
|
||||||
uint32_t channel_filter_pass_frequency { 0 };
|
int32_t channel_filter_low_frequency { 0 };
|
||||||
uint32_t channel_filter_stop_frequency { 0 };
|
int32_t channel_filter_high_frequency { 0 };
|
||||||
|
int32_t channel_filter_transition { 0 };
|
||||||
};
|
};
|
||||||
|
|
||||||
using ChannelSpectrumFIFO = FIFO<ChannelSpectrum>;
|
using ChannelSpectrumFIFO = FIFO<ChannelSpectrum>;
|
||||||
|
@ -197,7 +197,7 @@ void set_serial_format(const serial_format_t new_value) {
|
|||||||
data->serial_format = new_value;
|
data->serial_format = new_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr uint32_t playdead_magic = 0x88d3bb57;
|
/* static constexpr uint32_t playdead_magic = 0x88d3bb57;
|
||||||
|
|
||||||
uint32_t playing_dead() {
|
uint32_t playing_dead() {
|
||||||
return data->playing_dead;
|
return data->playing_dead;
|
||||||
@ -220,47 +220,59 @@ uint32_t playdead_sequence() {
|
|||||||
void set_playdead_sequence(const uint32_t new_value) {
|
void set_playdead_sequence(const uint32_t new_value) {
|
||||||
data->playdead_sequence = new_value;
|
data->playdead_sequence = new_value;
|
||||||
data->playdead_magic = playdead_magic;
|
data->playdead_magic = playdead_magic;
|
||||||
|
} */
|
||||||
|
|
||||||
|
// ui_config is an uint32_t var storing information bitwise
|
||||||
|
// bits 0,1,2 store the backlight timer
|
||||||
|
// bits 31, 30,29,28,27 stores the different single bit configs depicted below
|
||||||
|
// bits on position 4 to 19 (16 bits) store the clkout frequency
|
||||||
|
|
||||||
|
bool clkout_enabled() {
|
||||||
|
return data->ui_config & (1 << 27);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool config_speaker() {
|
bool config_speaker() {
|
||||||
return (data->ui_config & 0x10000000UL) ? false : true; // Default true
|
return data->ui_config & (1 << 28);
|
||||||
}
|
}
|
||||||
bool stealth_mode() {
|
bool stealth_mode() {
|
||||||
return (data->ui_config & 0x20000000UL) ? true : false;
|
return data->ui_config & (1 << 29);
|
||||||
}
|
|
||||||
|
|
||||||
void set_config_speaker(bool new_value) {
|
|
||||||
data->ui_config = (data->ui_config & ~0x10000000UL) | (!new_value << 28);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_stealth_mode(const bool v) {
|
|
||||||
data->ui_config = (data->ui_config & ~0x20000000UL) | (v << 29);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool config_splash() {
|
|
||||||
return (data->ui_config & 0x80000000UL) ? true : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool config_login() {
|
bool config_login() {
|
||||||
return (data->ui_config & 0x40000000UL) ? true : false;
|
return data->ui_config & (1 << 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool config_splash() {
|
||||||
|
return data->ui_config & (1 << 31);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t config_backlight_timer() {
|
uint32_t config_backlight_timer() {
|
||||||
const uint32_t timer_seconds[8] = { 0, 5, 15, 30, 60, 180, 300, 600 };
|
const uint32_t timer_seconds[8] = { 0, 5, 15, 30, 60, 180, 300, 600 };
|
||||||
|
return timer_seconds[data->ui_config & 7]; //first three bits, 8 possible values
|
||||||
return timer_seconds[data->ui_config & 0x00000007UL];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_config_splash(bool v) {
|
void set_clkout_enabled(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~0x80000000UL) | (v << 31);
|
data->ui_config = (data->ui_config & ~(1 << 27)) | (v << 27);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_config_speaker(bool v) {
|
||||||
|
data->ui_config = (data->ui_config & ~(1 << 28)) | (v << 28);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_stealth_mode(bool v) {
|
||||||
|
data->ui_config = (data->ui_config & ~(1 << 29)) | (v << 29);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_config_login(bool v) {
|
void set_config_login(bool v) {
|
||||||
data->ui_config = (data->ui_config & ~0x40000000UL) | (v << 30);
|
data->ui_config = (data->ui_config & ~(1 << 30)) | (v << 30);
|
||||||
|
}
|
||||||
|
|
||||||
|
void set_config_splash(bool v) {
|
||||||
|
data->ui_config = (data->ui_config & ~(1 << 31)) | (v << 31);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_config_backlight_timer(uint32_t i) {
|
void set_config_backlight_timer(uint32_t i) {
|
||||||
data->ui_config = (data->ui_config & ~0x00000007UL) | (i & 7);
|
data->ui_config = (data->ui_config & ~7) | (i & 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void set_config_textentry(uint8_t new_value) {
|
/*void set_config_textentry(uint8_t new_value) {
|
||||||
@ -291,14 +303,6 @@ void set_pocsag_ignore_address(uint32_t address) {
|
|||||||
data->pocsag_ignore_address = address;
|
data->pocsag_ignore_address = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool clkout_enabled() {
|
|
||||||
return (data->ui_config & 0x08000000UL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_clkout_enabled(bool enable) {
|
|
||||||
data->ui_config = (data->ui_config & ~0x08000000UL) | (enable << 27);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t clkout_freq() {
|
uint32_t clkout_freq() {
|
||||||
uint16_t freq = (data->ui_config & 0x000FFFF0) >> 4;
|
uint16_t freq = (data->ui_config & 0x000FFFF0) >> 4;
|
||||||
if(freq < clkout_freq_range.minimum || freq > clkout_freq_range.maximum) {
|
if(freq < clkout_freq_range.minimum || freq > clkout_freq_range.maximum) {
|
||||||
@ -314,5 +318,6 @@ void set_clkout_freq(uint32_t freq) {
|
|||||||
data->ui_config = (data->ui_config & ~0x000FFFF0) | (clkout_freq_range.clip(freq) << 4);
|
data->ui_config = (data->ui_config & ~0x000FFFF0) | (clkout_freq_range.clip(freq) << 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} /* namespace persistent_memory */
|
} /* namespace persistent_memory */
|
||||||
} /* namespace portapack */
|
} /* namespace portapack */
|
||||||
|
@ -81,7 +81,7 @@ uint32_t config_backlight_timer();
|
|||||||
|
|
||||||
void set_config_splash(bool v);
|
void set_config_splash(bool v);
|
||||||
void set_config_login(bool v);
|
void set_config_login(bool v);
|
||||||
void set_config_speaker(bool new_value);
|
void set_config_speaker(bool v);
|
||||||
void set_config_backlight_timer(uint32_t i);
|
void set_config_backlight_timer(uint32_t i);
|
||||||
|
|
||||||
//uint8_t ui_config_textentry();
|
//uint8_t ui_config_textentry();
|
||||||
@ -94,7 +94,7 @@ uint32_t pocsag_ignore_address();
|
|||||||
void set_pocsag_ignore_address(uint32_t address);
|
void set_pocsag_ignore_address(uint32_t address);
|
||||||
|
|
||||||
bool clkout_enabled();
|
bool clkout_enabled();
|
||||||
void set_clkout_enabled(bool enable);
|
void set_clkout_enabled(bool v);
|
||||||
uint32_t clkout_freq();
|
uint32_t clkout_freq();
|
||||||
void set_clkout_freq(uint32_t freq);
|
void set_clkout_freq(uint32_t freq);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user