hermespy-rt

Minimalistic signal processing ray-tracer in C
git clone https://git.ea.contact/hermespy-rt
Log | Files | Refs

compute_paths.h (3530B)


      1 #ifndef COMPUTE_PATHS_H
      2 #define COMPUTE_PATHS_H
      3 
      4 #include "scene.h" /* for Scene */
      5 #include "vec3.h" /* for Vec3 */
      6 #include "ray.h" /* for Ray */
      7 #include "common.h" /* for IN, OUT */
      8 
      9 #include <stddef.h> /* for size_t */
     10 #include <stdint.h> /* for uint32_t */
     11 
     12 /** Raytracing channel information returned by compute_paths for each path type (LoS, scatter) */
     13 typedef struct {
     14     uint32_t num_rays; /* number of rays for each rx-tx pair */
     15     Vec3 *directions_rx; /* shape (num_rx, num_tx, num_rays) */
     16     Vec3 *directions_tx; /* shape (num_tx, num_rays) */
     17     float *a_te_re; /* shape (num_rx, num_tx, num_rays) */
     18     float *a_te_im; /* shape (num_rx, num_tx, num_rays) */
     19     float *a_tm_re; /* shape (num_rx, num_tx, num_rays) */
     20     float *a_tm_im; /* shape (num_rx, num_tx, num_rays) */
     21     float *tau; /* shape (num_rx, num_tx, num_rays) */
     22     float *freq_shift; /* Hz, shape (num_rx, num_tx, num_rays) */
     23 } ChannelInfo;
     24 
     25 /** Raytracing rays information returned by compute_paths */
     26 typedef struct {
     27     uint32_t num_bounces, num_rays;
     28     Ray *rays; /* shape (num_tx, num_bounces, num_paths) */
     29     uint8_t *rays_active; /* bitmask, shape (num_tx, num_bounces, num_paths / 8 + 1) */
     30 } RaysInfo;
     31 
     32 /** Compute gains and delays between tx and rx in a 3D scene.
     33  * 
     34  * Scene must be defined in a specific format.
     35  * The format is defined in scene.h.
     36  * The HRT is a binary file cointaining a dereferenced Scene structure.
     37  * See README for details.
     38  * 
     39  * The output PathInfo structure is defined in compute_paths.h
     40  * 
     41  * The output parameters are allocated by the caller (including the fields).
     42  * 
     43  * \param scene pointer to a loaded scene in HRT format (see scene.h)
     44  * \param rx_pos receiver positions, shape (num_rx, 3)
     45  * \param tx_pos transmitter positions, shape (num_tx, 3)
     46  * \param rx_vel receiver velocities, shape (num_rx, 3)
     47  * \param tx_vel transmitter velocities, shape (num_tx, 3)
     48  * \param carrier_frequency carrier frequency in GHz. Must be > 0.0
     49  * \param num_rx number of receivers. Must be > 0
     50  * \param num_tx number of transmitters. Must be > 0
     51  * \param num_paths number of paths to compute. Must be > 0
     52  * \param num_bounces number of bounces to compute. Must be > 0
     53  * 
     54  * \param chanInfo_los output Line-of-Sight channel information. .num_rays = 1
     55  * \param raysInfo_los output Line-of-Sight rays information. .num_bounces = .num_rays = 1
     56  * \param chanInfo_scat output scatter channel information. .num_rays = num_rays
     57  * \param raysInfo_scat output scatter rays information. .num_bounces = num_bounces + 1, .num_rays = num_rays
     58 */
     59 void compute_paths(
     60     IN Scene *scene,                /* Pointer to a loaded scene */
     61     IN Vec3 *rx_pos,                /* shape (num_rx, 3) */
     62     IN Vec3 *tx_pos,                /* shape (num_tx, 3) */
     63     IN Vec3 *rx_vel,                /* shape (num_rx, 3) */
     64     IN Vec3 *tx_vel,                /* shape (num_tx, 3) */
     65     IN float carrier_frequency_GHz, /* > 0.0 (IN GHz!) */
     66     IN size_t num_rx,               /* number of receivers */
     67     IN size_t num_tx,               /* number of transmitters */
     68     IN size_t num_rays,             /* number of rays */
     69     IN size_t num_bounces,          /* number of bounces */
     70     OUT ChannelInfo *chanInfo_los,  /* output LoS channel information */
     71     OUT RaysInfo *raysInfo_los,     /* output LoS rays information */
     72     OUT ChannelInfo *chanInfo_scat, /* output scatter channel information */
     73     OUT RaysInfo *raysInfo_scat     /* output scatter rays information */
     74 );
     75 
     76 #endif /* COMPUTE_PATHS_H */