GNU Radio's MESA Package
SignalDetector_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_SIGNALDETECTOR_IMPL_H
22#define INCLUDED_MESA_SIGNALDETECTOR_IMPL_H
23
24#include "signals_mesa.h"
25#include <chrono>
26#include <ctime>
27#include <mesa/SignalDetector.h>
28
29using namespace MesaSignals;
30
31#define SIGDETECTOR_METHOD_SEPARATESIGNALS 1
32#define SIGDETECTOR_METHOD_BOXOUTSIDEIN 2
33
34namespace gr {
35namespace mesa {
36
38protected:
39 boost::mutex d_mutex;
42
43 gr_complex *pMsgOutBuff;
45
51
54
56
57 std::chrono::time_point<std::chrono::steady_clock> startup, endup;
60
61 // Methods
63 virtual int processData(int noutput_items, const gr_complex *in,
64 gr_complex *out, pmt::pmt_t *pMetadata);
65 void sendState(bool state);
66
67public:
68 SignalDetector_impl(int fftsize, float squelchThreshold, double minWidthHz,
69 double maxWidthHz, double radioCenterFreq,
70 double sampleRate, float holdUpSec, int framesToAvg,
71 bool genSignalPDUs, bool enableDebug,
72 int detectionMethod);
74
75 virtual bool stop();
76
77 void handleMsgIn(pmt::pmt_t msg);
78
79 virtual float getSquelch() const;
80 virtual void setSquelch(float newValue);
81
82 virtual double getCenterFrequency() const;
83 virtual void setCenterFrequency(double newValue);
84
85 virtual double getMinWidthHz() const;
86 virtual void setMinWidthHz(double newValue);
87
88 virtual double getMaxWidthHz() const;
89 virtual void setMaxWidthHz(double newValue);
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
96} // namespace mesa
97} // namespace gr
98
99#endif /* INCLUDED_MESA_SIGNALDETECTOR_IMPL_H */
Definition signals_mesa.h:175
gr_complex * pMsgOutBuff
Definition SignalDetector_impl.h:43
virtual float getSquelch() const
void handleMsgIn(pmt::pmt_t msg)
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
int msgBufferSize
Definition SignalDetector_impl.h:44
double d_maxWidthHz
Definition SignalDetector_impl.h:49
virtual void setMinWidthHz(double newValue)
virtual void setSquelch(float newValue)
EnergyAnalyzer * pEnergyAnalyzer
Definition SignalDetector_impl.h:40
boost::mutex d_mutex
Definition SignalDetector_impl.h:39
int d_fftSize
Definition SignalDetector_impl.h:52
int d_detectionMethod
Definition SignalDetector_impl.h:41
virtual double getMaxWidthHz() const
virtual int processData(int noutput_items, const gr_complex *in, gr_complex *out, pmt::pmt_t *pMetadata)
virtual void setMaxWidthHz(double newValue)
double d_minWidthHz
Definition SignalDetector_impl.h:48
SignalDetector_impl(int fftsize, float squelchThreshold, double minWidthHz, double maxWidthHz, double radioCenterFreq, double sampleRate, float holdUpSec, int framesToAvg, bool genSignalPDUs, bool enableDebug, int detectionMethod)
bool d_startInitialized
Definition SignalDetector_impl.h:58
double d_centerFreq
Definition SignalDetector_impl.h:47
std::chrono::time_point< std::chrono::steady_clock > endup
Definition SignalDetector_impl.h:57
float d_holdUpSec
Definition SignalDetector_impl.h:59
bool d_enableDebug
Definition SignalDetector_impl.h:53
virtual double getMinWidthHz() const
virtual double getCenterFrequency() const
double d_sampleRate
Definition SignalDetector_impl.h:46
virtual void setCenterFrequency(double newValue)
std::chrono::time_point< std::chrono::steady_clock > startup
Definition SignalDetector_impl.h:57
bool d_genSignalPDUs
Definition SignalDetector_impl.h:55
int d_framesToAvg
Definition SignalDetector_impl.h:50
<+description of block+>
Definition SignalDetector.h:35
Definition signals_mesa.h:33
Definition AutoDopplerCorrect.h:27