mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-05 22:39:04 +00:00
Feature/sliding freq (#3280)
* Add sliding-frequency audio receiver tuning * Move ADS-B receiver to external app * Move AIS receiver to external app * Move APRS receiver to external app * Move APRS transmitter to external app * Isolate filtered spectrum collection from WFM * Fixed the issues #3280 * fpga_bridge.c: init registers per reference fpga_init, add quarter-shift mode setter * radio.hpp: expose cached FPGA quarter-rate shift * radio.cpp: program FPGA quarter-rate shift together with tuning offset * tuning.hpp: pass AFE rate and direction to tuning config, add quarter_shift field * tuning.cpp: import full PRALINE RX/TX tuning tables with quarter-shift offsets * clock_manager: stop writing bogus RX digital gain, keep quarter shift across rate changes * receiver_model: port LPF bandwidth from reference auto_bandwidth, use cached quarter shift * adsb_rx: enable RF amp by default on first run * ui_geomap.hpp: add hemisphere fields, degrees become magnitude * ui_geomap: use hemisphere selector for lat/lon sign, fix minute/second wrap carry * ui_menu: guard select against empty menu * waterfall_designer: header updates for profile file handling * waterfall_designer: exception-free profile parsing, CRLF handling, deferred nav callbacks, backup cleanup * external.ld: scope app section globs to their own object directories * CMakeLists: relink when external.ld changes * tools: add external app symbol placement checker * tools: add guru meditation address lookup script * tools: add per-function stack usage report script Co-authored-by: gullradriel <gullradriel@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,111 @@ struct fir_taps_complex {
|
||||
std::array<complex16_t, N> taps;
|
||||
};
|
||||
|
||||
/*
|
||||
* 768kHz -> 384kHz half-band prefilter. The broad 80...304kHz
|
||||
* transition makes this stage inexpensive while protecting the useful band.
|
||||
*/
|
||||
constexpr fir_taps_real<16> taps_audio_wide_halfband_0{
|
||||
.low_frequency_normalized = -80000.0f / 768000.0f,
|
||||
.high_frequency_normalized = 80000.0f / 768000.0f,
|
||||
.transition_normalized = 224000.0f / 768000.0f,
|
||||
.taps = {{
|
||||
-171,
|
||||
0,
|
||||
1144,
|
||||
0,
|
||||
-4481,
|
||||
0,
|
||||
19892,
|
||||
32767,
|
||||
19892,
|
||||
0,
|
||||
-4481,
|
||||
0,
|
||||
1144,
|
||||
0,
|
||||
-171,
|
||||
0,
|
||||
}},
|
||||
};
|
||||
|
||||
/*
|
||||
* Spectrum capture anti-alias half-band filter. It is run only while a
|
||||
* contiguous 256-sample FFT frame is being collected:
|
||||
* 384kHz -> 192kHz (Zoom x1)
|
||||
* 192kHz -> 96kHz (additional stage for Zoom x2)
|
||||
*/
|
||||
constexpr fir_taps_real<63> taps_audio_spectrum_halfband{
|
||||
.low_frequency_normalized = -0.23f,
|
||||
.high_frequency_normalized = 0.23f,
|
||||
.transition_normalized = 0.04f,
|
||||
.taps = {{
|
||||
-15,
|
||||
0,
|
||||
37,
|
||||
0,
|
||||
-70,
|
||||
0,
|
||||
117,
|
||||
0,
|
||||
-184,
|
||||
0,
|
||||
274,
|
||||
0,
|
||||
-393,
|
||||
0,
|
||||
548,
|
||||
0,
|
||||
-751,
|
||||
0,
|
||||
1018,
|
||||
0,
|
||||
-1374,
|
||||
0,
|
||||
1872,
|
||||
0,
|
||||
-2622,
|
||||
0,
|
||||
3910,
|
||||
0,
|
||||
-6794,
|
||||
0,
|
||||
20812,
|
||||
32767,
|
||||
20812,
|
||||
0,
|
||||
-6794,
|
||||
0,
|
||||
3910,
|
||||
0,
|
||||
-2622,
|
||||
0,
|
||||
1872,
|
||||
0,
|
||||
-1374,
|
||||
0,
|
||||
1018,
|
||||
0,
|
||||
-751,
|
||||
0,
|
||||
548,
|
||||
0,
|
||||
-393,
|
||||
0,
|
||||
274,
|
||||
0,
|
||||
-184,
|
||||
0,
|
||||
117,
|
||||
0,
|
||||
-70,
|
||||
0,
|
||||
37,
|
||||
0,
|
||||
-16,
|
||||
}},
|
||||
};
|
||||
|
||||
// NBFM 16K0F3E emission type /////////////////////////////////////////////
|
||||
|
||||
// IFIR image-reject filter: fs=3072000, pass=8000, stop=344000, decim=8, fout=384000
|
||||
|
||||
@@ -170,6 +170,7 @@ class Message {
|
||||
HunterStop = 112,
|
||||
TetraBsch = 113,
|
||||
TetraDnb = 114,
|
||||
AudioDDCConfig = 115,
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -310,6 +311,16 @@ class SpectrumStreamingConfigMessage : public Message {
|
||||
Mode mode{Mode::Stopped};
|
||||
};
|
||||
|
||||
class AudioDDCConfigMessage : public Message {
|
||||
public:
|
||||
constexpr AudioDDCConfigMessage(int32_t frequency)
|
||||
: Message{ID::AudioDDCConfig},
|
||||
frequency{frequency} {
|
||||
}
|
||||
|
||||
int32_t frequency{0};
|
||||
};
|
||||
|
||||
class WidebandSpectrumConfigMessage : public Message {
|
||||
public:
|
||||
constexpr WidebandSpectrumConfigMessage(
|
||||
@@ -357,6 +368,7 @@ class AudioSpectrumMessage : public Message {
|
||||
struct ChannelSpectrum {
|
||||
std::array<uint8_t, 256> db{{0}};
|
||||
uint32_t sampling_rate{0};
|
||||
int32_t channel_filter_offset{0};
|
||||
int32_t channel_filter_low_frequency{0};
|
||||
int32_t channel_filter_high_frequency{0};
|
||||
int32_t channel_filter_transition{0};
|
||||
|
||||
Reference in New Issue
Block a user