libcdx: Interfaces to the Channel Data Exchange (CDX) File Format
C++, Python, and Matlab library to exchange data for radio propagation channels
File.h
Go to the documentation of this file.
1 
13 #ifndef CDX_FILE_H_
14 #define CDX_FILE_H_
15 
16 #include <string>
17 #include <vector>
18 #include <complex>
19 #include <map>
20 
21 #include "H5Cpp.h"
22 
26 namespace CDX {
27 
35 typedef std::map<uint16_t, std::string> component_types_t;
36 
37 typedef std::map<std::string, component_types_t> links_to_component_types_t;
38 
39 
43 struct impulse_t {
44  uint16_t type;
45  uint64_t id;
46  double delay;
47  std::complex<double> amplitude;
48 };
49 
53 typedef std::vector<impulse_t> components_t;
54 
56  uint16_t type;
57  uint64_t id;
58  double delay;
59  double real;
60  double imag;
61 };
62 
66 struct cir_t {
67  double ref_delay;
68  components_t components;
69 };
70 
95 class File {
96 public:
102  File(std::string _file_name);
103 
113  File(std::string _file_name, double _c0_m_s, double _cir_rate_Hz,
114  double _transmitter_frequency_Hz,
115  const std::vector<std::string> &_link_names);
116 
120  virtual ~File();
121 
129  static double read_double_h5(H5::H5File file, std::string dataset_name);
130 
138  static std::string read_string_h5(H5::H5File file, std::string path);
139 
145  H5::H5File get_file_handle() const {
146  return h5file;
147  }
148 
154  size_t get_nof_links() const {
155  return nof_links;
156  }
157 
163  double get_cir_rate_Hz() const {
164  return cir_rate_Hz;
165  }
166 
172  double get_c0_m_s() const {
173  return c0_m_s;
174  }
175 
182  return transmitter_frequency_Hz;
183  }
184 
190  std::vector<std::string> get_link_names() const {
191  return link_names;
192  }
193 
194 protected:
195  const std::string file_name;
196  H5::H5File h5file;
197 
198  double c0_m_s;
199  double cir_rate_Hz;
201  std::string delay_type;
202 
203  std::vector<std::string> link_names;
204  H5::Group links_group;
205  const size_t nof_links;
206  std::map<std::string, H5::Group *> link_groups;
207 };
208 
209 } // end of namespace CDX
210 
211 #endif /* CDX_FILE_H_ */
212 
double get_transmitter_frequency_Hz() const
Returns the transmitter frequency in Hz.
Definition: File.h:181
std::vector< std::string > link_names
vector of the link names
Definition: File.h:203
double get_c0_m_s() const
Returns the speed of light in m/s as defined in the CDX file.
Definition: File.h:172
uint64_t id
unique identifier for each component
Definition: File.h:45
size_t get_nof_links() const
Returns number of links.
Definition: File.h:154
double get_cir_rate_Hz() const
Return the CIR rate of the file.
Definition: File.h:163
std::string delay_type
the delay type, either "continuous-delay" or "discrete-delay"
Definition: File.h:201
double transmitter_frequency_Hz
the transmitter frequency in Hz
Definition: File.h:200
Base class for the processing of Channel Data Exchange (CDX) files.
Definition: File.h:95
std::vector< impulse_t > components_t
Defines a vector of CDX_Impulses representing one channel impulse response (CIR). ...
Definition: File.h:53
double c0_m_s
the speed of light in m/s
Definition: File.h:198
uint16_t type
the multipath component&#39;s type as defined in component_types_t
Definition: File.h:44
Struct used as return value for function ReadContinuousDelayCDXFile::get_cir.
Definition: File.h:66
H5::H5File h5file
the handle to the HDF5 file
Definition: File.h:196
std::map< uint16_t, std::string > component_types_t
Assigns integer values to component type names.
Definition: File.h:35
H5::Group links_group
handle to the group in the HDF5 file that stores the links
Definition: File.h:204
Holds a single multipath component as input value for WriteContinuousDelayCDXFile::write_cir.
Definition: File.h:43
double delay
the multipath component&#39;s delay in s
Definition: File.h:46
Definition: File.h:55
double ref_delay
the reference delay in s, i.e. the time the signal travels from the transmitter to the receiver on a ...
Definition: File.h:67
double cir_rate_Hz
the CIR update rate in Hz
Definition: File.h:199
std::vector< std::string > get_link_names() const
Returns the link names.
Definition: File.h:190
std::map< std::string, H5::Group * > link_groups
vector of pointers to HDF5 groups which contain data for each link in file
Definition: File.h:206
Contains all CDX classes and types.
Definition: File.cpp:19
H5::H5File get_file_handle() const
Returns the file handle to the HDF5 file.
Definition: File.h:145
const std::string file_name
the CDX file&#39;s name
Definition: File.h:195
components_t components
the multipath components
Definition: File.h:68
const size_t nof_links
the number of the links
Definition: File.h:205
std::complex< double > amplitude
the multipath component&#39;s complex amplitude
Definition: File.h:47