NetSim Source Code Help
Loading...
Searching...
No Matches
ErrorModel.h
Go to the documentation of this file.
1/************************************************************************************
2* Copyright (C) 2020
3* TETCOS, Bangalore. India *
4
5* Tetcos owns the intellectual property rights in the Product and its content. *
6* The copying, redistribution, reselling or publication of any or all of the *
7* Product or its content without express prior written consent of Tetcos is *
8* prohibited. Ownership and / or any other right relating to the software and all *
9* intellectual property rights therein shall remain at all times with Tetcos. *
10* Author: Shashi Kant Suman *
11* ---------------------------------------------------------------------------------*/
12#ifndef _NETSIM_ERROR_MODEL_H_
13#define _NETSIM_ERROR_MODEL_H_
14
15#include "Wireless.h"
16
17typedef struct stru_ber
18{
19 double dSNR;
20 double dBER;
22
23_declspec(dllexport) double calculate_ber(double snr,BER ber_table[],size_t table_len);
24_declspec(dllexport) double calculate_sinr(double dReceivedPower_dbm, double interferencePower_dBm, double bandwidth_mHz);
25_declspec(dllexport) double calculate_BER(PHY_MODULATION modulation,
26 double dReceivedPower_dBm,
27 double dInterferencePower_dBm,
28 double dBandwidth_MHz);
29
30_declspec(dllexport) double propagation_calculateRXSensitivity(double PEP,
31 double refPacketSize /* In bytes*/,
32 PHY_MODULATION modulation,
33 double bandwidth);
34_declspec(dllexport) double add_power_in_dbm(double p1_dbm, double p2_dbm);
35_declspec(dllexport) double substract_power_in_dbm(double p1_dbm, double p2_dbm);
36_declspec(dllexport) double find_power_from_snr(double snr,
37 double bandwidth);
38_declspec(dllexport) double find_snr_from_ber(double ber,
39 PHY_MODULATION modulation);
40
41//New BER
42_declspec(dllexport) double Calculate_ber_by_calculation(double sinr, PHY_MODULATION modulation,
43 double dataRate_mbps, double bandwidth_mHz);
44_declspec(dllexport) double calculate_rxpower_by_ber(double refBer, PHY_MODULATION modulation,
45 double datarate_mbps, double bandwidth_mhz);
46_declspec(dllexport) double calculate_rxpower_by_per(double per, double refPacketSize,
47 PHY_MODULATION modulation,
48 double datarate_mbps, double bandwidth_mhz);
49
50/**
51 Used to read BER file.
52 File format
53 <SNR1>,<BER1>,
54 <SNR2>,<BER2>,
55 ....
56 ....
57 ....
58 <SNRn>,<BERn>,
59 Input
60 BER file name with relative path to IO path
61 pointer to BER table length
62 Return
63 BER table of size len
64 Note: SNR value in file must be in increasing order.
65 This API doesn't check this, so if it is not will
66 result wrong behaviour.
67*/
68_declspec(dllexport) ptrBER read_ber_file(char* file, size_t* len);
69
70//FEC BER
71_declspec(dllexport) double calculate_FEC_BER(PHY_MODULATION modulation,
72 double codingRate /* 1/2, 2/3, 3/4, 5/6 */,
73 double dReceivedPower_dBm,
74 double interferencePower_dBm,
75 double dBandwidth_MHz,
76 double dataRate_mbps);
77
78#endif //_NETSIM_ERROR_MODEL_H_
ptrBER read_ber_file(char *file, size_t *len)
double calculate_rxpower_by_per(double per, double refPacketSize, PHY_MODULATION modulation, double datarate_mbps, double bandwidth_mhz)
double propagation_calculateRXSensitivity(double PEP, double refPacketSize, PHY_MODULATION modulation, double bandwidth)
double calculate_BER(PHY_MODULATION modulation, double dReceivedPower_dBm, double dInterferencePower_dBm, double dBandwidth_MHz)
struct stru_ber * ptrBER
struct stru_ber BER
double calculate_FEC_BER(PHY_MODULATION modulation, double codingRate, double dReceivedPower_dBm, double interferencePower_dBm, double dBandwidth_MHz, double dataRate_mbps)
double add_power_in_dbm(double p1_dbm, double p2_dbm)
double Calculate_ber_by_calculation(double sinr, PHY_MODULATION modulation, double dataRate_mbps, double bandwidth_mHz)
double find_snr_from_ber(double ber, PHY_MODULATION modulation)
double calculate_rxpower_by_ber(double refBer, PHY_MODULATION modulation, double datarate_mbps, double bandwidth_mhz)
double substract_power_in_dbm(double p1_dbm, double p2_dbm)
double calculate_sinr(double dReceivedPower_dbm, double interferencePower_dBm, double bandwidth_mHz)
double calculate_ber(double snr, BER ber_table[], size_t table_len)
double find_power_from_snr(double snr, double bandwidth)
#define _declspec(dllexport)
This function is used to trigger the update.
Definition: Linux.h:41
enum enum_Modulation PHY_MODULATION
double dSNR
Definition: ErrorModel.h:19
double dBER
Definition: ErrorModel.h:20