⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ieee802154a.h

📁 一个UWB仿真程序包
💻 H
字号:
#include <string.h>#include <math.h>#include <gsl/gsl_randist.h>#include <gsl/gsl_rng.h>#include <gsl/gsl_sort.h>#include <gsl/gsl_sf_trig.h>#include <gsl/gsl_complex_math.h>#include <gsl/gsl_complex.h>#include "ieee802154a_parameters.h"/** * \brief Channel Cluster Model */typedef struct {  /* Channel parameters */  int L; /**< Number of cluster */  int* K_l; /**< Number of components for lth cluster */  double* alpha_kl; /**< Amplitude of the path k,l */  double* phi_kl; /**< Phase of the path k,l */  double* T_l; /**< Arrival time of the lth cluster */  double* tau_kl; /**< Arrival time of path k,l */  /* Used to compute the channel parameters */  double* gamma_l; /**< cluster decay time */  double* Omega_l; /**< cluster power */  double* Ealpha2_kl; /**< mean power of the path k,l */  double* m_kl; /**< Nakagami m-factor of the path k,l */  double thld_db; /**< */} ieee802154a_channel_cluster;/** * \brief Channel Continuous Model */typedef struct {  /* Channel parameters */  int length; /**< Number of paths in the cont. channel */  double* tau; /**< Sorted arrival times */  double* alpha; /**< Sorted amplitudes */  double* phi; /**< Sorted phases */} ieee802154a_channel_cont;/** * \brief Discrete Time Channel */typedef struct {  /* Channel parameters */  int length; /**< Number of samples */  double fs; /**< Sampling frequency */  double* tau; /**< time axis */  double* alpha; /**< amplitudes */  double* phi; /**< phases */  gsl_complex* complex_h; /**< complex channel coefficient */  double* real_h; /**< real part of channel coefficient */} ieee802154a_channel_discr;/** * \brief Allocate the memory for the pointers in the * ieee802154a_channel_cluster struct that depend on the number of cluster L * */voidmalloc_channel_cluster_L(ieee802154a_channel_cluster *channel);/** * \brief Allocate the memory for the pointers in the * ieee802154a_channel_cluster struct that depend on the total length of the * channel i.e. L*K_l * */voidmalloc_channel_cluster_K_l(ieee802154a_channel_cluster *channel,			   int alloc_chunk_size);voidrealloc_channel_cluster_K_l(ieee802154a_channel_cluster *channel,			    int alloc_chunk_size);voidmalloc_channel_cont_K_l(ieee802154a_channel_cont *channel_cont,			int alloc_chunk_size);/** * \brief Allocate the memory for the pointers in the * ieee802154a_channel_discr struct that depend on the number of bins * */voidmalloc_channel_discr(ieee802154a_channel_discr* channel, int L);/** * \brief Free memory taken by cluster channel */voidfree_channel_cluster(ieee802154a_channel_cluster* channel);/** * \brief Free memory taken by cont channel */voidfree_channel_cont(ieee802154a_channel_cont* channel);/** * \brief Free memory taken by discrete channel */voidfree_channel_discr(ieee802154a_channel_discr* channel);/** * \brief Get L, the number of clusters */voidget_L(ieee802154a_channel_cluster* channel, int barL, const gsl_rng * r);/** * \brief Get the cluster arrival time */voidget_T_l(ieee802154a_channel_cluster* channel, ieee802154a_parameters* param,	const gsl_rng * r);voidget_phi_kl(ieee802154a_channel_cluster* channel,const gsl_rng * r);voidget_alpha_kl(ieee802154a_channel_cluster* channel,	     ieee802154a_parameters* param, const gsl_rng * r);doubleget_mean_power(ieee802154a_channel_cluster* channel,	       ieee802154a_parameters* param, int l, int i);/** * \brief Get the path delay */voidget_tau_kl(ieee802154a_channel_cluster* channel, ieee802154a_channel_cont*,	   ieee802154a_parameters* param, const gsl_rng * r);/** * \brief Convert continuous time channel to discrete time */voidconvert_discrete(ieee802154a_channel_cont* channel_cont,		 ieee802154a_channel_discr* channel_discr, double fs);voidsort_channel(ieee802154a_channel_cluster* channel,	     ieee802154a_channel_cont* channel_cont);voidprint_channel(ieee802154a_channel_cont* channel_cont,	      ieee802154a_channel_discr* channel_discr, char* file);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -