mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-14 08:47:39 +00:00
Added a bunch of notes about Radiosonde RX (help !)
This commit is contained in:
@@ -20,13 +20,61 @@
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* Notes to self (or others, welcome !):
|
||||
* Sharebrained wrote in matched_filter.hpp that taps should be those of a complex low-pass filter combined with a complex sinusoid, so
|
||||
* that the filter shifts the spectrum where we want (signal of interest around 0Hz).
|
||||
*
|
||||
* In this baseband processor, after decim_0 and decim_1, the signal ends up being sampled at 38400Hz (2457600 / 8 / 8)
|
||||
* Since the applied shift in ui_sonde.cpp is -fs/4 = -2457600/4 = -614400Hz to avoid the DC spike, the FSK signal ends up being
|
||||
* shifted by 614400 / 8 / 8 = 9600Hz. So decim_1_out should look like this:
|
||||
*
|
||||
* _______________|__/'\__________
|
||||
* -C A B C
|
||||
*
|
||||
* A is the DC spike at 0Hz
|
||||
* B is the FSK signal shifted right at 9600Hz
|
||||
* C is the bandwidth edge at 19200Hz
|
||||
*
|
||||
* Taps should be computed to shift the whole spectrum by -9600Hz ("left") so that it looks like this:
|
||||
*
|
||||
* ______________/'\______________
|
||||
* -C D C
|
||||
*
|
||||
* A should have been filtered off ?
|
||||
* D is B around 0Hz now
|
||||
*
|
||||
* Then the clock_recovery function should be happy :)
|
||||
*
|
||||
* Mathworks.com says:
|
||||
* In the case of a single-rate FIR design, we simply multiply each set of coefficients by (aka 'heterodyne with') a complex exponential.
|
||||
*
|
||||
* Can SciPy's remez function be used for this ? See tools/firtest.py
|
||||
* GnuRadio's firdes only outputs an odd number of taps
|
||||
*
|
||||
* ---------------------------------------------------------------------
|
||||
*
|
||||
* Looking at the AIS baseband processor:
|
||||
*
|
||||
* Copied everything necessary to get decim_1_out (so same 8 * 8 = 64 decimation factor)
|
||||
* The samplerate is also the same (2457600)
|
||||
* After the matching filter, the data is decimated by 2 so the final samplerate for clock_recovery is 38400 / 2 = 19200Hz.
|
||||
* Like here, the shift used is fs/4, so decim_1_out should be looking similar.
|
||||
* The AIS signal deviates by 2400 (4800Hz signal width), the symbol rate is 9600.
|
||||
*
|
||||
* The matched filter's input samplerate is 38400Hz, to get a 9600Hz shift it must use 4 taps ?
|
||||
* To obtain unity gain, the sinusoid length must be / by the number of taps ?
|
||||
*
|
||||
* See ais_baseband.hpp
|
||||
*
|
||||
* */
|
||||
|
||||
#ifndef __PROC_SONDE_H__
|
||||
#define __PROC_SONDE_H__
|
||||
|
||||
#include "baseband_processor.hpp"
|
||||
#include "baseband_thread.hpp"
|
||||
#include "rssi_thread.hpp"
|
||||
#include "proc_tpms.hpp"
|
||||
#include "proc_ais.hpp"
|
||||
|
||||
#include "channel_decimator.hpp"
|
||||
#include "matched_filter.hpp"
|
||||
@@ -36,8 +84,6 @@
|
||||
#include "packet_builder.hpp"
|
||||
#include "baseband_packet.hpp"
|
||||
|
||||
#include "ook.hpp"
|
||||
|
||||
#include "message.hpp"
|
||||
#include "portapack_shared_memory.hpp"
|
||||
|
||||
@@ -63,13 +109,13 @@ private:
|
||||
dst.size()
|
||||
};
|
||||
|
||||
dsp::decimate::FIRC8xR16x24FS4Decim4 decim_0 { };
|
||||
dsp::decimate::FIRC16xR16x16Decim2 decim_1 { };
|
||||
dsp::decimate::FIRC8xR16x24FS4Decim8 decim_0 { };
|
||||
dsp::decimate::FIRC16xR16x32Decim8 decim_1 { };
|
||||
dsp::matched_filter::MatchedFilter mf { baseband::ais::square_taps_38k4_1t_p, 2 };
|
||||
|
||||
dsp::matched_filter::MatchedFilter mf_38k4_1t_19k2 { rect_taps_307k2_38k4_1t_19k2_p, 8 };
|
||||
|
||||
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery_fsk_19k2 {
|
||||
38400, 19200, { 0.0555f },
|
||||
// AIS: 19200, 9600
|
||||
clock_recovery::ClockRecovery<clock_recovery::FixedErrorFilter> clock_recovery_fsk_4800 {
|
||||
19200, 4800, { 0.0555f },
|
||||
[this](const float raw_symbol) {
|
||||
const uint_fast8_t sliced_symbol = (raw_symbol >= 0.0f) ? 1 : 0;
|
||||
this->packet_builder_fsk_4800_M10.execute(sliced_symbol);
|
||||
@@ -78,7 +124,7 @@ private:
|
||||
PacketBuilder<BitPattern, NeverMatch, FixedLength> packet_builder_fsk_4800_M10 {
|
||||
{ 0b11001100110011001010011001001100, 32, 1 },
|
||||
{ },
|
||||
{ 102 * 8 },
|
||||
{ 50 }, // { 102 * 8 },
|
||||
[this](const baseband::Packet& packet) {
|
||||
const SondePacketMessage message { sonde::Packet::Type::M10, packet };
|
||||
shared_memory.application_queue.push(message);
|
||||
|
Reference in New Issue
Block a user