Start the FSK frame acquisition block of the UPSAT.
After managing to successfully receive raw bytes from the TI devboard with the CC1120, its now time to pack them into a frame by searching for the preamble and synchronizing with the known byte sync word.
This commit is contained in:
parent
0ada5f618d
commit
6ae7614af2
|
@ -31,5 +31,6 @@ install(FILES
|
|||
satnogs_json_to_ecss_src.xml
|
||||
satnogs_tcp_rigctl_msg_source.xml
|
||||
satnogs_frame_encoder.xml
|
||||
satnogs_doppler_correction_cc.xml DESTINATION share/gnuradio/grc/blocks
|
||||
satnogs_doppler_correction_cc.xml
|
||||
satnogs_upsat_fsk_frame_acquisition.xml DESTINATION share/gnuradio/grc/blocks
|
||||
)
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0"?>
|
||||
<block>
|
||||
<name>upsat_fsk_frame_acquisition</name>
|
||||
<key>satnogs_upsat_fsk_frame_acquisition</key>
|
||||
<category>satnogs</category>
|
||||
<import>import satnogs</import>
|
||||
<make>satnogs.upsat_fsk_frame_acquisition($&preamble, $&sync_word, $whitening, $manchester)</make>
|
||||
<!-- Make one 'param' node for every Parameter you want settable from the GUI.
|
||||
Sub-nodes:
|
||||
* name
|
||||
* key (makes the value accessible as $keyname, e.g. in the make node)
|
||||
* type -->
|
||||
<param>
|
||||
<name>...</name>
|
||||
<key>...</key>
|
||||
<type>...</type>
|
||||
</param>
|
||||
|
||||
<!-- Make one 'sink' node per input. Sub-nodes:
|
||||
* name (an identifier for the GUI)
|
||||
* type
|
||||
* vlen
|
||||
* optional (set to 1 for optional inputs) -->
|
||||
<sink>
|
||||
<name>in</name>
|
||||
<type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
|
||||
</sink>
|
||||
|
||||
<!-- Make one 'source' node per output. Sub-nodes:
|
||||
* name (an identifier for the GUI)
|
||||
* type
|
||||
* vlen
|
||||
* optional (set to 1 for optional inputs) -->
|
||||
<source>
|
||||
<name>out</name>
|
||||
<type><!-- e.g. int, float, complex, byte, short, xxx_vector, ...--></type>
|
||||
</source>
|
||||
</block>
|
|
@ -44,5 +44,6 @@ install(FILES
|
|||
frame_encoder.h
|
||||
doppler_correction_cc.h
|
||||
doppler_fit.h
|
||||
freq_drift.h DESTINATION include/satnogs
|
||||
freq_drift.h
|
||||
upsat_fsk_frame_acquisition.h DESTINATION include/satnogs
|
||||
)
|
||||
|
|
|
@ -0,0 +1,66 @@
|
|||
/* -*- c++ -*- */
|
||||
/*
|
||||
* gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
|
||||
*
|
||||
* Copyright (C) 2016, Libre Space Foundation <http://librespacefoundation.org/>
|
||||
*
|
||||
* 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ACQUISITION_H
|
||||
#define INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ACQUISITION_H
|
||||
|
||||
#include <satnogs/api.h>
|
||||
#include <gnuradio/sync_block.h>
|
||||
|
||||
namespace gr
|
||||
{
|
||||
namespace satnogs
|
||||
{
|
||||
|
||||
/*!
|
||||
* \brief This block takes samples after the Clock Recovery block
|
||||
* and tries to extract frames. This is performed by searching for a
|
||||
* known preamble. For the byte synchronization the block tries to
|
||||
* search for the specified synchronization word that should be present
|
||||
* before the start of the payload.
|
||||
*
|
||||
* \ingroup satnogs
|
||||
*
|
||||
*/
|
||||
class SATNOGS_API upsat_fsk_frame_acquisition : virtual public gr::sync_block
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<upsat_fsk_frame_acquisition> sptr;
|
||||
|
||||
/*!
|
||||
* Creates the FSK frame acquisition block for the UPSAT satellite.
|
||||
* @param preamble the bytes that consist the preamble of the frame
|
||||
* @param sync_word the byte synchronization word
|
||||
* @param whitening true if the transmitted data have been processed by
|
||||
* the whitening algorithm of the CC1120 chip. False otherwise.
|
||||
* @param manchester true if the transmitted data have been processed by
|
||||
* the Manchester algorithm of the CC1120 chip. False otherwise.
|
||||
*/
|
||||
static sptr
|
||||
make (const std::vector<uint8_t> &preamble,
|
||||
const std::vector<uint8_t> &sync_word, bool whitening = false,
|
||||
bool manchester = false);
|
||||
};
|
||||
|
||||
} // namespace satnogs
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ACQUISITION_H */
|
||||
|
|
@ -42,7 +42,8 @@ list(APPEND satnogs_sources
|
|||
doppler_correction_cc_impl.cc
|
||||
frame_encoder_impl.cc
|
||||
doppler_fit.cc
|
||||
freq_drift.cc )
|
||||
freq_drift.cc
|
||||
upsat_fsk_frame_acquisition_impl.cc )
|
||||
|
||||
set(satnogs_sources "${satnogs_sources}" PARENT_SCOPE)
|
||||
if(NOT satnogs_sources)
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
/* -*- c++ -*- */
|
||||
/*
|
||||
* gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
|
||||
*
|
||||
* Copyright (C) 2016, Libre Space Foundation <http://librespacefoundation.org/>
|
||||
*
|
||||
* 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include "upsat_fsk_frame_acquisition_impl.h"
|
||||
|
||||
namespace gr
|
||||
{
|
||||
namespace satnogs
|
||||
{
|
||||
|
||||
upsat_fsk_frame_acquisition::sptr
|
||||
upsat_fsk_frame_acquisition::make (const std::vector<uint8_t> &preamble,
|
||||
const std::vector<uint8_t> &sync_word,
|
||||
bool whitening, bool manchester)
|
||||
{
|
||||
return gnuradio::get_initial_sptr (
|
||||
new upsat_fsk_frame_acquisition_impl (preamble, sync_word, whitening,
|
||||
manchester));
|
||||
}
|
||||
|
||||
/*
|
||||
* The private constructor
|
||||
*/
|
||||
upsat_fsk_frame_acquisition_impl::upsat_fsk_frame_acquisition_impl (
|
||||
const std::vector<uint8_t> &preamble,
|
||||
const std::vector<uint8_t> &sync_word, bool whitening, bool manchester) :
|
||||
gr::sync_block ("upsat_fsk_frame_acquisition",
|
||||
gr::io_signature::make (1, 1, sizeof(float)),
|
||||
gr::io_signature::make (0, 0, 0))
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Our virtual destructor.
|
||||
*/
|
||||
upsat_fsk_frame_acquisition_impl::~upsat_fsk_frame_acquisition_impl ()
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
upsat_fsk_frame_acquisition_impl::work (
|
||||
int noutput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items)
|
||||
{
|
||||
const float *in = (const float *) input_items[0];
|
||||
|
||||
// Do <+signal processing+>
|
||||
|
||||
// Tell runtime system how many output items we produced.
|
||||
return noutput_items;
|
||||
}
|
||||
|
||||
} /* namespace satnogs */
|
||||
} /* namespace gr */
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
/* -*- c++ -*- */
|
||||
/*
|
||||
* gr-satnogs: SatNOGS GNU Radio Out-Of-Tree Module
|
||||
*
|
||||
* Copyright (C) 2016, Libre Space Foundation <http://librespacefoundation.org/>
|
||||
*
|
||||
* 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ACQUISITION_IMPL_H
|
||||
#define INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ACQUISITION_IMPL_H
|
||||
|
||||
#include <satnogs/upsat_fsk_frame_acquisition.h>
|
||||
|
||||
namespace gr
|
||||
{
|
||||
namespace satnogs
|
||||
{
|
||||
|
||||
class upsat_fsk_frame_acquisition_impl : public upsat_fsk_frame_acquisition
|
||||
{
|
||||
private:
|
||||
// Nothing to declare in this block.
|
||||
|
||||
public:
|
||||
upsat_fsk_frame_acquisition_impl (const std::vector<uint8_t> &preamble,
|
||||
const std::vector<uint8_t> &sync_word,
|
||||
bool whitening, bool manchester);
|
||||
~upsat_fsk_frame_acquisition_impl ();
|
||||
|
||||
// Where all the action really happens
|
||||
int
|
||||
work (int noutput_items, gr_vector_const_void_star &input_items,
|
||||
gr_vector_void_star &output_items);
|
||||
};
|
||||
|
||||
} // namespace satnogs
|
||||
} // namespace gr
|
||||
|
||||
#endif /* INCLUDED_SATNOGS_UPSAT_FSK_FRAME_ACQUISITION_IMPL_H */
|
||||
|
|
@ -25,6 +25,7 @@
|
|||
#include "satnogs/json_to_ecss_src.h"
|
||||
#include "satnogs/doppler_correction_cc.h"
|
||||
#include "satnogs/frame_encoder.h"
|
||||
#include "satnogs/upsat_fsk_frame_acquisition.h"
|
||||
%}
|
||||
|
||||
|
||||
|
@ -59,3 +60,5 @@ GR_SWIG_BLOCK_MAGIC2(satnogs, json_to_ecss_src);
|
|||
GR_SWIG_BLOCK_MAGIC2(satnogs, frame_encoder);
|
||||
%include "satnogs/doppler_correction_cc.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(satnogs, doppler_correction_cc);
|
||||
%include "satnogs/upsat_fsk_frame_acquisition.h"
|
||||
GR_SWIG_BLOCK_MAGIC2(satnogs, upsat_fsk_frame_acquisition);
|
||||
|
|
Loading…
Reference in New Issue