GNU Radio Radar Toolbox
static_target_simulator_cc_impl.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 #ifndef INCLUDED_RADAR_STATIC_TARGET_SIMULATOR_CC_IMPL_H
22 #define INCLUDED_RADAR_STATIC_TARGET_SIMULATOR_CC_IMPL_H
23 
25 #include <fftw3.h>
26 
27 namespace gr {
28  namespace radar {
29 
31  {
32  private:
33  // Nothing to declare in this block.
34 
35  protected:
36  int calculate_output_stream_length(const gr_vector_int &ninput_items);
37 
38  public:
39  static_target_simulator_cc_impl(std::vector<float> range, std::vector<float> velocity, std::vector<float> rcs, std::vector<float> azimuth, std::vector<float> position_rx,
40  int samp_rate, float center_freq, float self_coupling_db, bool rndm_phaseshift, bool self_coupling, const std::string& len_key);
42  void setup_targets(std::vector<float> range, std::vector<float> velocity, std::vector<float> rcs, std::vector<float> azimuth, std::vector<float> position_rx,
43  int samp_rate, float center_freq, float self_coupling_db, bool rndm_phaseshift, bool self_coupling);
44 
50 
53 
55  std::vector<float> d_freq;
56  std::vector<float> d_doppler, d_scale_ampl, d_timeshift;
57  std::vector<std::vector<float> > d_timeshift_azimuth;
59  std::vector<gr_complex> d_hold_in;
60 
61  fftwf_plan d_fft_plan, d_ifft_plan;
62  std::vector<gr_complex> d_in_fft;
63  std::vector<std::vector<gr_complex> > d_filt_doppler, d_filt_phase, d_filt_self_coupling;
64  std::vector<std::vector<gr_complex> > d_filt_time;
65  std::vector<std::vector<std::vector<gr_complex> > > d_filt_time_azimuth;
66 
67  pmt::pmt_t d_key, d_val, d_srcid;
68  uint64_t d_time_sec;
70 
71  constexpr static float c_light = 3e8;
72 
73  // Where all the action really happens
74  int work(int noutput_items,
75  gr_vector_int &ninput_items,
76  gr_vector_const_void_star &input_items,
77  gr_vector_void_star &output_items);
78  };
79 
80  } // namespace radar
81 } // namespace gr
82 
83 #endif /* INCLUDED_RADAR_STATIC_TARGET_SIMULATOR_CC_IMPL_H */
84 
std::vector< float > d_timeshift
Definition: static_target_simulator_cc_impl.h:56
void setup_targets(std::vector< float > range, std::vector< float > velocity, std::vector< float > rcs, std::vector< float > azimuth, std::vector< float > position_rx, int samp_rate, float center_freq, float self_coupling_db, bool rndm_phaseshift, bool self_coupling)
gr_complex d_phase_doppler
Definition: static_target_simulator_cc_impl.h:58
std::vector< float > d_position_rx
Definition: static_target_simulator_cc_impl.h:45
std::vector< float > d_scale_ampl
Definition: static_target_simulator_cc_impl.h:56
float d_self_coupling_db
Definition: static_target_simulator_cc_impl.h:52
std::vector< float > d_rcs
Definition: static_target_simulator_cc_impl.h:45
pmt::pmt_t d_srcid
Definition: static_target_simulator_cc_impl.h:67
int calculate_output_stream_length(const gr_vector_int &ninput_items)
std::vector< std::vector< float > > d_timeshift_azimuth
Definition: static_target_simulator_cc_impl.h:57
This block simulates the backscattering of a given signal on point targets. TX signal is given on the...
Definition: static_target_simulator_cc.h:49
pmt::pmt_t d_val
Definition: static_target_simulator_cc_impl.h:67
pmt::pmt_t d_key
Definition: static_target_simulator_cc_impl.h:67
int work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
float d_center_freq
Definition: static_target_simulator_cc_impl.h:47
gr_complex d_phase_random
Definition: static_target_simulator_cc_impl.h:58
std::vector< std::vector< std::vector< gr_complex > > > d_filt_time_azimuth
Definition: static_target_simulator_cc_impl.h:65
std::vector< gr_complex > d_in_fft
Definition: static_target_simulator_cc_impl.h:62
Definition: static_target_simulator_cc_impl.h:30
std::vector< std::vector< gr_complex > > d_filt_self_coupling
Definition: static_target_simulator_cc_impl.h:63
Definition: crop_matrix_vcvc.h:28
gr_complex d_phase_time
Definition: static_target_simulator_cc_impl.h:58
uint64_t d_time_sec
Definition: static_target_simulator_cc_impl.h:68
std::vector< float > d_azimuth
Definition: static_target_simulator_cc_impl.h:45
bool d_self_coupling
Definition: static_target_simulator_cc_impl.h:51
std::vector< std::vector< gr_complex > > d_filt_doppler
Definition: static_target_simulator_cc_impl.h:63
std::vector< std::vector< gr_complex > > d_filt_time
Definition: static_target_simulator_cc_impl.h:64
std::vector< float > d_range
Definition: static_target_simulator_cc_impl.h:45
int d_hold_noutput
Definition: static_target_simulator_cc_impl.h:48
int d_samp_rate
Definition: static_target_simulator_cc_impl.h:46
int d_num_targets
Definition: static_target_simulator_cc_impl.h:54
double d_time_frac_sec
Definition: static_target_simulator_cc_impl.h:69
static constexpr float c_light
Definition: static_target_simulator_cc_impl.h:71
std::vector< gr_complex > d_hold_in
Definition: static_target_simulator_cc_impl.h:59
static_target_simulator_cc_impl(std::vector< float > range, std::vector< float > velocity, std::vector< float > rcs, std::vector< float > azimuth, std::vector< float > position_rx, int samp_rate, float center_freq, float self_coupling_db, bool rndm_phaseshift, bool self_coupling, const std::string &len_key)
std::vector< float > d_freq
Definition: static_target_simulator_cc_impl.h:55
fftwf_plan d_ifft_plan
Definition: static_target_simulator_cc_impl.h:61
fftwf_plan d_fft_plan
Definition: static_target_simulator_cc_impl.h:61
std::vector< std::vector< gr_complex > > d_filt_phase
Definition: static_target_simulator_cc_impl.h:63
bool d_rndm_phaseshift
Definition: static_target_simulator_cc_impl.h:49
std::vector< float > d_velocity
Definition: static_target_simulator_cc_impl.h:45
std::vector< float > d_doppler
Definition: static_target_simulator_cc_impl.h:56