mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-14 02:29:29 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fecfe8b8fc | |||
| dfdd52c667 | |||
| 695e6d19f4 | |||
| 6e9ecf8e7b | |||
| fd158e873a | |||
| f90bd44617 |
@@ -143,7 +143,7 @@ class WFMAMAptOptionsView : public View {
|
||||
};
|
||||
OptionsField options_config{
|
||||
{3 * 8, 0 * 16},
|
||||
16, // Max option char length "80khz (NOAA Apt)" example.
|
||||
16, // Max option char length "80k-NOAA Apt LPF" , example.
|
||||
{
|
||||
// Using common messages from freqman_ui.cpp
|
||||
}};
|
||||
|
||||
@@ -105,10 +105,10 @@ void WFMConfig::apply() const {
|
||||
|
||||
void WFMAMConfig::apply() const {
|
||||
const WFMAMConfigureMessage message{
|
||||
decim_0, // Fixed 24 taps array : taps_16k0_decim_0
|
||||
decim_1, // Fixed 32 taps array : taps_84k_wfm_decim_1
|
||||
taps_64_lp_1875_2166, // Fixed channel audio filter , 64 taps array , to filter DSB AM 2k4 carrier before demod. AM .
|
||||
17000, // NOAA satellite tx , FM deviation = +-17Khz.
|
||||
decim_0, // Fixed 24 taps array : taps_16k0_decim_0
|
||||
decim_1, // Dynamic 32 taps array : taps_80k_wfmam_decim_1, 38k_wfmam
|
||||
taps_64_lp_bpf, // Dynamic 64 taps array , to filter modulated DSB AM 2k4 carrier before demod. AM .(LPF / BPF)
|
||||
17000, // NOAA satellite tx , FM deviation = +-17Khz.
|
||||
apt_audio_12k_notch_2k4_config,
|
||||
apt_audio_12k_lpf_2000hz_config};
|
||||
send_message(&message);
|
||||
|
||||
@@ -65,6 +65,7 @@ struct WFMConfig {
|
||||
struct WFMAMConfig {
|
||||
const fir_taps_real<24> decim_0; // To handle WFM filter BW=40K for NOAA APT
|
||||
const fir_taps_real<32> decim_1;
|
||||
const fir_taps_real<64> taps_64_lp_bpf; // to handle dynamically LPF / BPF .
|
||||
|
||||
void apply() const;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Copyright (C) 2023 Bernd Herzog
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ui.hpp"
|
||||
#include "ui_detector_rx.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "external_app.hpp"
|
||||
|
||||
namespace ui::external_app::detector_rx {
|
||||
void initialize_app(ui::NavigationView& nav) {
|
||||
nav.push<DetectorRxView>();
|
||||
}
|
||||
} // namespace ui::external_app::detector_rx
|
||||
|
||||
extern "C" {
|
||||
|
||||
__attribute__((section(".external_app.app_detector_rx.application_information"), used)) application_information_t _application_information_detector_rx = {
|
||||
/*.memory_location = */ (uint8_t*)0x00000000,
|
||||
/*.externalAppEntry = */ ui::external_app::detector_rx::initialize_app,
|
||||
/*.header_version = */ CURRENT_HEADER_VERSION,
|
||||
/*.app_version = */ VERSION_MD5,
|
||||
|
||||
/*.app_name = */ "Detector",
|
||||
/*.bitmap_data = */
|
||||
{
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x04,
|
||||
0x20,
|
||||
0x12,
|
||||
0x48,
|
||||
0x8A,
|
||||
0x51,
|
||||
0xCA,
|
||||
0x53,
|
||||
0xCA,
|
||||
0x53,
|
||||
0x8A,
|
||||
0x51,
|
||||
0x12,
|
||||
0x48,
|
||||
0x84,
|
||||
0x21,
|
||||
0xC0,
|
||||
0x03,
|
||||
0x40,
|
||||
0x02,
|
||||
0x60,
|
||||
0x06,
|
||||
0x20,
|
||||
0x04,
|
||||
0x30,
|
||||
0x0C,
|
||||
0xF0,
|
||||
0x0F},
|
||||
/*.icon_color = */ ui::Color::orange().v,
|
||||
/*.menu_location = */ app_location_t::RX,
|
||||
/*.desired_menu_position = */ -1,
|
||||
|
||||
// this has to be the biggest baseband used by the app. SPEC
|
||||
/*.m4_app_tag = portapack::spi_flash::image_tag_nfm */ {'P', 'W', 'F', 'M'},
|
||||
/*.m4_app_offset = */ 0x00000000, // will be filled at compile time
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2018 Furrtek
|
||||
* Copyright (C) 2023 gullradriel, Nilorea Studio Inc.
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "ui_detector_rx.hpp"
|
||||
#include "ui_fileman.hpp"
|
||||
#include "ui_freqman.hpp"
|
||||
#include "baseband_api.hpp"
|
||||
#include "file.hpp"
|
||||
#include "oversample.hpp"
|
||||
#include "ui_font_fixed_8x16.hpp"
|
||||
|
||||
using namespace portapack;
|
||||
using namespace tonekey;
|
||||
using portapack::memory::map::backup_ram;
|
||||
|
||||
namespace ui::external_app::detector_rx {
|
||||
|
||||
// Function to map the value from one range to another
|
||||
int32_t DetectorRxView::map(int32_t value, int32_t fromLow, int32_t fromHigh, int32_t toLow, int32_t toHigh) {
|
||||
return toLow + (value - fromLow) * (toHigh - toLow) / (fromHigh - fromLow);
|
||||
}
|
||||
|
||||
void DetectorRxView::focus() {
|
||||
field_lna.focus();
|
||||
}
|
||||
|
||||
DetectorRxView::~DetectorRxView() {
|
||||
// reset performance counters request to default
|
||||
shared_memory.request_m4_performance_counter = 0;
|
||||
receiver_model.disable();
|
||||
audio::output::stop();
|
||||
baseband::shutdown();
|
||||
}
|
||||
|
||||
void DetectorRxView::on_timer() {
|
||||
freq_index++;
|
||||
if (freq_mode == 0 && freq_index >= tetra_uplink_monitoring_frequencies_hz.size()) freq_index = 0; // TETRA UP
|
||||
if (freq_mode == 1 && freq_index >= lora_monitoring_frequencies_hz.size()) freq_index = 0; // Lora
|
||||
if (freq_mode == 2 && freq_index >= remotes_monitoring_frequencies_hz.size()) freq_index = 0; // Remotes
|
||||
|
||||
if (freq_mode == 2)
|
||||
freq_ = remotes_monitoring_frequencies_hz[freq_index];
|
||||
else if (freq_mode == 1)
|
||||
freq_ = lora_monitoring_frequencies_hz[freq_index];
|
||||
else
|
||||
freq_ = tetra_uplink_monitoring_frequencies_hz[freq_index];
|
||||
receiver_model.set_target_frequency(freq_);
|
||||
}
|
||||
|
||||
DetectorRxView::DetectorRxView(NavigationView& nav)
|
||||
: nav_{nav} {
|
||||
add_children({
|
||||
&labels,
|
||||
&field_lna,
|
||||
&field_vga,
|
||||
&field_rf_amp,
|
||||
&field_volume,
|
||||
&text_frequency,
|
||||
&freq_stats_rssi,
|
||||
&freq_stats_db,
|
||||
&text_beep_squelch,
|
||||
&field_beep_squelch,
|
||||
&rssi,
|
||||
&rssi_graph,
|
||||
&field_mode,
|
||||
});
|
||||
|
||||
// activate vertical bar mode
|
||||
rssi.set_vertical_rssi(true);
|
||||
|
||||
freq_ = receiver_model.target_frequency();
|
||||
|
||||
field_beep_squelch.set_value(beep_squelch);
|
||||
field_beep_squelch.on_change = [this](int32_t v) {
|
||||
beep_squelch = v;
|
||||
};
|
||||
|
||||
rssi_graph.set_nb_columns(256);
|
||||
|
||||
change_mode();
|
||||
rssi.set_peak(true, 3000);
|
||||
|
||||
// FILL STEP OPTIONS
|
||||
freq_stats_rssi.set_style(Theme::getInstance()->bg_darkest);
|
||||
freq_stats_db.set_style(Theme::getInstance()->bg_darkest);
|
||||
|
||||
field_mode.on_change = [this](size_t, int32_t value) {
|
||||
freq_mode = value;
|
||||
freq_index = 0;
|
||||
switch (value) {
|
||||
case 1: // Lora
|
||||
text_frequency.set(" 433, 868, 915 Mhz");
|
||||
break;
|
||||
case 2: // Remotes
|
||||
text_frequency.set(" 433, 315 Mhz");
|
||||
break;
|
||||
default:
|
||||
case 0: // TETRA UP
|
||||
text_frequency.set(" 380-390 Mhz");
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void DetectorRxView::on_statistics_update(const ChannelStatistics& statistics) {
|
||||
static int16_t last_max_db = 0;
|
||||
static uint8_t last_min_rssi = 0;
|
||||
static uint8_t last_avg_rssi = 0;
|
||||
static uint8_t last_max_rssi = 0;
|
||||
|
||||
rssi_graph.add_values(rssi.get_min(), rssi.get_avg(), rssi.get_max(), statistics.max_db);
|
||||
|
||||
// refresh db
|
||||
if (last_max_db != statistics.max_db) {
|
||||
last_max_db = statistics.max_db;
|
||||
freq_stats_db.set("Power: " + to_string_dec_int(statistics.max_db) + " db");
|
||||
rssi.set_db(statistics.max_db);
|
||||
}
|
||||
// refresh rssi
|
||||
if (last_min_rssi != rssi_graph.get_graph_min() || last_avg_rssi != rssi_graph.get_graph_avg() || last_max_rssi != rssi_graph.get_graph_max()) {
|
||||
last_min_rssi = rssi_graph.get_graph_min();
|
||||
last_avg_rssi = rssi_graph.get_graph_avg();
|
||||
last_max_rssi = rssi_graph.get_graph_max();
|
||||
freq_stats_rssi.set("RSSI: " + to_string_dec_uint(last_min_rssi) + "/" + to_string_dec_uint(last_avg_rssi) + "/" + to_string_dec_uint(last_max_rssi));
|
||||
}
|
||||
|
||||
if (statistics.max_db > beep_squelch) {
|
||||
baseband::request_audio_beep(map(statistics.max_db, -100, 20, 400, 2600), 24000, 150);
|
||||
}
|
||||
|
||||
} /* on_statistic_updates */
|
||||
|
||||
size_t DetectorRxView::change_mode() {
|
||||
audio::output::stop();
|
||||
receiver_model.disable();
|
||||
baseband::shutdown();
|
||||
|
||||
audio_sampling_rate = audio::Rate::Hz_24000;
|
||||
baseband::run_image(portapack::spi_flash::image_tag_capture);
|
||||
receiver_model.set_modulation(ReceiverModel::Mode::Capture);
|
||||
|
||||
baseband::set_sample_rate(DETECTOR_BW, get_oversample_rate(DETECTOR_BW));
|
||||
// The radio needs to know the effective sampling rate.
|
||||
auto actual_sampling_rate = get_actual_sample_rate(DETECTOR_BW);
|
||||
receiver_model.set_sampling_rate(actual_sampling_rate);
|
||||
receiver_model.set_baseband_bandwidth(filter_bandwidth_for_sampling_rate(actual_sampling_rate));
|
||||
|
||||
audio::set_rate(audio_sampling_rate);
|
||||
audio::output::start();
|
||||
receiver_model.set_headphone_volume(receiver_model.headphone_volume()); // WM8731 hack.
|
||||
|
||||
receiver_model.enable();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
} // namespace ui::external_app::detector_rx
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2018 Furrtek
|
||||
* Copyright (C) 2023 gullradriel, Nilorea Studio Inc.
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _UI_DETECTOR_RX
|
||||
#define _UI_DETECTOR_RX
|
||||
|
||||
#include "analog_audio_app.hpp"
|
||||
#include "app_settings.hpp"
|
||||
#include "audio.hpp"
|
||||
#include "baseband_api.hpp"
|
||||
#include "file.hpp"
|
||||
#include "freqman_db.hpp"
|
||||
#include "portapack_persistent_memory.hpp"
|
||||
#include "radio_state.hpp"
|
||||
#include "receiver_model.hpp"
|
||||
#include "string_format.hpp"
|
||||
#include "ui.hpp"
|
||||
#include "ui_mictx.hpp"
|
||||
#include "ui_receiver.hpp"
|
||||
#include "ui_spectrum.hpp"
|
||||
|
||||
namespace ui::external_app::detector_rx {
|
||||
|
||||
#define DETECTOR_BW 750000
|
||||
|
||||
class DetectorRxView : public View {
|
||||
public:
|
||||
DetectorRxView(NavigationView& nav);
|
||||
~DetectorRxView();
|
||||
|
||||
void focus() override;
|
||||
|
||||
std::string title() const override { return "Detector RX"; };
|
||||
|
||||
private:
|
||||
NavigationView& nav_;
|
||||
|
||||
RxRadioState radio_state_{};
|
||||
|
||||
int32_t map(int32_t value, int32_t fromLow, int32_t fromHigh, int32_t toLow, int32_t toHigh);
|
||||
size_t change_mode();
|
||||
void on_statistics_update(const ChannelStatistics& statistics);
|
||||
void set_display_freq(int64_t freq);
|
||||
void on_timer();
|
||||
|
||||
uint8_t freq_index = 0;
|
||||
rf::Frequency freq_ = {433920000};
|
||||
int32_t beep_squelch = 0;
|
||||
audio::Rate audio_sampling_rate = audio::Rate::Hz_48000;
|
||||
uint8_t freq_mode = 0;
|
||||
|
||||
app_settings::SettingsManager settings_{
|
||||
"rx_detector",
|
||||
app_settings::Mode::RX,
|
||||
{
|
||||
{"beep_squelch"sv, &beep_squelch},
|
||||
}};
|
||||
|
||||
Labels labels{
|
||||
{{UI_POS_X(0), UI_POS_Y(0)}, "LNA: VGA: AMP: VOL: ", Theme::getInstance()->fg_light->foreground}};
|
||||
|
||||
LNAGainField field_lna{
|
||||
{UI_POS_X(4), UI_POS_Y(0)}};
|
||||
|
||||
VGAGainField field_vga{
|
||||
{UI_POS_X(11), UI_POS_Y(0)}};
|
||||
|
||||
RFAmpField field_rf_amp{
|
||||
{UI_POS_X(18), UI_POS_Y(0)}};
|
||||
|
||||
AudioVolumeField field_volume{
|
||||
{UI_POS_X(24), UI_POS_Y(0)}};
|
||||
|
||||
OptionsField field_mode{
|
||||
{UI_POS_X(0), UI_POS_Y(1)},
|
||||
9,
|
||||
{
|
||||
{"TETRA UP", 0},
|
||||
{"Lora", 1},
|
||||
{"Remotes", 2},
|
||||
}};
|
||||
|
||||
Text text_frequency{
|
||||
{UI_POS_X_RIGHT(20), UI_POS_Y(1), UI_POS_WIDTH(20), UI_POS_DEFAULT_HEIGHT},
|
||||
""};
|
||||
|
||||
Text text_beep_squelch{
|
||||
{UI_POS_X_RIGHT(9), UI_POS_Y(2), UI_POS_WIDTH(4), UI_POS_DEFAULT_HEIGHT},
|
||||
"Bip>"};
|
||||
|
||||
NumberField field_beep_squelch{
|
||||
{UI_POS_X_RIGHT(5), UI_POS_Y(2)},
|
||||
4,
|
||||
{-100, 20},
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
// RSSI: XX/XX/XXX
|
||||
Text freq_stats_rssi{
|
||||
{UI_POS_X(0), UI_POS_Y(2), UI_POS_WIDTH(15), UI_POS_DEFAULT_HEIGHT},
|
||||
};
|
||||
|
||||
// Power: -XXX db
|
||||
Text freq_stats_db{
|
||||
{UI_POS_X(0), UI_POS_Y(3), UI_POS_WIDTH(15), UI_POS_DEFAULT_HEIGHT},
|
||||
};
|
||||
|
||||
RSSIGraph rssi_graph{
|
||||
{UI_POS_X(0), UI_POS_Y(5), UI_POS_WIDTH_REMAINING(5), UI_POS_HEIGHT_REMAINING(6)},
|
||||
};
|
||||
|
||||
RSSI rssi{
|
||||
{UI_POS_X_RIGHT(5), UI_POS_Y(5), UI_POS_WIDTH(5), UI_POS_HEIGHT_REMAINING(6)},
|
||||
};
|
||||
|
||||
MessageHandlerRegistration message_handler_stats{
|
||||
Message::ID::ChannelStatistics,
|
||||
[this](const Message* const p) {
|
||||
this->on_statistics_update(static_cast<const ChannelStatisticsMessage*>(p)->statistics);
|
||||
}};
|
||||
|
||||
MessageHandlerRegistration message_handler_frame_sync{
|
||||
Message::ID::DisplayFrameSync,
|
||||
[this](const Message* const) {
|
||||
this->on_timer();
|
||||
}};
|
||||
|
||||
const std::vector<uint32_t> remotes_monitoring_frequencies_hz = {
|
||||
// Around 315 MHz (common for older remotes, key fobs in some regions)
|
||||
// Window centered on 315 MHz, covers 314.625 - 315.375 MHz
|
||||
315000000,
|
||||
|
||||
// Around 433.92 MHz (very common for remotes, sensors, key fobs globally)
|
||||
// Window centered on 433.92 MHz, covers 433.545 - 434.295 MHz
|
||||
433920000,
|
||||
};
|
||||
const std::vector<uint32_t> lora_monitoring_frequencies_hz = {
|
||||
// EU433 Band (Europe, typically 433.05 MHz to 434.79 MHz)
|
||||
// Scanning the approximate range 433.0 MHz to 434.8 MHz with 750kHz steps
|
||||
433375000, // Covers 433.000 - 433.750 MHz
|
||||
434125000, // Covers 433.750 - 434.500 MHz (includes 433.92 MHz)
|
||||
434875000, // Covers 434.500 - 435.250 MHz (covers up to 434.79 MHz)
|
||||
|
||||
// EU868 Band (Europe, typically 863 MHz to 870 MHz, specific channels around 868 MHz)
|
||||
// Targeting common LoRaWAN channel groups (approx 867.0 - 868.6 MHz) with 750kHz steps
|
||||
867375000, // Covers 867.000 - 867.750 MHz
|
||||
868125000, // Covers 867.750 - 868.500 MHz
|
||||
868875000, // Covers 868.500 - 869.250 MHz (covers up to 868.6 MHz)
|
||||
|
||||
// US915 Band (North America, typically 902 MHz to 928 MHz, specific channels around 915 MHz)
|
||||
// Providing a few sample windows around the 915 MHz area with 750kHz steps.
|
||||
// This band is wide; a full scan would require many more frequencies.
|
||||
914250000, // Covers 913.875 - 914.625 MHz
|
||||
915000000, // Covers 914.625 - 915.375 MHz (Centered on 915 MHz)
|
||||
915750000, // Covers 915.375 - 916.125 MHz
|
||||
};
|
||||
const std::vector<uint32_t> tetra_uplink_monitoring_frequencies_hz = {
|
||||
// Band starts at 380,000,000 Hz, ends at 390,000,000 Hz.
|
||||
// First center: 380,000,000 + 375,000 = 380,375,000 Hz
|
||||
// Last center: 380,375,000 + 13 * 750,000 = 390,125,000 Hz (14 frequencies total for this band)
|
||||
380375000, // Covers 380.000 - 380.750 MHz
|
||||
381125000, // Covers 380.750 - 381.500 MHz
|
||||
381875000, // Covers 381.500 - 382.250 MHz
|
||||
382625000, // Covers 382.250 - 383.000 MHz
|
||||
383375000, // Covers 383.000 - 383.750 MHz
|
||||
384125000, // Covers 383.750 - 384.500 MHz
|
||||
384875000, // Covers 384.500 - 385.250 MHz
|
||||
385625000, // Covers 385.250 - 386.000 MHz
|
||||
386375000, // Covers 386.000 - 386.750 MHz
|
||||
387125000, // Covers 386.750 - 387.500 MHz
|
||||
387875000, // Covers 387.500 - 388.250 MHz
|
||||
388625000, // Covers 388.250 - 389.000 MHz
|
||||
389375000, // Covers 389.000 - 389.750 MHz
|
||||
390125000, // Covers 389.750 - 390.500 MHz
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace ui::external_app::detector_rx
|
||||
|
||||
#endif
|
||||
@@ -212,6 +212,10 @@ set(EXTCPPSRC
|
||||
#gfxEQ
|
||||
external/gfxeq/main.cpp
|
||||
external/gfxeq/ui_gfxeq.cpp
|
||||
|
||||
#detector_rx
|
||||
external/detector_rx/main.cpp
|
||||
external/detector_rx/ui_detector_rx.cpp
|
||||
)
|
||||
|
||||
set(EXTAPPLIST
|
||||
@@ -266,4 +270,5 @@ set(EXTAPPLIST
|
||||
scanner
|
||||
level
|
||||
gfxeq
|
||||
detector_rx
|
||||
)
|
||||
|
||||
+10
@@ -74,6 +74,7 @@ MEMORY
|
||||
ram_external_app_level (rwx) : org = 0xADE10000, len = 32k
|
||||
ram_external_app_gfxeq (rwx) : org = 0xADE20000, len = 32k
|
||||
ram_external_app_noaaapt_rx (rwx) : org = 0xADE30000, len = 32k
|
||||
ram_external_app_detector_rx (rwx) : org = 0xADE40000, len = 32k
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
@@ -383,4 +384,13 @@ SECTIONS
|
||||
KEEP(*(.external_app.app_gfxeq.application_information));
|
||||
*(*ui*external_app*gfxeq*);
|
||||
} > ram_external_app_gfxeq
|
||||
|
||||
.external_app_detector_rx : ALIGN(4) SUBALIGN(4)
|
||||
{
|
||||
KEEP(*(.external_app.app_detector_rx.application_information));
|
||||
*(*ui*external_app*detector_rx*);
|
||||
} > ram_external_app_detector_rx
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
+129
-48
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc.
|
||||
* Copyright (C) 2016 Furrtek
|
||||
* Copyright (C) 2025 RocketGod - Added modes from my Flipper Zero RF Jammer App - https://betaskynet.com
|
||||
*
|
||||
* This file is part of PortaPack.
|
||||
*
|
||||
@@ -36,7 +37,6 @@ void RangeView::focus() {
|
||||
}
|
||||
|
||||
void RangeView::update_start(rf::Frequency f) {
|
||||
// Change everything except max
|
||||
frequency_range.min = f;
|
||||
button_start.set_text(to_string_short_freq(f));
|
||||
|
||||
@@ -48,7 +48,6 @@ void RangeView::update_start(rf::Frequency f) {
|
||||
}
|
||||
|
||||
void RangeView::update_stop(rf::Frequency f) {
|
||||
// Change everything except min
|
||||
frequency_range.max = f;
|
||||
button_stop.set_text(to_string_short_freq(f));
|
||||
|
||||
@@ -60,7 +59,6 @@ void RangeView::update_stop(rf::Frequency f) {
|
||||
}
|
||||
|
||||
void RangeView::update_center(rf::Frequency f) {
|
||||
// Change min/max/center, keep width
|
||||
center = f;
|
||||
button_center.set_text(to_string_short_freq(center));
|
||||
|
||||
@@ -75,7 +73,6 @@ void RangeView::update_center(rf::Frequency f) {
|
||||
}
|
||||
|
||||
void RangeView::update_width(uint32_t w) {
|
||||
// Change min/max/width, keep center
|
||||
width = w;
|
||||
|
||||
button_width.set_text(to_string_short_freq(width));
|
||||
@@ -91,7 +88,6 @@ void RangeView::update_width(uint32_t w) {
|
||||
}
|
||||
|
||||
void RangeView::paint(Painter&) {
|
||||
// Draw lines and arrows
|
||||
Rect r;
|
||||
Point p;
|
||||
Coord c;
|
||||
@@ -162,7 +158,7 @@ RangeView::RangeView(NavigationView& nav) {
|
||||
auto load_view = nav.push<FrequencyLoadView>();
|
||||
load_view->on_frequency_loaded = [this](rf::Frequency value) {
|
||||
update_center(value);
|
||||
update_width(100000); // 100kHz default jamming bandwidth when loading unique frequency
|
||||
update_width(100000);
|
||||
};
|
||||
load_view->on_range_loaded = [this](rf::Frequency start, rf::Frequency stop) {
|
||||
update_start(start);
|
||||
@@ -193,10 +189,37 @@ void JammerView::set_jammer_channel(uint32_t i, uint32_t width, uint64_t center,
|
||||
jammer_channels[i].enabled = true;
|
||||
jammer_channels[i].width = (width * 0xFFFFFFULL) / 1536000;
|
||||
jammer_channels[i].center = center;
|
||||
jammer_channels[i].duration = 30720 * duration;
|
||||
jammer_channels[i].duration = duration ? 30720 * duration : 3000;
|
||||
}
|
||||
|
||||
void JammerView::start_tx() {
|
||||
if (update_config()) {
|
||||
jamming = true;
|
||||
button_transmit.set_style(&style_cancel);
|
||||
button_transmit.set_text("STOP");
|
||||
|
||||
transmitter_model.set_rf_amp(field_amp.value());
|
||||
transmitter_model.set_tx_gain(field_gain.value());
|
||||
transmitter_model.set_baseband_bandwidth(28'000'000);
|
||||
transmitter_model.enable();
|
||||
|
||||
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||
mscounter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void JammerView::stop_tx() {
|
||||
button_transmit.set_style(&style_val);
|
||||
button_transmit.set_text("START");
|
||||
transmitter_model.disable();
|
||||
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
|
||||
jamming = false;
|
||||
cooling = false;
|
||||
seconds = 0;
|
||||
mscounter = 0;
|
||||
}
|
||||
|
||||
bool JammerView::update_config() {
|
||||
uint32_t c, i = 0;
|
||||
size_t num_channels;
|
||||
rf::Frequency start_freq, range_bw, range_bw_sub, ch_width;
|
||||
@@ -204,24 +227,19 @@ void JammerView::start_tx() {
|
||||
|
||||
size_t hop_value = options_hop.selected_index_value();
|
||||
|
||||
// Disable all channels by default
|
||||
for (c = 0; c < JAMMER_MAX_CH; c++)
|
||||
jammer_channels[c].enabled = false;
|
||||
|
||||
// Generate jamming channels with JAMMER_MAX_CH maximum width
|
||||
// Convert ranges min/max to center/bw
|
||||
for (size_t r = 0; r < 3; r++) {
|
||||
if (range_views[r]->frequency_range.enabled) {
|
||||
range_bw = abs(range_views[r]->frequency_range.max - range_views[r]->frequency_range.min);
|
||||
|
||||
// Get lower bound
|
||||
if (range_views[r]->frequency_range.min < range_views[r]->frequency_range.max)
|
||||
start_freq = range_views[r]->frequency_range.min;
|
||||
else
|
||||
start_freq = range_views[r]->frequency_range.max;
|
||||
|
||||
if (range_bw >= JAMMER_CH_WIDTH) {
|
||||
// Split range in multiple channels
|
||||
num_channels = 0;
|
||||
range_bw_sub = range_bw;
|
||||
|
||||
@@ -241,7 +259,6 @@ void JammerView::start_tx() {
|
||||
i++;
|
||||
}
|
||||
} else {
|
||||
// Range fits in a single channel
|
||||
if (i >= JAMMER_MAX_CH) {
|
||||
out_of_ranges = true;
|
||||
} else {
|
||||
@@ -254,43 +271,24 @@ void JammerView::start_tx() {
|
||||
|
||||
if (!out_of_ranges && i) {
|
||||
text_range_total.set("/" + to_string_dec_uint(i, 2));
|
||||
|
||||
jamming = true;
|
||||
button_transmit.set_style(&style_cancel);
|
||||
button_transmit.set_text("STOP");
|
||||
|
||||
transmitter_model.set_rf_amp(field_amp.value());
|
||||
transmitter_model.set_tx_gain(field_gain.value());
|
||||
transmitter_model.set_baseband_bandwidth(28'000'000); // Although tx is narrowband , let's use Max TX LPF .
|
||||
transmitter_model.enable();
|
||||
|
||||
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||
mscounter = 0; // euquiq: Reset internal ms counter for do_timer()
|
||||
return true;
|
||||
} else {
|
||||
if (out_of_ranges)
|
||||
nav_.display_modal("Error", "Jamming bandwidth too large.\nMust be less than 24MHz.");
|
||||
else
|
||||
nav_.display_modal("Error", "No range enabled.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void JammerView::stop_tx() {
|
||||
button_transmit.set_style(&style_val);
|
||||
button_transmit.set_text("START");
|
||||
transmitter_model.disable();
|
||||
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
|
||||
jamming = false;
|
||||
cooling = false;
|
||||
}
|
||||
|
||||
// called each 1/60th of second
|
||||
void JammerView::on_timer() {
|
||||
if (++mscounter == 60) {
|
||||
if (++mscounter >= 60) {
|
||||
mscounter = 0;
|
||||
if (jamming) {
|
||||
int32_t timepause = field_timepause.value();
|
||||
if (cooling) {
|
||||
if (++seconds >= field_timepause.value()) { // Re-start TX
|
||||
transmitter_model.set_baseband_bandwidth(28'000'000); // Although tx is narrowband , let's use Max TX LPF .
|
||||
if (timepause == 0 || ++seconds >= timepause) {
|
||||
transmitter_model.set_baseband_bandwidth(28'000'000);
|
||||
transmitter_model.enable();
|
||||
button_transmit.set_text("STOP");
|
||||
baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||
@@ -306,8 +304,7 @@ void JammerView::on_timer() {
|
||||
seconds = 0;
|
||||
}
|
||||
} else {
|
||||
if (++seconds >= field_timetx.value()) // Start cooling period:
|
||||
{
|
||||
if (timepause && ++seconds >= field_timetx.value()) {
|
||||
transmitter_model.disable();
|
||||
button_transmit.set_text("PAUSED");
|
||||
baseband::set_jammer(false, JammerType::TYPE_FSK, 0);
|
||||
@@ -327,11 +324,9 @@ void JammerView::on_timer() {
|
||||
}
|
||||
}
|
||||
|
||||
JammerView::JammerView(
|
||||
NavigationView& nav)
|
||||
JammerView::JammerView(NavigationView& nav)
|
||||
: nav_{nav} {
|
||||
Rect view_rect = {0, 3 * 8, screen_width, 80};
|
||||
// baseband::run_image(portapack::spi_flash::image_tag_jammer);
|
||||
baseband::run_prepared_image(portapack::memory::map::m4_code.base());
|
||||
|
||||
add_children({&tab_view,
|
||||
@@ -355,15 +350,101 @@ JammerView::JammerView(
|
||||
view_range_b.set_parent_rect(view_rect);
|
||||
view_range_c.set_parent_rect(view_rect);
|
||||
|
||||
options_type.set_selected_index(3); // Rand CW
|
||||
options_speed.set_selected_index(3); // 10kHz
|
||||
options_hop.set_selected_index(1); // 50ms
|
||||
button_transmit.set_style(&style_val);
|
||||
view_range_a.check_enabled.set_value(true);
|
||||
view_range_a.frequency_range.enabled = true;
|
||||
view_range_a.update_center(315'000'000);
|
||||
view_range_a.update_width(1'000'000);
|
||||
|
||||
options_type.set_selected_index(3);
|
||||
options_speed.set_selected_index(3);
|
||||
options_hop.set_selected_index(0);
|
||||
field_timetx.set_value(30);
|
||||
field_timepause.set_value(1);
|
||||
field_timepause.set_value(0);
|
||||
field_jitter.set_value(0);
|
||||
field_gain.set_value(transmitter_model.tx_gain());
|
||||
field_amp.set_value(transmitter_model.rf_amp());
|
||||
button_transmit.set_style(&style_val);
|
||||
|
||||
options_type.on_change = [this](size_t, OptionsField::value_t) {
|
||||
if (jamming) update_config();
|
||||
if (jamming && !cooling) baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||
};
|
||||
|
||||
options_speed.on_change = [this](size_t, OptionsField::value_t) {
|
||||
if (jamming) update_config();
|
||||
if (jamming && !cooling) baseband::set_jammer(true, (JammerType)options_type.selected_index(), options_speed.selected_index_value());
|
||||
};
|
||||
|
||||
options_hop.on_change = [this](size_t, OptionsField::value_t) {
|
||||
if (jamming) update_config();
|
||||
};
|
||||
|
||||
field_timetx.on_change = [this](int32_t) {
|
||||
if (jamming) update_config();
|
||||
};
|
||||
|
||||
field_timepause.on_change = [this](int32_t) {
|
||||
if (jamming) update_config();
|
||||
};
|
||||
|
||||
field_jitter.on_change = [this](int32_t) {
|
||||
if (jamming) update_config();
|
||||
};
|
||||
|
||||
field_gain.on_change = [this](int32_t v) {
|
||||
if (jamming) transmitter_model.set_tx_gain(v);
|
||||
};
|
||||
|
||||
field_amp.on_change = [this](int32_t v) {
|
||||
if (jamming) transmitter_model.set_rf_amp(v);
|
||||
};
|
||||
|
||||
for (auto range_view : range_views) {
|
||||
range_view->check_enabled.on_select = [this](Checkbox&, bool) {
|
||||
if (jamming) update_config();
|
||||
};
|
||||
range_view->button_start.on_select = [this, range_view](Button&) {
|
||||
auto new_view = nav_.push<FrequencyKeypadView>(range_view->frequency_range.min);
|
||||
new_view->on_changed = [this, range_view](rf::Frequency f) {
|
||||
range_view->update_start(f);
|
||||
if (jamming) update_config();
|
||||
};
|
||||
};
|
||||
range_view->button_stop.on_select = [this, range_view](Button&) {
|
||||
auto new_view = nav_.push<FrequencyKeypadView>(range_view->frequency_range.max);
|
||||
new_view->on_changed = [this, range_view](rf::Frequency f) {
|
||||
range_view->update_stop(f);
|
||||
if (jamming) update_config();
|
||||
};
|
||||
};
|
||||
range_view->button_center.on_select = [this, range_view](Button&) {
|
||||
auto new_view = nav_.push<FrequencyKeypadView>(range_view->center);
|
||||
new_view->on_changed = [this, range_view](rf::Frequency f) {
|
||||
range_view->update_center(f);
|
||||
if (jamming) update_config();
|
||||
};
|
||||
};
|
||||
range_view->button_width.on_select = [this, range_view](Button&) {
|
||||
auto new_view = nav_.push<FrequencyKeypadView>(range_view->width);
|
||||
new_view->on_changed = [this, range_view](rf::Frequency f) {
|
||||
range_view->update_width(f);
|
||||
if (jamming) update_config();
|
||||
};
|
||||
};
|
||||
range_view->button_load_range.on_select = [this, range_view](Button&) {
|
||||
auto load_view = nav_.push<FrequencyLoadView>();
|
||||
load_view->on_frequency_loaded = [this, range_view](rf::Frequency value) {
|
||||
range_view->update_center(value);
|
||||
range_view->update_width(100000);
|
||||
if (jamming) update_config();
|
||||
};
|
||||
load_view->on_range_loaded = [this, range_view](rf::Frequency start, rf::Frequency stop) {
|
||||
range_view->update_start(start);
|
||||
range_view->update_stop(stop);
|
||||
if (jamming) update_config();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
button_transmit.on_select = [this](Button&) {
|
||||
if (jamming || cooling)
|
||||
|
||||
+29
-25
@@ -41,27 +41,12 @@ class RangeView : public View {
|
||||
RangeView(NavigationView& nav);
|
||||
|
||||
void focus() override;
|
||||
void paint(Painter&) override;
|
||||
void paint(Painter& painter) override;
|
||||
|
||||
jammer_range_t frequency_range{false, 0, 0};
|
||||
|
||||
private:
|
||||
void update_start(rf::Frequency f);
|
||||
void update_stop(rf::Frequency f);
|
||||
void update_center(rf::Frequency f);
|
||||
void update_width(uint32_t w);
|
||||
|
||||
uint32_t width{};
|
||||
rf::Frequency center{};
|
||||
|
||||
const Style& style_info = *Theme::getInstance()->fg_medium;
|
||||
|
||||
Labels labels{
|
||||
{{2 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_START], Theme::getInstance()->fg_light->foreground},
|
||||
{{23 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_STOP], Theme::getInstance()->fg_light->foreground},
|
||||
{{12 * 8, 5 * 8 - 4}, "Center", Theme::getInstance()->fg_light->foreground},
|
||||
{{12 * 8 + 4, 13 * 8}, "Width", Theme::getInstance()->fg_light->foreground}};
|
||||
|
||||
Checkbox check_enabled{
|
||||
{1 * 8, 4},
|
||||
12,
|
||||
@@ -74,15 +59,32 @@ class RangeView : public View {
|
||||
Button button_start{
|
||||
{0 * 8, 11 * 8, 11 * 8, 28},
|
||||
""};
|
||||
|
||||
Button button_stop{
|
||||
{19 * 8, 11 * 8, 11 * 8, 28},
|
||||
""};
|
||||
|
||||
Button button_center{
|
||||
{76, 4 * 15 - 4, 11 * 8, 28},
|
||||
""};
|
||||
|
||||
Button button_width{
|
||||
{76, 8 * 15, 11 * 8, 28},
|
||||
""};
|
||||
|
||||
void update_start(rf::Frequency f);
|
||||
void update_stop(rf::Frequency f);
|
||||
void update_center(rf::Frequency f);
|
||||
void update_width(uint32_t w);
|
||||
|
||||
private:
|
||||
const Style& style_info = *Theme::getInstance()->fg_medium;
|
||||
|
||||
Labels labels{
|
||||
{{2 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_START], Theme::getInstance()->fg_light->foreground},
|
||||
{{23 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_STOP], Theme::getInstance()->fg_light->foreground},
|
||||
{{12 * 8, 5 * 8 - 4}, "Center", Theme::getInstance()->fg_light->foreground},
|
||||
{{12 * 8 + 4, 13 * 8}, "Width", Theme::getInstance()->fg_light->foreground}};
|
||||
};
|
||||
|
||||
class JammerView : public View {
|
||||
@@ -110,15 +112,16 @@ class JammerView : public View {
|
||||
void start_tx();
|
||||
void on_timer();
|
||||
void stop_tx();
|
||||
bool update_config();
|
||||
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);
|
||||
|
||||
JammerChannel* jammer_channels = (JammerChannel*)shared_memory.bb_data.data;
|
||||
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
|
||||
bool cooling{false};
|
||||
uint16_t seconds{0};
|
||||
int16_t mscounter{0};
|
||||
lfsr_word_t lfsr_v{1};
|
||||
|
||||
const Style& style_val = *Theme::getInstance()->fg_green;
|
||||
const Style& style_cancel = *Theme::getInstance()->fg_red;
|
||||
@@ -140,8 +143,8 @@ class JammerView : public View {
|
||||
{{1 * 8, 25 * 8}, "Speed:", Theme::getInstance()->fg_light->foreground},
|
||||
{{3 * 8, 27 * 8}, "Hop:", Theme::getInstance()->fg_light->foreground},
|
||||
{{4 * 8, 29 * 8}, "TX:", Theme::getInstance()->fg_light->foreground},
|
||||
{{1 * 8, 31 * 8}, "Sle3p:", Theme::getInstance()->fg_light->foreground}, // euquiq: Token of appreciation to TheSle3p, which made this ehnancement a reality with his bounty.
|
||||
{{0 * 8, 33 * 8}, "Jitter:", Theme::getInstance()->fg_light->foreground}, // Maybe the repository curator can keep the "mystype" for some versions.
|
||||
{{1 * 8, 31 * 8}, "Sleep:", Theme::getInstance()->fg_light->foreground},
|
||||
{{0 * 8, 33 * 8}, "Jitter:", Theme::getInstance()->fg_light->foreground},
|
||||
{{11 * 8, 29 * 8}, "Secs.", Theme::getInstance()->fg_light->foreground},
|
||||
{{11 * 8, 31 * 8}, "Secs.", Theme::getInstance()->fg_light->foreground},
|
||||
{{11 * 8, 33 * 8}, "/60", Theme::getInstance()->fg_light->foreground},
|
||||
@@ -182,7 +185,8 @@ class JammerView : public View {
|
||||
OptionsField options_hop{
|
||||
{7 * 8, 27 * 8},
|
||||
5,
|
||||
{{"10ms ", 1},
|
||||
{{"Off ", 0},
|
||||
{"10ms ", 1},
|
||||
{"50ms ", 5},
|
||||
{"100ms", 10},
|
||||
{"1s ", 100},
|
||||
@@ -201,7 +205,7 @@ class JammerView : public View {
|
||||
NumberField field_timepause{
|
||||
{8 * 8, 31 * 8},
|
||||
2,
|
||||
{1, 60},
|
||||
{0, 60},
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
@@ -209,7 +213,7 @@ class JammerView : public View {
|
||||
NumberField field_jitter{
|
||||
{8 * 8, 33 * 8},
|
||||
2,
|
||||
{1, 60},
|
||||
{0, 60},
|
||||
1,
|
||||
' ',
|
||||
};
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ __attribute__((section(".external_app.app_random_password.application_informatio
|
||||
0x01,
|
||||
},
|
||||
/*.icon_color = */ ui::Color::yellow().v,
|
||||
/*.menu_location = */ app_location_t::RX,
|
||||
/*.menu_location = */ app_location_t::UTILITIES,
|
||||
/*.desired_menu_position = */ -1,
|
||||
|
||||
/*.m4_app_tag = portapack::spi_flash::image_tag_afsk_rx */ {'P', 'A', 'F', 'R'},
|
||||
|
||||
@@ -108,8 +108,9 @@ options_t freqman_bandwidths[6] = {
|
||||
},
|
||||
{
|
||||
// WFMAM for NOAA satellites, 137 Mhz band
|
||||
{"80kHz (NOAA Apt)", 0}, // Fixed RX demod- WFM config Index 1 : FM+AM for Audio NOAA APT ones.
|
||||
{"38kHz (NOAA Apt)", 1},
|
||||
{"80k-NOAA Apt LPF", 0}, // Captured RF IQ filtered BW 80K, APT baseband filtered with Low Pass Filter 4k5 fc -3dB
|
||||
{"38k-NOAA Apt LPF", 1}, // Captured RF IQ filtered BW 38K, APT baseband filtered with Low Pass Filter 4k5 fc -3dB
|
||||
{"38k-NOAA Apt BPF", 2}, // Captured RF IQ filtered BW 38K, APT baseband filtered BPF centred to the 2k4 AM subcarrier, BW = 2KHz
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -69,9 +69,10 @@ static constexpr std::array<baseband::WFMConfig, 3> wfm_configs{{
|
||||
{taps_80k_wfm_decim_0, taps_80k_wfm_decim_1},
|
||||
}};
|
||||
|
||||
static constexpr std::array<baseband::WFMAMConfig, 2> wfmam_configs{{
|
||||
{taps_16k0_decim_0, taps_80k_wfmam_decim_1},
|
||||
{taps_16k0_decim_0, taps_38k_wfmam_decim_1},
|
||||
static constexpr std::array<baseband::WFMAMConfig, 3> wfmam_configs{{
|
||||
{taps_16k0_decim_0, taps_80k_wfmam_decim_1, taps_64_lp_1875_2166},
|
||||
{taps_16k0_decim_0, taps_38k_wfmam_decim_1, taps_64_lp_1875_2166},
|
||||
{taps_16k0_decim_0, taps_38k_wfmam_decim_1, taps_64_bpf_2k4_bw_2k},
|
||||
}};
|
||||
|
||||
} /* namespace */
|
||||
|
||||
@@ -157,7 +157,7 @@ void NoaaAptRx::configure(const NoaaAptRxConfigureMessage& message) {
|
||||
channel_filter_high_f = taps_38k_wfmam_decim_1.high_frequency_normalized * decim_1_input_fs;
|
||||
channel_filter_transition = taps_38k_wfmam_decim_1.transition_normalized * decim_1_input_fs;
|
||||
demod.configure(demod_input_fs, 17000);
|
||||
audio_filter.configure(taps_64_lp_1875_2166.taps);
|
||||
audio_filter.configure(taps_64_bpf_2k4_bw_2k.taps);
|
||||
audio_output.configure(apt_audio_12k_notch_2k4_config, apt_audio_12k_lpf_2000hz_config);
|
||||
// channel_spectrum.set_decimation_factor(1);
|
||||
update_params();
|
||||
|
||||
@@ -1491,6 +1491,26 @@ constexpr fir_taps_real<64> taps_64_lp_1875_2166{
|
||||
}},
|
||||
};
|
||||
|
||||
/* 1st Wideband FM demod baseband filter of audio AM tones ,
|
||||
to pass all DSB band of AM fsubcarrier 2.4Khz mod. with APT */
|
||||
/* 24kHz int16_t input
|
||||
* -> FIR filter, BPF center 2k4 carrier ,APT BW 2kHz
|
||||
* -> 12kHz int16_t output, gain of 1.0 (I think).
|
||||
*/
|
||||
constexpr fir_taps_real<64> taps_64_bpf_2k4_bw_2k{
|
||||
.low_frequency_normalized = -0.1875f, // not updated, this is just for LPF , waterfall GUI, we are not using in BPF NOAA app.
|
||||
.high_frequency_normalized = 0.1875f, // not used GUI in NOAA App.
|
||||
.transition_normalized = 0.03f, // not used GUI in NOAA app.
|
||||
.taps = {{-45, -29, 32, 63, 0, -125, -181, -81, 61,
|
||||
0, -329, -635, -551, -147, 0, -547, -1404, -1625,
|
||||
-849, 0, -414, -2118, -3358, -2422, 0, 911, -1792,
|
||||
-6126, -6773, 0, 11839, 21131, 21131, 11839, 0, -6773,
|
||||
-6126, -1792, 911, 0, -2422, -3358, -2118, -414, 0,
|
||||
-849, -1625, -1404, -547, 0, -147, -551, -635, -329,
|
||||
0, 61, -81, -181, -125, 0, 63, 32, -29,
|
||||
-45}},
|
||||
};
|
||||
|
||||
// TPMS decimation filters ////////////////////////////////////////////////
|
||||
|
||||
// IFIR image-reject filter: fs=2457600, pass=100000, stop=407200, decim=4, fout=614400
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace ui {
|
||||
|
||||
// default font height
|
||||
#define UI_POS_DEFAULT_HEIGHT 16
|
||||
// small height
|
||||
#define UI_POS_DEFAULT_HEIGHT_SMALL 8
|
||||
// default font width
|
||||
#define UI_POS_DEFAULT_WIDTH 8
|
||||
// px position of the linenum-th character (Y)
|
||||
|
||||
Reference in New Issue
Block a user