GNU Radio's MESA Package
AutoDopplerCorrect_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2019 ghostop14.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef INCLUDED_MESA_AUTODOPPLERCORRECT_IMPL_H
22#define INCLUDED_MESA_AUTODOPPLERCORRECT_IMPL_H
23
24#include "signals_mesa.h"
25#include <chrono>
26#include <ctime>
27#include <gnuradio/fxpt_nco.h>
29
30using namespace MesaSignals;
31
32#define AUTODOPPLER_METHOD_CLOSESTSIGNAL 1
33#define AUTODOPPLER_METHOD_BOXOUTSIDEIN 2
34
35namespace gr {
36namespace mesa {
37
39protected:
40 boost::mutex d_mutex;
41
44
45 gr::fxpt_nco d_nco;
46
47 gr_complex *pMsgOutBuff;
49
52 double d_maxDrift;
56
63
65
66 std::chrono::time_point<std::chrono::steady_clock> lastSeen, lastShifted;
67
68 virtual void sendMessageData(gr_complex *data, long datasize,
69 double signalCenterFreq, double signalWidth,
70 float maxPower, pmt::pmt_t *pMetadata);
71 void sendState(bool state);
72
73public:
74 AutoDopplerCorrect_impl(double freq, double sampleRate, double maxDrift,
75 double minWidth, double expectedWidth,
76 int shiftHolddownMS, int fft_size,
77 float squelchThreshold, int framesToAvg,
78 float holdUpSec, bool processMessages,
79 int detectionMethod);
81
82 virtual bool stop();
83
84 // Needed to be public for debug testing
85 virtual int processData(int noutput_items, const gr_complex *in,
86 gr_complex *out, pmt::pmt_t *pMetadata,
87 bool testMode = false);
88
89 void handleMsgIn(pmt::pmt_t msg);
90
91 // Where all the action really happens
92 int work(int noutput_items, gr_vector_const_void_star &input_items,
93 gr_vector_void_star &output_items);
94
95 virtual float getSquelch() const;
96 virtual void setSquelch(float newValue);
97
98 virtual double getCenterFrequency() const;
99 virtual void setCenterFrequency(double newValue);
100
101 virtual double getMinWidthHz() const;
102 virtual void setMinWidthHz(double newValue);
103
104 virtual double getExpectedWidth() const;
105 virtual void setExpectedWidth(double newValue);
106
107 virtual double getMaxDrift() const;
108 virtual void setMaxDrift(double newValue);
109};
110
111} // namespace mesa
112} // namespace gr
113
114#endif /* INCLUDED_MESA_AUTODOPPLERCORRECT_IMPL_H */
Definition signals_mesa.h:175
bool d_processMessages
Definition AutoDopplerCorrect_impl.h:55
double d_maxDrift
Definition AutoDopplerCorrect_impl.h:52
double d_sampleRate
Definition AutoDopplerCorrect_impl.h:50
virtual double getMaxDrift() const
virtual int processData(int noutput_items, const gr_complex *in, gr_complex *out, pmt::pmt_t *pMetadata, bool testMode=false)
int d_fftSize
Definition AutoDopplerCorrect_impl.h:58
gr_complex * pMsgOutBuff
Definition AutoDopplerCorrect_impl.h:47
virtual void setMinWidthHz(double newValue)
int d_shiftHolddownMS
Definition AutoDopplerCorrect_impl.h:54
double d_currentFreqShiftDelta
Definition AutoDopplerCorrect_impl.h:64
virtual void setMaxDrift(double newValue)
EnergyAnalyzer * pEnergyAnalyzer
Definition AutoDopplerCorrect_impl.h:42
virtual double getCenterFrequency() const
double d_minWidthHz
Definition AutoDopplerCorrect_impl.h:59
int d_framesToAvg
Definition AutoDopplerCorrect_impl.h:57
virtual void sendMessageData(gr_complex *data, long datasize, double signalCenterFreq, double signalWidth, float maxPower, pmt::pmt_t *pMetadata)
virtual double getMinWidthHz() const
std::chrono::time_point< std::chrono::steady_clock > lastShifted
Definition AutoDopplerCorrect_impl.h:66
bool d_startInitialized
Definition AutoDopplerCorrect_impl.h:61
double d_centerFreq
Definition AutoDopplerCorrect_impl.h:51
virtual float getSquelch() const
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::fxpt_nco d_nco
Definition AutoDopplerCorrect_impl.h:45
virtual void setSquelch(float newValue)
void handleMsgIn(pmt::pmt_t msg)
double d_maxWidthHz
Definition AutoDopplerCorrect_impl.h:60
int msgBufferSize
Definition AutoDopplerCorrect_impl.h:48
virtual void setCenterFrequency(double newValue)
AutoDopplerCorrect_impl(double freq, double sampleRate, double maxDrift, double minWidth, double expectedWidth, int shiftHolddownMS, int fft_size, float squelchThreshold, int framesToAvg, float holdUpSec, bool processMessages, int detectionMethod)
virtual double getExpectedWidth() const
int d_detectionMethod
Definition AutoDopplerCorrect_impl.h:43
float d_holdUpSec
Definition AutoDopplerCorrect_impl.h:62
double d_expectedWidth
Definition AutoDopplerCorrect_impl.h:53
boost::mutex d_mutex
Definition AutoDopplerCorrect_impl.h:40
virtual void setExpectedWidth(double newValue)
std::chrono::time_point< std::chrono::steady_clock > lastSeen
Definition AutoDopplerCorrect_impl.h:66
<+description of block+>
Definition AutoDopplerCorrect.h:35
Definition signals_mesa.h:33
Definition AutoDopplerCorrect.h:27