Changeset 9480

Show
Ignore:
Timestamp:
07/24/09 16:11:21 (4 years ago)
Author:
hvolos
Message:

Added samples per symbol parameter

Location:
ossiedev/branches/0.7.x/components/Channel
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/0.7.x/components/Channel/Channel.cpp

    r9425 r9480  
    11/**************************************************************************** 
    22 
    3 Copyright 2007 Virginia Polytechnic Institute and State University 
    4  
    5 This file is part of the OSSIE Channel. 
    6  
    7 OSSIE Channel is free software; you can redistribute it and/or modify 
    8 it under the terms of the GNU General Public License as published by 
    9 the Free Software Foundation; either version 2 of the License, or 
    10 (at your option) any later version. 
    11  
    12 OSSIE Channel is distributed in the hope that it will be useful, 
    13 but WITHOUT ANY WARRANTY; without even the implied warranty of 
    14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    15 GNU General Public License for more details. 
    16  
    17 You should have received a copy of the GNU General Public License 
    18 along with OSSIE Channel; if not, write to the Free Software 
    19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    20  
    21 ****************************************************************************/ 
    22  
     3 Copyright 2007 Virginia Polytechnic Institute and State University 
     4 
     5 This file is part of the OSSIE Channel. 
     6 
     7 OSSIE Channel is free software; you can redistribute it and/or modify 
     8 it under the terms of the GNU General Public License as published by 
     9 the Free Software Foundation; either version 2 of the License, or 
     10 (at your option) any later version. 
     11 
     12 OSSIE Channel is distributed in the hope that it will be useful, 
     13 but WITHOUT ANY WARRANTY; without even the implied warranty of 
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     15 GNU General Public License for more details. 
     16 
     17 You should have received a copy of the GNU General Public License 
     18 along with OSSIE Channel; if not, write to the Free Software 
     19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     20 
     21 ****************************************************************************/ 
    2322 
    2423#include <string> 
    2524#include <iostream> 
    26 #include <ctime>  
     25#include <ctime> 
    2726#include "math.h" 
    2827#include "Channel.h" 
    2928 
    30 Channel_i::Channel_i(const char *uuid, omni_condition *condition) :  
    31     Resource_impl(uuid), component_running(condition)  
    32 { 
     29Channel_i::Channel_i(const char *uuid, omni_condition *condition) : 
     30        Resource_impl(uuid), component_running(condition) { 
    3331    dataIn = new standardInterfaces_i::complexShort_p("data_in"); 
    3432    dataOut = new standardInterfaces_i::complexShort_u("data_out"); 
     
    4038    MaxDopplerRate=0; 
    4139    envelope=true; 
    42      srand(time(0)); 
    43  
    44     //Create the thread for the writer's processing function  
     40    srand(time(0)); 
     41 
     42    //Create the thread for the writer's processing function 
    4543    processing_thread = new omni_thread(Run, (void *) this); 
    4644 
    47     //Start the thread containing the writer's processing function  
     45    //Start the thread containing the writer's processing function 
    4846    processing_thread->start(); 
    4947 
    50  
    51 } 
    52  
    53 Channel_i::~Channel_i(void) 
    54 {    
     48} 
     49 
     50Channel_i::~Channel_i(void) { 
    5551    delete dataIn; 
    5652    delete dataOut; 
     
    5854 
    5955// Static function for omni thread 
    60 void Channel_i::Run( void * data ) 
    61 { 
    62     ((Channel_i*)data)->ProcessData(); 
    63 } 
    64  
    65 CORBA::Object_ptr Channel_i::getPort( const char* portName ) throw ( 
    66     CORBA::SystemException, CF::PortSupplier::UnknownPort) 
    67 { 
     56void Channel_i::Run(void * data) { 
     57    ((Channel_i *)data)->ProcessData(); 
     58} 
     59 
     60CORBA::Object_ptr Channel_i::getPort(const char*portName) 
     61throw ( CORBA::SystemException, CF::PortSupplier::UnknownPort) { 
    6862    DEBUG(3, Channel, "getPort() invoked with " << portName) 
    69      
     63 
    7064    CORBA::Object_var p; 
    7165 
     
    8478} 
    8579 
    86 void Channel_i::start() throw (CORBA::SystemException,  
    87     CF::Resource::StartError) 
    88 { 
    89     DEBUG(3, Channel, "start() invoked") 
    90 } 
    91  
    92 void Channel_i::stop() throw (CORBA::SystemException, CF::Resource::StopError)  
    93  
    94     DEBUG(3, Channel, "stop() invoked") 
    95 } 
    96  
     80void Channel_i::start() throw (CORBA::SystemException, 
     81                               CF::Resource::StartError) { 
     82    DEBUG       (3 ,Channel,"start()invoked") 
     83} 
     84 
     85void Channel_i::stop() throw (CORBA::SystemException, CF::Resource::StopError) { 
     86    DEBUG(3, Channel, "stop()invoked") 
     87} 
    9788void Channel_i::releaseObject() throw (CORBA::SystemException, 
    98     CF::LifeCycle::ReleaseError) 
    99 { 
    100     DEBUG(3, Channel, "releaseObject() invoked") 
    101      
     89                                       CF::LifeCycle::ReleaseError) { 
     90    DEBUG (3, Channel,"releaseObject() invoked" ) 
     91 
    10292    component_running->signal(); 
    10393} 
    10494 
    10595void Channel_i::initialize() throw (CF::LifeCycle::InitializeError, 
    106     CORBA::SystemException) 
    107 { 
    108     DEBUG(3, Channel, "initialize() invoked") 
    109 } 
    110  
    111 void  
    112 Channel_i::query (CF::Properties & configProperties) 
    113 throw (CORBA::SystemException, CF::UnknownProperties) 
    114 { 
    115     if (configProperties.length () == 0) 
    116     { 
    117         configProperties.length (propertySet.length ()); 
    118         for (unsigned int i = 0; i < propertySet.length (); i++) 
    119         { 
    120             configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     96                                    CORBA::SystemException) { 
     97    DEBUG(3,Channel , "initialize() invoked") 
     98} 
     99 
     100void Channel_i::query(CF::Properties & configProperties) 
     101throw (CORBA::SystemException, CF::UnknownProperties) { 
     102    if (configProperties.length() == 0) { 
     103        configProperties.length(propertySet.length()); 
     104        for (unsigned int i = 0; i < propertySet.length(); i++) { 
     105            configProperties[i].id = CORBA::string_dup(propertySet[i].id); 
    121106            configProperties[i].value = propertySet[i].value; 
    122107        } 
    123108 
    124         return ; 
     109        return; 
     110    } else { 
     111        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     112            for (unsigned int j=0; j < propertySet.length(); j++) { 
     113                if (strcmp(configProperties[i].id, propertySet[i].id) == 0) { 
     114                    configProperties[i].value = propertySet[i].value; 
     115                } 
     116            } 
     117        } 
    125118    } 
    126     else { 
    127         for (unsigned int i = 0; i < configProperties.length(); i++) { 
    128             for (unsigned int j=0; j < propertySet.length(); j++) { 
    129                 if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
    130                     configProperties[i].value = propertySet[i].value; 
    131                 }  
    132             } 
    133         } 
    134     } 
    135 } 
    136  
     119} 
    137120 
    138121void Channel_i::configure(const CF::Properties& props) 
    139122throw (CORBA::SystemException, 
    140     CF::PropertySet::InvalidConfiguration, 
    141     CF::PropertySet::PartialConfiguration) 
    142 { 
    143         static int init = 0; 
     123       CF::PropertySet::InvalidConfiguration, 
     124       CF::PropertySet::PartialConfiguration) { 
     125    static int init = 0; 
    144126    DEBUG(3, Channel, "configure() invoked") 
    145          
    146     if (init == 0){ 
    147         if ( props.length() <= 0 ){ 
     127 
     128    if (init == 0) { 
     129        if ( props.length() <= 0 ) { 
    148130            std::cout << "Channel: configure called with invalid props.length() - " << props.length() << std::endl; 
    149131            return; 
    150132        } 
    151      
    152         propertySet.length(props.length()); 
     133 
     134        propertySet.length(props.length()); 
    153135        for (unsigned int i=0; i < props.length(); i++) { 
    154136            std::cout << "Property Id : " << props[i].id << std::endl; 
     
    158140        init = 1; 
    159141    } 
    160         for (unsigned int i=0; i < props.length(); i++) { 
    161                     if (strcmp(props[i].id, "DCE:eddc66ce-8a82-11dd-ae05-0016769e497b") == 0) { 
    162                         //The power of the AWGN noise 
    163                         CORBA::Long simple_temp; 
    164                         props[i].value >>= simple_temp; 
    165                         noise_sigma = sqrt(simple_temp/2.0); 
    166                         for (unsigned int j=0; j < propertySet.length(); j++ ) { 
    167                                 if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
    168                                         propertySet[i].value = props[i].value; 
    169                                         break; 
    170                                 } 
    171                         } 
    172                     } else if (strcmp(props[i].id, "DCE:3bbc0656-8a83-11dd-bcd3-0016769e497b") == 0) { 
    173                         //Specifies the fading type. Valid values are None and Ricean 
    174                         const char * prop_str; 
    175                         props[i].value >>= prop_str; 
    176                         if ( strcmp(prop_str, "None") == 0 ) { 
    177                         fading=false; 
    178                         } else if ( strcmp(prop_str, "Ricean") == 0 ){ 
    179                            fading=true; 
    180                         } else { 
    181                           std::cerr << "ERROR: Channel::configure() unknown fading type" << std::endl; 
    182                            throw CF::PropertySet::InvalidConfiguration(); 
    183                         }; 
    184                         for (unsigned int j=0; j < propertySet.length(); j++ ) { 
    185                                 if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
    186                                         propertySet[i].value = props[i].value; 
    187                                         break; 
    188                                 } 
    189                         } 
    190                     } else if (strcmp(props[i].id, "DCE:4ba6cb86-29fb-40c8-a90c-7e69b7e59d85") == 0) { 
    191                        const char * prop_str; 
    192                         props[i].value >>= prop_str; 
    193                         if ( strcmp(prop_str, "True") == 0 ) { 
    194                            envelope=true; 
    195                         } else if ( strcmp(prop_str, "False") == 0 ){ 
    196                            envelope=false; 
    197                         } else { 
    198                           std::cerr << "ERROR: Channel::configure() unknown envelope type" << std::endl; 
    199                            throw CF::PropertySet::InvalidConfiguration(); 
    200                         }; 
    201                         for (unsigned int j=0; j < propertySet.length(); j++ ) { 
    202                                 if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
    203                                         propertySet[i].value = props[i].value; 
    204                                         break; 
    205                                 } 
    206                         } 
    207                     } else if (strcmp(props[i].id, "DCE:76abee66-8a83-11dd-b96d-0016769e497b") == 0) { 
    208                         // K_factor 
    209                         CORBA::Double simple_temp; 
    210                         props[i].value >>= simple_temp; 
    211                         K_factor=simple_temp; 
    212                         for (unsigned int j=0; j < propertySet.length(); j++ ) { 
    213                                 if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
    214                                         propertySet[i].value = props[i].value; 
    215                                         break; 
    216                                 } 
    217                         } 
    218                     } else if (strcmp(props[i].id, "DCE:9cc6196c-8a85-11dd-b572-0016769e497b") == 0) { 
    219                         // The maximum doppler rate in terms of the sample rate 
    220                         CORBA::Double simple_temp; 
    221                         props[i].value >>= simple_temp; 
    222                         MaxDopplerRate=simple_temp; 
    223                         for (unsigned int j=0; j < propertySet.length(); j++ ) { 
    224                                 if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
    225                                         propertySet[i].value = props[i].value; 
    226                                         break; 
    227                                 } 
    228                         } 
    229                     }  
    230         } 
    231 std::cout<<"noise_sigma:"<<noise_sigma<<"fading:"<<fading<<"envelope"<<envelope<<"K_factor:"<<K_factor<<"MaxDopplerRate"<<MaxDopplerRate<<std::endl; 
    232  
    233 } 
    234  
    235 void Channel_i::ProcessData() 
    236 { 
     142    for (unsigned int i=0; i < props.length(); i++) { 
     143        if (strcmp(props[i].id, "DCE:1d91b55a-2fcb-4d2d-ad7b-1ee58c32cad8") == 0) { 
     144            //The number of samples per symbol 
     145            CORBA::Short simple_temp; 
     146            props[i].value >>= simple_temp; 
     147            Ns = simple_temp; 
     148            for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     149                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     150                    propertySet[i].value = props[i].value; 
     151                    break; 
     152                } 
     153            } 
     154        } else if (strcmp(props[i].id, "DCE:eddc66ce-8a82-11dd-ae05-0016769e497b") == 0) { 
     155            //The power of the AWGN noise 
     156            CORBA::Long simple_temp; 
     157            props[i].value >>= simple_temp; 
     158            noise_sigma = sqrt(simple_temp/2.0); 
     159            for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     160                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     161                    propertySet[i].value = props[i].value; 
     162                    break; 
     163                } 
     164            } 
     165        } else if (strcmp(props[i].id, "DCE:3bbc0656-8a83-11dd-bcd3-0016769e497b") == 0) { 
     166            //Specifies the fading type. Valid values are None and Ricean 
     167            const char * prop_str; 
     168            props[i].value >>= prop_str; 
     169            if ( strcmp(prop_str, "None") == 0 ) { 
     170                fading=false; 
     171            } else if ( strcmp(prop_str, "Ricean") == 0 ) { 
     172                fading=true; 
     173            } else { 
     174                std::cerr << "ERROR: Channel::configure() unknown fading type" << std::endl; 
     175                throw CF::PropertySet::InvalidConfiguration(); 
     176            }; 
     177            for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     178                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     179                    propertySet[i].value = props[i].value; 
     180                    break; 
     181                } 
     182            } 
     183        } else if (strcmp(props[i].id, "DCE:4ba6cb86-29fb-40c8-a90c-7e69b7e59d85") == 0) { 
     184            const char * prop_str; 
     185            props[i].value >>= prop_str; 
     186            if ( strcmp(prop_str, "True") == 0 ) { 
     187                envelope=true; 
     188            } else if ( strcmp(prop_str, "False") == 0 ) { 
     189                envelope=false; 
     190            } else { 
     191                std::cerr << "ERROR: Channel::configure() unknown envelope type" << std::endl; 
     192                throw CF::PropertySet::InvalidConfiguration(); 
     193            }; 
     194            for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     195                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     196                    propertySet[i].value = props[i].value; 
     197                    break; 
     198                } 
     199            } 
     200        } else if (strcmp(props[i].id, "DCE:76abee66-8a83-11dd-b96d-0016769e497b") == 0) { 
     201            // K_factor 
     202            CORBA::Double simple_temp; 
     203            props[i].value >>= simple_temp; 
     204            K_factor=simple_temp; 
     205            for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     206                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     207                    propertySet[i].value = props[i].value; 
     208                    break; 
     209                } 
     210            } 
     211        } else if (strcmp(props[i].id, "DCE:9cc6196c-8a85-11dd-b572-0016769e497b") == 0) { 
     212            // The maximum doppler rate in terms of the sample rate 
     213            CORBA::Double simple_temp; 
     214            props[i].value >>= simple_temp; 
     215            MaxDopplerRate=simple_temp; 
     216            for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     217                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     218                    propertySet[i].value = props[i].value; 
     219                    break; 
     220                } 
     221            } 
     222        } 
     223    } 
     224    std::cout<<"noise_sigma:"<<noise_sigma<<"fading:"<<fading<<"envelope"<<envelope<<"K_factor:"<<K_factor<<"MaxDopplerRate"<<MaxDopplerRate<<std::endl; 
     225 
     226} 
     227 
     228void Channel_i::ProcessData() { 
    237229    DEBUG(3, Channel, "ProcessData() invoked") 
    238230 
    239231    PortTypes::ShortSequence I_out, Q_out; 
    240  
    241232 
    242233    PortTypes::ShortSequence *I_in(NULL), *Q_in(NULL); 
     
    244235 
    245236    NumberOfMultipath=50; 
    246      
     237 
    247238    double DopplerFreq[NumberOfMultipath]; 
    248239    double phis[NumberOfMultipath]; 
    249240 
    250     double totalphi,phi,pI,pQ; 
    251      
     241    double totalphi,pI,pQ; 
     242 
    252243    short Iin,Qin; 
    253244 
     
    255246    double PathPower=sqrt(NumberOfMultipath); 
    256247    long packetno=0; 
    257     
    258  
    259     while(1) 
    260     { 
     248 
     249    while (1) { 
    261250        dataIn->getData(I_in, Q_in); 
    262251 
    263252        Data_length = I_in->length(); 
    264  
    265  
    266253 
    267254        I_out.length(Data_length); //must define length of output 
     
    271258 
    272259        //phi=randf(); 
    273         if (packetno==0){ 
    274                   for (unsigned int j=0;j<NumberOfMultipath;j++) 
    275             { 
     260        if (packetno==0) { 
     261            for (unsigned int j=0;j<NumberOfMultipath;j++) { 
    276262                DopplerFreq[j]=MaxDopplerRate*randf(); 
    277263                phis[j]=randf(); 
    278264            } 
    279             } 
    280  
    281         for (unsigned int i=0; i<Data_length;i++) 
    282         { 
    283              
    284             if (fading){ 
     265        } 
     266 
     267        for (unsigned int i=0; i<Data_length;i++) { 
     268 
     269            if ((i % Ns)==0) { 
     270                if (fading) { 
    285271                    pI=0; 
    286272                    pQ=0; 
    287273 
    288                     for (unsigned int j=0;j<NumberOfMultipath;j++) 
    289                     { 
    290                          
     274                    for (unsigned int j=0;j<NumberOfMultipath;j++) { 
     275 
    291276                        totalphi=2*PI*( (DopplerFreq[j]*(i+packetno*Data_length))+phis[j]); 
    292277                        pI+=cos(totalphi); 
     
    298283                    pQ/=PathPower; 
    299284 
    300                     if (envelope){ 
    301                     pI=sqrt(pI*pI+pQ*pQ); 
    302                     pQ=0;             
     285                    if (envelope) { 
     286                        pI=sqrt(pI*pI+pQ*pQ); 
     287                        pQ=0; 
    303288 
    304289                    } 
     
    307292                    pQ=1/sqrt(K_factor+1)*pQ +sqrt(K_factor/(1+K_factor)); 
    308293 
    309  
    310  
    311             } else { 
    312              pI=1; 
    313              pQ=0; 
     294                } else { 
     295                    pI=1; 
     296                    pQ=0; 
     297                }; 
    314298            }; 
    315         
    316  
    317              //Complex multiplication 
    318              //(x + yi)(u + vi) = (xu – yv) + (xv + yu)i.  
    319              //(Iin +Qin)(pI+pQ)=(IinpI-QinPq)+(IinpQ+QinpI) 
    320  
    321         //Multiply and add AWGN Noise 
    322         //std::cout<<fading<<envelope<<"pI"<<pI<<",pQ"<<pQ<<" totalphi"<<totalphi<<std::endl; 
    323         Iin=(*I_in)[i]; 
    324         Qin=(*Q_in)[i]; 
    325         I_out[i]=(CORBA::Short)(Iin*pI-Qin*pQ)+(CORBA::Short)(noise_sigma*randn()); 
    326         Q_out[i]=(CORBA::Short)(Iin*pQ+Qin*pI)+(CORBA::Short)(noise_sigma*randn()); 
     299 
     300            //Complex multiplication 
     301            //(x + yi)(u + vi) = (xu – yv) + (xv + yu)i. 
     302            //(Iin +Qin)(pI+pQ)=(IinpI-QinPq)+(IinpQ+QinpI) 
     303 
     304            //Multiply and add AWGN Noise 
     305            //std::cout<<fading<<envelope<<"pI"<<pI<<",pQ"<<pQ<<" totalphi"<<totalphi<<std::endl; 
     306            Iin=(*I_in)[i]; 
     307            Qin=(*Q_in)[i]; 
     308            I_out[i]=(CORBA::Short)(Iin*pI-Qin*pQ)+(CORBA::Short)(noise_sigma*randn()/sqrt(float(Ns))); 
     309            Q_out[i]=(CORBA::Short)(Iin*pQ+Qin*pI)+(CORBA::Short)(noise_sigma*randn()/sqrt(float(Ns))); 
    327310        } 
    328311 
     
    338321// Algorithm bny Dr. Everett (Skip) Carter, Jr 
    339322{ 
    340 float x1,x2,w; 
    341     do 
    342     { 
     323    float x1,x2,w; 
     324    do { 
    343325        x1=2.0*randf()-1.0; 
    344326        x2=2.0*randf()-1.0; 
    345327        w=x1*x1+x2*x2; 
    346328 
    347     }while (w>=1.0); 
     329    } while (w>=1.0); 
    348330 
    349331    w=sqrt((-2.0*log(w))/w); 
     
    359341} 
    360342 
    361  
  • ossiedev/branches/0.7.x/components/Channel/Channel.h

    r9211 r9480  
    11/**************************************************************************** 
    22 
    3 Copyright 2007 Virginia Polytechnic Institute and State University 
     3 Copyright 2007 Virginia Polytechnic Institute and State University 
    44 
    5 This file is part of the OSSIE Channel. 
     5 This file is part of the OSSIE Channel. 
    66 
    7 OSSIE Channel is free software; you can redistribute it and/or modify 
    8 it under the terms of the GNU General Public License as published by 
    9 the Free Software Foundation; either version 2 of the License, or 
    10 (at your option) any later version. 
     7 OSSIE Channel is free software; you can redistribute it and/or modify 
     8 it under the terms of the GNU General Public License as published by 
     9 the Free Software Foundation; either version 2 of the License, or 
     10 (at your option) any later version. 
    1111 
    12 OSSIE Channel is distributed in the hope that it will be useful, 
    13 but WITHOUT ANY WARRANTY; without even the implied warranty of 
    14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    15 GNU General Public License for more details. 
     12 OSSIE Channel is distributed in the hope that it will be useful, 
     13 but WITHOUT ANY WARRANTY; without even the implied warranty of 
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     15 GNU General Public License for more details. 
    1616 
    17 You should have received a copy of the GNU General Public License 
    18 along with OSSIE Channel; if not, write to the Free Software 
    19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
     17 You should have received a copy of the GNU General Public License 
     18 along with OSSIE Channel; if not, write to the Free Software 
     19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    2020 
    21 ****************************************************************************/ 
    22  
     21 ****************************************************************************/ 
    2322 
    2423#ifndef CHANNEL_IMPL_H 
     
    3130#include "ossie/debug.h" 
    3231 
    33  
    3432#include "standardinterfaces/complexShort.h" 
    3533#include "standardinterfaces/complexShort_u.h" 
     
    4038 * 
    4139 */ 
    42 class Channel_i : public virtual Resource_impl 
    43 { 
    44   public: 
    45     /// Initializing constructor 
    46     Channel_i(const char *uuid, omni_condition *sem); 
     40class Channel_i: public virtual Resource_impl { 
     41public: 
     42        /// Initializing constructor 
     43        Channel_i(const char *uuid, omni_condition *sem); 
    4744 
    48     /// Destructor 
    49     ~Channel_i(void); 
     45        /// Destructor 
     46        ~Channel_i(void); 
    5047 
    51     /// Static function for omni thread 
    52     static void Run( void * data ); 
     48        /// Static function for omni thread 
     49        static void Run(void * data); 
    5350 
    54     /// 
    55     void start() throw (CF::Resource::StartError, CORBA::SystemException); 
     51        /// 
     52        void start() throw (CF::Resource::StartError, CORBA::SystemException); 
    5653 
    57     /// 
    58     void stop() throw (CF::Resource::StopError, CORBA::SystemException); 
     54        /// 
     55        void stop() throw (CF::Resource::StopError, CORBA::SystemException); 
    5956 
    60     /// 
    61     CORBA::Object_ptr getPort( const char* portName ) 
    62         throw (CF::PortSupplier::UnknownPort, CORBA::SystemException); 
     57        /// 
     58        CORBA::Object_ptr getPort(const char* portName) 
     59        throw (CF::PortSupplier::UnknownPort, CORBA::SystemException); 
    6360 
    64     /// 
    65     void releaseObject() throw (CF::LifeCycle::ReleaseError, CORBA::SystemException); 
     61        /// 
     62        void releaseObject() throw (CF::LifeCycle::ReleaseError, 
     63                        CORBA::SystemException); 
    6664 
    67     /// 
    68     void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    69          
    70     void query(CF::Properties &configProperties) 
    71         throw (CF::UnknownProperties, CORBA::SystemException); 
     65        /// 
     66        void initialize() throw (CF::LifeCycle::InitializeError, 
     67                        CORBA::SystemException); 
    7268 
    73     /// Configures properties read from .prf.xml 
    74     void configure(const CF::Properties&) 
    75         throw (CORBA::SystemException, 
    76             CF::PropertySet::InvalidConfiguration, 
    77             CF::PropertySet::PartialConfiguration); 
     69        void query(CF::Properties &configProperties) throw (CF::UnknownProperties, 
     70                        CORBA::SystemException); 
    7871 
    79    private: 
    80     /// Disallow default constructor 
    81     Channel_i(); 
     72        /// Configures properties read from .prf.xml 
     73        void configure(const CF::Properties&) throw (CORBA::SystemException, 
     74                        CF::PropertySet::InvalidConfiguration, 
     75                        CF::PropertySet::PartialConfiguration); 
    8276 
    83     /// Disallow copy constructor 
    84     Channel_i(Channel_i&); 
     77private: 
     78        /// Disallow default constructor 
     79        Channel_i(); 
    8580 
    86     /// Main signal processing method 
    87     void ProcessData(); 
    88     
    89     omni_condition *component_running;  ///< for component shutdown 
    90     omni_thread *processing_thread;     ///< for component writer function 
    91          
     81        /// Disallow copy constructor 
     82        Channel_i(Channel_i&); 
    9283 
    93      
    94     // list components provides and uses ports 
    95         standardInterfaces_i::complexShort_p *dataIn; 
    96         standardInterfaces_i::complexShort_u *dataOut; 
     84        /// Main signal processing method 
     85        void ProcessData(); 
    9786 
    98     bool fading; 
    99     bool envelope; 
     87        omni_condition *component_running; ///< for component shutdown 
     88        omni_thread *processing_thread; ///< for component writer function 
    10089 
    101     double noise_sigma,K_factor,MaxDopplerRate; 
    10290 
    103     float randn(); 
    104     float randf(); 
    105      
     91        // list components provides and uses ports 
     92        standardInterfaces_i::complexShort_p *dataIn; 
     93        standardInterfaces_i::complexShort_u *dataOut; 
     94 
     95        bool fading; 
     96        bool envelope; 
     97        short int Ns; //Number of samples per symbol 
     98 
     99        double noise_sigma,K_factor,MaxDopplerRate; 
     100 
     101        float randn(); 
     102        float randf(); 
     103 
    106104}; 
    107105#endif 
  • ossiedev/branches/0.7.x/components/Channel/Channel.prf.xml

    r9020 r9480  
    44<!--Powered by Python--> 
    55<properties> 
     6    <simple id="DCE:1d91b55a-2fcb-4d2d-ad7b-1ee58c32cad8" mode="readonly" name="Samples per symbol" type="short"> 
     7        <value>1</value>  
     8        <description>The number of samples that represent one symbol</description>  
     9        <kind kindtype="configure"/> 
     10    </simple> 
    611    <simple id="DCE:eddc66ce-8a82-11dd-ae05-0016769e497b" mode="readonly" name="AWGN Noise Power" type="long"> 
    712        <value>0</value>