src/lte/model/lte-spectrum-value-helper.h
author Nicola Baldo <nbaldo@cttc.es>
Mon, 02 May 2011 13:59:17 +0200
changeset 7993 f95867e65663
parent 7981 aacecd825d99
child 8015 e8fd3bf1692f
permissions -rw-r--r--
EARFCN calculation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     2
/*
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     3
 * Copyright (c) 2010 TELEMATICS LAB, DEE - Politecnico di Bari
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     4
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     8
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    12
 * GNU General Public License for more details.
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    13
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    17
 *
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    18
 * Author: Giuseppe Piro  <g.piro@poliba.it>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    19
 */
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    20
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    21
#ifndef LTE_SPECTRUM_VALUE_HELPER_H
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    22
#define LTE_SPECTRUM_VALUE_HELPER_H
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    23
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    24
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    25
#include <ns3/spectrum-value.h>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    26
#include <vector>
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    27
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    28
namespace ns3 {
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    29
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    30
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    31
/**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    32
 * \brief This class defines all functions to create spectrum model for lte
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    33
 */
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    34
class LteSpectrumValueHelper
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    35
{
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    36
public:
7993
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    37
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    38
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    39
  /**  
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    40
   * Calculates the carrier frequency from the E-UTRA Absolute
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    41
   * Radio Frequency Channel Number (EARFCN) according to 3GPP TS
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    42
   * 36.101 section 5.7.3 "Carrier frequency and EARFCN".
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    43
   *
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    44
   * \param earfcn the EARFCN
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    45
   * 
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    46
   * \return the carrier frequency in MHz
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    47
   */
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    48
  static double GetCarrierFrequency (uint16_t earfcn);
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    49
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    50
  /**  
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    51
   * Calculates the dowlink carrier frequency from the E-UTRA Absolute
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    52
   * Radio Frequency Channel Number (EARFCN) using the formula in 3GPP TS
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    53
   * 36.101 section 5.7.3 "Carrier frequency and EARFCN".
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    54
   *
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    55
   * \param earfcn the EARFCN
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    56
   * 
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    57
   * \return the dowlink carrier frequency in MHz
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    58
   */
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    59
  static double GetDownlinkCarrierFrequency (uint16_t earfcn);
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    60
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    61
  /**  
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    62
   * Calculates the uplink carrier frequency from the E-UTRA Absolute
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    63
   * Radio Frequency Channel Number (EARFCN) using the formula in 3GPP TS
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    64
   * 36.101 section 5.7.3 "Carrier frequency and EARFCN".
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    65
   *
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    66
   * \param earfcn the EARFCN
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    67
   * 
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    68
   * \return the uplink carrier frequency in MHz
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    69
   */
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    70
  static double GetUplinkCarrierFrequency (uint16_t earfcn);  
f95867e65663 EARFCN calculation
Nicola Baldo <nbaldo@cttc.es>
parents: 7981
diff changeset
    71
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    72
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    73
   * \brief create spectrum value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    74
   * \param powerTx the power transmission in dBm
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    75
   * \param channels the list of sub channels where the signal will be sent
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    76
   * \return a Ptr to a newly created SpectrumValue instance
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    77
   */
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    78
  static Ptr<SpectrumValue> CreateDownlinkTxPowerSpectralDensity (double powerTx, std::vector <int> channels);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    79
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    80
  /**
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    81
   * \brief create spectrum value
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    82
   * \param powerTx the power transmission in dBm
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    83
   * \param channels the list of sub channels where the signal will be sent
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    84
   * \return a Ptr to a newly created SpectrumValue instance
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    85
   */
7886
b65c16d4da83 LENA project first public release
CTTC
parents: 6852
diff changeset
    86
  static Ptr<SpectrumValue> CreateUplinkTxPowerSpectralDensity (double powerTx, std::vector <int> channels);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    87
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    88
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    89
  /**
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
    90
   * create a SpectrumValue that models the power spectral density of AWGN
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
    91
   * 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
    92
   * \param noiseFigure the noise figure in dB w.r.t. a reference temperature of 290K
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
    93
   * 
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    94
   * \return a Ptr to a newly created SpectrumValue instance
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    95
   */
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
    96
  static Ptr<SpectrumValue> CreateDownlinkNoisePowerSpectralDensity (double noiseFigure);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    97
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
    98
  /**
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
    99
   *  create a SpectrumValue that models the power spectral density of AWGN
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   100
   * 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   101
   * \param noiseFigure the noise figure in dB w.r.t. a reference temperature of 290K
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   102
   * 
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   103
   * \return a Ptr to a newly created SpectrumValue instance
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   104
   */
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   105
  static Ptr<SpectrumValue> CreateUplinkNoisePowerSpectralDensity (double noiseFigure);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   106
7981
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   107
  /** 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   108
   *  create a SpectrumValue that models the power spectral density of AWGN
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   109
   * 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   110
   * \param noiseFigure  the noise figure in dB  w.r.t. a reference temperature of 290K
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   111
   * \param spectrumModel the SpectrumModel instance to be used
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   112
   * 
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   113
   * \return a Ptr to a newly created SpectrumValue instance
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   114
   */
aacecd825d99 noise figure attribute
Nicola Baldo <nbaldo@cttc.es>
parents: 7886
diff changeset
   115
  static Ptr<SpectrumValue> CreateNoisePowerSpectralDensity (double noiseFigure, Ptr<SpectrumModel> spectrumModel);
6705
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   116
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   117
};
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   118
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   119
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   120
} // namespace ns3
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   121
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   122
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   123
422c67049471 LTE module form GSoC project
Giuseppe Piro <g.piro@poliba.it>
parents:
diff changeset
   124
#endif /*  LTE_SPECTRUM_VALUE_HELPER_H */