Files
GnuRadio/gr-jay/lib/garage_impl.h
T
2019-01-07 14:54:49 +00:00

84 lines
2.1 KiB
C++

/* -*- c++ -*- */
/*
* Copyright 2018 Jay Arrowfield.
*
* This 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, or (at your option)
* any later version.
*
* This software 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_JAY_GARAGE_IMPL_H
#define INCLUDED_JAY_GARAGE_IMPL_H
#include <jay/garage.h>
namespace gr
{
namespace jay
{
class garage_impl : public garage
{
private:
int m_sampleRate;
int m_samplesPerSym;
int m_count;
float m_baudRate;
float m_kLoopFilter;
float m_kThreshold;
float m_vmin;
float m_vmax;
float m_v_sig;
float m_dc_corr;
float m_lag_accu;
float m_id_accu;
int m_id_bit;
int m_bitZeroCross;
float m_i;
int m_gapDistance;
int m_gapCounter;
int m_gapCounterEnable;
int m_packetCounter;
int m_bitCounter;
uint64_t m_sampleCounter;
int m_bits[4096];
FILE *m_pFile_y;
FILE *m_pFile_bits;
void bitProcessGap(int bitChg);
void bitRecord(int bit);
void bitsPrint();
bool start() override;
bool stop() override;
public:
garage_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold);
~garage_impl();
// Where all the action really happens
void forecast (int noutput_items, gr_vector_int &ninput_items_required);
int general_work(int noutput_items,
gr_vector_int &ninput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items);
};
} // namespace jay
} // namespace gr
#endif /* INCLUDED_JAY_GARAGE_IMPL_H */