GNU Radio Radar Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Macros
find_max_peak_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 Communications Engineering Lab, KIT.
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 
22 #ifndef INCLUDED_RADAR_FIND_MAX_PEAK_C_H
23 #define INCLUDED_RADAR_FIND_MAX_PEAK_C_H
24 
25 #include <radar/api.h>
26 #include <gnuradio/tagged_stream_block.h>
27 
28 namespace gr {
29  namespace radar {
30 
31  /*!
32  * \brief This block estimates a single peak of a given FFT spectrum as tagged stream. Output is a message with the information of frequency, phase and power of the peak as a f32vector with a single item. All data is tagged with the identifiers (symbols) 'frequency', 'phase' and 'power'. The peak is estimated on the whole spectrum or on the range max_freq if cut_max_freq is true. Furthermore a threshold of the spectrum amplitude can be given with threshold. The DC peak can be cut out with the protected samples samp_protect. This value do not evaluate samp_protect samples around the DC peak. If no suitable peak is found the block returns empty vectors with the identifiers.
33  *
34  * \param samp_rate Sample rate
35  * \param threshold Threshold for detection of the spectrum amplitude
36  * \param samp_protect Protected samples for cutting DC peak
37  * \param max_freq Frequency range for cutting spectrum
38  * \param cut_max_freq Toggle cutting the spectrum for peak estimation
39  * \param len_key Packet length key for tagged stream
40  *
41  * \ingroup radar
42  *
43  */
44  class RADAR_API find_max_peak_c : virtual public gr::tagged_stream_block
45  {
46  public:
47  typedef boost::shared_ptr<find_max_peak_c> sptr;
48 
49  /*!
50  * \brief Return a shared_ptr to a new instance of radar::find_max_peak_c.
51  *
52  * To avoid accidental use of raw pointers, radar::find_max_peak_c's
53  * constructor is in a private implementation
54  * class. radar::find_max_peak_c::make is the public interface for
55  * creating new instances.
56  */
57  static sptr make(int samp_rate, float threshold, int samp_protect, std::vector<float> max_freq, bool cut_max_freq, const std::string& len_key="packet_len");
58  virtual void set_threshold(float threshold) = 0;
59  virtual void set_samp_protect(int samp) = 0;
60  virtual void set_max_freq(std::vector<float> freq) = 0;
61  };
62 
63  } // namespace radar
64 } // namespace gr
65 
66 #endif /* INCLUDED_RADAR_FIND_MAX_PEAK_C_H */
67 
boost::shared_ptr< find_max_peak_c > sptr
Definition: find_max_peak_c.h:47
This block estimates a single peak of a given FFT spectrum as tagged stream. Output is a message with...
Definition: find_max_peak_c.h:44
#define RADAR_API
Definition: api.h:30