From 6defe0420ca134e2b2bd02ad28c6aa4c38c76133 Mon Sep 17 00:00:00 2001 From: buret Date: Mon, 18 Feb 2008 17:59:01 +0000 Subject: Maximus: Develop the noise calculation. git-svn-id: svn+ssh://pessac/svn/cesar/trunk@1426 017c9cb6-072f-447c-8318-d5b54f68fe89 --- maximus/channel/inc/ChannelSettings.h | 76 ++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) (limited to 'maximus/channel/inc/ChannelSettings.h') diff --git a/maximus/channel/inc/ChannelSettings.h b/maximus/channel/inc/ChannelSettings.h index 816e445338..540265a618 100644 --- a/maximus/channel/inc/ChannelSettings.h +++ b/maximus/channel/inc/ChannelSettings.h @@ -32,6 +32,10 @@ The original location of this file is /home/buret/eclipse/maximus/channel/inc/Ch #define CHANNELSETTINGS_H #include "networkclock_types.h" // for 'Network_Clock_Tick' +#include "channel_types.h" // for 'Channel_Mod' + +#include "mac/common/defs.h" // for 'TONEMAP_INTERVAL_NB' +#include "hal/phy/defs.h" // for 'PHY_CARRIER_NB' /** @@ -51,14 +55,17 @@ private: // private attributes // + bool mIsConfigured; + float mSnrArray[TONEMAP_INTERVAL_NB][PHY_CARRIER_NB + 1]; + Channel_Mod mTonemapArray[PHY_CARRIER_NB]; Network_Clock_Tick mPreDetectionDate; Network_Clock_Tick mFcReceptionDate; protected: - + // protected attributes // - + public: // Constructors/Destructors @@ -77,12 +84,62 @@ public: // public methods // + /** + * Gets the first symbol start date (in ticks). + * @return tick at which the first symbol has started + */ + const Network_Clock_Tick getFirstSymbolStartDate ( ) const; + + /** + * Gets the tonemap modulation. + * @param carrier the current carrier number + * @return the tonemap modulation + */ + const Channel_Mod getModulation ( const unsigned int carrier ) const; + + /** + * Gets the SNR in dB. + * @param interval the current interval number + * @param carrier the current carrier number + * @return the SNR in dB + */ + const float getSnr ( const Network_Clock_Tick beacon_period, + const Network_Clock_Tick symbol_start_date, + const unsigned int carrier ) const; + // public attribute accessor methods // // private attribute accessor methods // + /** + * Gets if the channel has been configured. + * @return mIsConfigured + */ + const bool isConfigured ( ) const; + + /** + * Sets the SNR. + * @param snr_value SNR value in dB + * @return bool + */ + bool setSnr ( const float snr_value ); + + /** + * Sets the SNR. + * @param snr array of SNR values in dB + * @return bool + */ + bool setSnr ( const float snr_values[TONEMAP_INTERVAL_NB][PHY_CARRIER_NB + 1] ); + + /** + * Sets the tonemap of the current transmission. + * @return bool + * @param tonemap_array the new value of mTonemapArray + */ + bool setTonemap ( const Channel_Mod tonemap_array[PHY_CARRIER_NB + 1] ); + /** * Sets the PRE detection date. * @param date tick at which the preamble has been received @@ -110,6 +167,13 @@ private: */ void initAttributes ( ); + /** + * Sets if the channel is configured. + * @param is_configured the new value of mIsConfigured + * @return bool + */ + bool setIsConfigured ( const bool is_configured = true ); + /** * Gets the PRE detection date. * @return mPreDetectionDate tick at which the preamble has been received @@ -122,6 +186,14 @@ private: */ const Network_Clock_Tick getFcReceptionDate ( ) const; + /** + * Gets the time interval. + * @param symbol_start_date the current symbol start date in ticks + * @return the interval number + */ + const unsigned int getInterval ( const Network_Clock_Tick beacon_period, + const Network_Clock_Tick symbol_start_date ) const; + protected: // protected methods -- cgit v1.2.3