kerimike 0 Report post Posted March 17, 2008 salam semua...nk mintak tolong sangat2..sy baru blaja...sy ade coding visual c++..tp xtau mcmane nk compile dan tgk result die...try gune microsoft visual c++ tp xreti..ni code die..VISUAL C++ SOURCE CODESCWCDMA Radio Link Budget .CPP File:// RLBDlg.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "RLBDlg.h"#include "CellRange.h"#include "EBN0.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialog{public:CAboutDlg();// Dialog Data//{{AFX_DATA(CAboutDlg)enum { IDD = IDD_ABOUTBOX };//}}AFX_DATA// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CAboutDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support//}}AFX_VIRTUAL// Imp lementationprotected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD){//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT}void CAboutDlg::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)//{{AFX_MSG_MAP(CAboutDlg)// No message handlers//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CRLBDlg dialogCRLBDlg::CRLBDlg(CWnd* pParent /*=NULL*/): CDialog(CRLBDlg::IDD, pParent){//{{AFX_DATA_INIT(CRLBDlg)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT// Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);}void CRLBDlg::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CRLBDlg)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CRLBDlg, CDialog)//{{AFX_MSG_MAP(CRLBDlg)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_CELLRANGE, OnCellrange)ON_BN_CLICKED(IDC_EBNO, OnEbno)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CRLBDlg message handlersBOOL CRLBDlg::OnInitDialog(){CDialog::OnInitDialog();// Add "About..." menu item to system menu.// IDM_ABOUTBOX must be in the system command range.ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX < 0xF00 0);CMenu* pSysMenu = GetSystemMenu(FALSE);if (pSysMenu != NULL){CString strAboutMenu;strAboutMenu.LoadString(IDS_ABOUTBOX);if (!strAboutMenu.IsEmpty()){pSysMenu->AppendMenu(MF_SEPARATOR);pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX,strAboutMenu);}}// Set the icon for this dialog. The framework does this automatically// when the application's main window is not a dialogSetIcon(m_hIcon, TRUE); // Set big iconSetIcon(m_hIcon, FALSE); // Set small icon// TODO: Add extra initialization herereturn TRUE; // return TRUE unless you set the focus to a control}void CRLBDlg::OnSysCommand(UINT nID, LPARAM lParam){if ((nID & 0xFFF0) == IDM_ABOUTBOX){CAboutDlg dlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID, lParam);}}// If you add a minimize button to your dialog, you will need the code below// to draw the icon. For MFC applications using the documen t/view model,// this is automatically done for you by the framework.void CRLBDlg::OnPaint(){if (IsIconic()){CPaintDC dc(this); // device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);// Center icon in client rectangleint cxIcon = GetSystemMetrics(SM_CXICON);int cyIcon = GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(&rect);int x = (rect.Width() - cxIcon + 1) / 2;int y = (rect.Height() - cyIcon + 1) / 2;// Draw the icondc.DrawIcon(x, y, m_hIcon);}else{CDialog::OnPaint();}}// The system calls this to obtain the cursor to display while the user drag s// the minimized window.HCURSOR CRLBDlg::OnQueryDragIcon(){return (HCURSOR) m_hIcon;}void CRLBDlg::OnCellrange(){// TODO: Add your control notification handler cod e hereCCellRange pCellRange;pCellRange.DoModal();}void CRLBDlg::OnEbno(){// TODO: Add your control notification handler cod e hereCEBN0 pEBN0;pEBN0.DoModal();}Calculation of Cell Range .CPP File:// CellRange.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CellRange.h"#include "CVoice.h"#include "CCS.h"#include "CPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCellRange dialogCCellRange::CCellRange(CWnd* pParent /* =NULL*/): CDialog(CCellRange::IDD, pParent){//{{AFX_DATA_INIT(CCellRange)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT}void CCellRange::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCellRange)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCellRange, CDialog)//{{AFX_MSG_MAP(CCellRange)ON_BN_CLICKED(IDC_VOICE, OnCVoice)ON_BN_CLICKED(IDC_CS, OnCCS)ON_BN_CLICKED(IDC_PS, OnCPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCellRange message handlersvoid CCellRange::OnCVoice(){// TODO: Add your control notification handler cod e hereCCVoice pCVoice;pCVoice.DoModal();}void CCellRange::OnCCS(){// TODO: Add your control notification handler cod e hereCCCS pCCCS;pCCCS.DoModal();}void CCellRange::OnCPS(){// TODO: Add your control notification handler cod e hereCCPS pCCPS;pCCPS.DoModal();}Calculation of Eb/N0 .CPP File:// EBN0 .cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "EBN0.h"#include "EVOICE.h"#include "ECS.h"#include "EPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CEBN0 dialogCEBN0::CEBN0(CWnd* pParent /*=NULL*/): CDialog(CEBN0::IDD, pParent){//{{AFX_DATA_INIT(CEBN0)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT}void CEBN0::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CEBN0)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CEBN0, CDialog)//{{AFX_MSG_MAP(CEBN0)ON_BN_CLICKED(IDC_VOICE2, OnEVOICE)ON_BN_CLICKED(IDC_CS2, OnECS)ON_BN_CLICKED(IDC_PS2, OnEPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CEBN0 message handlersvoid CEBN0::OnEVOICE(){// TODO: Add your control notification handler cod e hereCEVOICE pEVOICE;pEVOICE.DoModal();}void CEBN0::OnECS(){// TODO: Add your control notification handler cod e hereCECS pECS;pECS.DoModal();}void CEBN0::OnEPS(){// TODO: Add your control notification handler cod e hereCEPS pEPS;pEPS.DoModal();}Calculation of Cell Range for Voice Serv ice .CPP File:// CVoice.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CVoice.h"#include "CRVOICE.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCVoice dialogCCVoice::CCVoice(CWnd* pParent /*=NULL*/): CDialog(CCVoice::IDD, pParent){//{{AFX_DATA_INIT(CCVoice)m_AEBN01 = 5.0;m_AGR1 = 18.0;m_AGT1 = 0.0;m_APT1 = 21.0;//}}AFX_DATA_INIT}void CCVoice::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCVoice)DDX_Text(pDX, IDC_AEBN01, m_AEBN01);DDX_Text(pDX, IDC_AGR1, m_AGR1);DDX_Text(pDX, IDC_AGT1, m_AGT1);DDX_Text(pDX, IDC_APT1, m_APT1);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCVoice, CDialog)//{{AFX_MSG_MAP(CCVoice)ON_BN_CLICKED(IDOK, OnGOTOCRVOICE)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCVoice message handlersvoid CCVoice::OnGOTOCRVOICE(){// TODO: Add your control notification handler cod e heredouble c,d;c=3 .0; //c:Body/orientation loss in dBd=m_APT1+m_AGT1-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,m,n;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/12.2); //l:Processing gain in dBn=m_AEBN01-l+k; //n:Receiver sensitivity in dBmdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=0.0; //q:Fast fading margin in dBr=d-n+m_AGR1-p-q; //r:Maximum path loss in dBdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=3.0; //t:Soft handover gain in dBu=10.0; //u:Penetration loss in car in dBv=r-s+t-u; //v:Allowable path loss for cell range in dBdouble w,x,y;w=34.4; //w:Slope Ax=125.5; //x:Intercept By=pow(10,((v-x)/w)); //y:Cell range in kmCCRVOICE pCRVOICE;pCRVOICE.m_CRVOICE=y;pCRVOICE.DoModal();}Result of Cell Range for Vo ice Service .CPP File:// CRVOICE.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CRVOICE.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCRVOICE dialogCCRVOICE::CCRVOICE(CWnd* pParent /*=NULL* /): CDialog(CCRVOICE::IDD, pParent){//{{AFX_DATA_INIT(CCRVOICE)m_CRVOICE = 0.0;//}}AFX_DATA_INIT}void CCRVOICE::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCRVOICE)DDX_Text(pDX, IDC_CRVOICE, m_CRVOICE);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCRVOICE, CDialog)//{{AFX_MSG_MAP(CCRVOICE)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCRVOICE message handlersCalculation of Cell Range for Circuit-Switched Service .CPP File:// CCS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CCS.h"#include "CRCS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCCS dialogCCCS::CCCS(CWnd* pParent /*=NULL*/): CDialog(CCCS::IDD, pParent){//{{AFX_DATA_INIT(CCCS)m_AEBN02 = 1.5;m_AGR2 = 18.0;m_AGT2 = 2.0;m_APT2 = 24.0;//}}AFX_DATA_INIT}void CCCS::DoDataExch ange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCCS)DDX_Text(pDX, IDC_AEBN02, m_AEBN02);DDX_Text(pDX, IDC_AGR2, m_AGR2);DDX_Text(pDX, IDC_AGT2, m_AGT2);DDX_Text(pDX, IDC_APT2, m_APT2);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCCS, CDialog)//{{AFX_MSG_MAP(CCCS)ON_BN_CLICKED(IDOK, OnGOTOCRCS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCCS message handlersvoid CCCS::OnGOTOCRCS(){// TODO: Add your control notification handler cod e heredouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT2+m_AGT2-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/144); //l:Processing gain in dBn=m_AEBN02-l+k; //n:Receiver sensitivity in dBmdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=d-n+m_AGR2-p-q; //r:Maximum path loss in dBdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=2.0; //t:Soft handover gain in dBu=16.0; //u:Penetration loss in car in dBv=r-s+t-u; //v:Allowable path loss for cell range in dBdouble w,x,y;w=34.4; //w:Slope Ax=122.3; //x:Intercept By=pow(10,((v-x)/w)); //y:Cell range in kmCCRCS pCRCS;pCRCS.m_CRCS=y;pCRCS.DoModal();}Result of Cell Range for Circuit-Switched Service .CPP File:// CRCS.cpp : implementatio n file//#include "stdafx.h"#include "RLB.h"#include "CRCS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCRCS dialogCCRCS::CCRCS(CWnd* pParent /*=NULL*/): CDialog(CCRCS::IDD, pParent){//{{AFX_DATA_INIT(CCRCS)m_CRCS = 0.0;//}}AFX_DATA_INIT}void CCRCS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCRCS)DDX_Text(pDX, IDC_CRCS, m_CRCS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCRCS, CDialog)//{{AFX_MSG_MAP(CCRCS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCRCS message handlersCalculation of Cell Range for Packet-Switched Service .CPP File:// CPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CPS.h"#include "CRPS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCPS dialogCCPS::CCPS(CWnd* pParent /*=NULL*/): CDialog(CCPS::IDD, pParent){//{{AFX_DATA_INIT(CCPS)m_AEBN03 = 1.0;m_AGR3 = 18.0;m_AGT3 = 2.0;m_APT3 = 24.0;//}}AFX_DATA_INIT}void CCPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCPS)DDX_Text(pDX, IDC_AEBN03, m_AEBN03);DDX_Text(pDX, IDC_AGR3, m_AGR3);DDX_Text(pDX, IDC_AGT3, m_AGT3);DDX_Text(pDX, IDC_APT3, m_APT3);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCPS, CDialog)//{{AFX_MSG_MAP(CCPS)ON_BN_CLICKED(IDOK, OnGOTOCRPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCPS message handlersvoid CCPS::OnGOTOCRPS(){// TODO: Add your control notification handler cod e heredouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT3+m_AGT3-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/384); //l:Processing gain in dBn=m_AEBN03-l+k; //n:Receiver sensitivity in dBmdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=d-n+m_AGR3-p-q; //r:Maximum path loss in dBdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=0.0; //t:Soft handover gain in dBu=0.0; //u:Penetration loss in car in dBv=r-s+t-u; //v:Allowable path loss for cell range in dBdouble w,x,y;w=34.4; //w:Slope Ax=127.5; //x:Intercept By=pow(10,((v-x)/w)); //y:Cell range in kmCCRPS pCRPS;pCRPS.m_CRPS=y;pCRPS.DoModal();}Result of Cell Range for Packet-Switched Service .CPP File:// CRPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CRPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCRPS dialogCCRPS::CCRPS(CWnd* pParent /*=NULL*/): CDialog(CCRPS::IDD, pParent){//{{AFX_DATA_INIT(CCRPS)m_CRPS = 0.0;//}}AFX_DATA_INIT}void CCRPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCRPS)DDX_Text(pDX, IDC_CRPS, m_CRPS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCRPS, CDialog)//{{AFX_MSG_MAP(CCRPS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCRPS message handlersCalculation of Eb/N0 for Voice Service .CPP File:// EVOICE.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "EVOICE.h"#include "ERVOICE.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CEVOICE dialogCEVOICE::CEVOICE(CWnd* pParent /*=NULL*/): CDialog(CEVOICE::IDD, pParent){//{{AFX_DATA_INIT(CEVOICE)m_AGR4 = 18.0;m_AGT4 = 0.0;m_APT4 = 21.0;m_ACELLRANGE4 = 2.0;//}}AFX_DATA_INIT}void CEVOICE::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CEVOICE)DDX_Text(pDX, IDC_AGR4, m_AGR4);DDX_Text(pDX, IDC_AGT4, m_AGT4);DDX_Text(pDX, IDC_APT4, m_APT4);DDX_Text(pDX, IDC_ACELLRANGE4, m_ACELLRANGE4);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CEVOICE, CDialog)//{{AFX_MSG_MAP(CEVOICE)ON_BN_CLICKED(IDOK, OnGOTOERVOICE)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CEVOICE message handlersvoid CEVOICE::OnGOTOERVOICE(){// TODO: Add your control notification handler cod e heredouble w,x,y;w=34.4; //w:Slope Ax=125.5; //x:Intercept By=m_ACELLRANGE4; //y:Cell range in kmdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=3.0; //t:Soft handover gain in dBu=10.0; //u:Penetration loss in car in dBv=(w*log10(y))+x; //v:Allo wable path loss for cell range in dBdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=0.0; //q:Fast fading margin in dBr=v+s-t+u; //r:Maximum path loss in dBdouble c,d;c=3 .0; //c:Body/orientation loss in dBd=m_APT4+m_AGT4-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n,z;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/12.2); //l:Processing gain in dBn=d+m_AGR4-p-q-r; //n:Receiver sensitivity in dBmz=n +l-k; //z:Eb/No ratio in dBCERVOICE pERVOICE;pERVOICE.m_ERVOICE=z;pERVOICE.DoModal();}Result of Eb/N0 for Voice Service .CPP File:// ERVOICE.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ERVOICE.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CERVOICE dialogCERVOICE::CERVOICE(CWnd* pParent /*=NULL* /): CDialog(CERVOICE::IDD, pParent){//{{AFX_DATA_INIT(CERVOICE)m_ERVOICE = 0.0;//}}AFX_DATA_INIT}void CERVOICE::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CERVOICE)DDX_Text(pDX, IDC_ERVOICE, m_ERVOICE);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CERVOICE, CDialog)//{{AFX_MSG_MAP(CERVOICE)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CERVOICE message handlersCalculation of Eb/N0 for Circuit-Switched Service .CPP File:// ECS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ECS.h"#include "ERCS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CECS dialogCECS::CECS(CWnd* pParent /*=NULL*/): CDialog(CECS::IDD, pParent){//{{AFX_DATA_INIT(CECS)m_AGR5 = 18.0;m_AGT5 = 2.0;m_APT5 = 24.0;m_ACELLRANGE5 = 1.2;//}}AFX_DATA_INIT}void CECS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CECS)DDX_Text(pDX, IDC_AGR5, m_AGR5);DDX_Text(pDX, IDC_AGT5, m_AGT5);DDX_Text(pDX, IDC_APT5, m_APT5);DDX_Text(pDX, IDC_ACELLRANGE5, m_ACELLRANGE5);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CECS, CDialog)//{{AFX_MSG_MAP(CECS)ON_BN_CLICKED(IDOK, OnGOTOERCS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CECS message handlersvoid CECS::OnGOTOERCS(){// TODO: Add your control notification handler cod e heredouble w,x,y;w=34.4; //w:Slope Ax=122.3; //x:Intercept By=m_ACELLRANGE5; //y:Cell range in kmdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=2.0; //t:Soft handover gain in dBu=16.0; //u:Penetration loss in car in dBv=(w*log10(y))+x; //v:Allo wable path loss for cell range in dBdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=v+s-t+u; //r:Maximum path loss in dBdouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT5+m_AGT5-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n,z;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/144); //l:Processing gain in dBn=d+m_AGR5-p-q-r; //n:Receiver sensitivity in dBmz=n +l-k; //z:Eb/No ratio in dBCERCS pERCS;pERCS.m_ERCS=z;pERCS.DoModal();}Result of Eb/N0 for Circuit-Switched Service .CPP File:// ERCS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ERCS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CERCS dialogCERCS::CERCS(CWnd* pParent /*=NULL* /): CDialog(CERCS::IDD, pParent){//{{AFX_DATA_INIT(CERCS)m_ERCS = 0.0;//}}AFX_DATA_INIT}void CERCS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CERCS)DDX_Text(pDX, IDC_ERCS, m_ERCS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CERCS, CDialog)//{{AFX_MSG_MAP(CERCS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CERCS message handlersCalculation of Eb/N0 for Packet-Switched Service .CPP File:// EPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "EPS.h"#include "ERPS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CEPS dialogCEPS::CEPS(CWnd* pParent /*=NULL*/): CDialog(CEPS::IDD, pParent){//{{AFX_DATA_INIT(CEPS)m_AGR6 = 18.0;m_AGT6 = 2.0;m_APT6 = 24.0;m_ACELLRANGE6 = 1.8;//}}AFX_DATA_INIT}void CEPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CEPS)DDX_Text(pDX, IDC_AGR6, m_AGR6);DDX_Text(pDX, IDC_AGT6, m_AGT6);DDX_Text(pDX, IDC_APT6, m_APT6);DDX_Text(pDX, IDC_ACELLRANGE6, m_ACELLRANGE6);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CEPS, CDialog)//{{AFX_MSG_MAP(CEPS)ON_BN_CLICKED(IDOK, OnGOTOERPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CEPS message handlersvoid CEPS::OnGOTOERPS(){// TODO: Add your control notification handler cod e heredouble w,x,y;w=34.4; //w:Slope Ax=127.5; //x:Intercept By=m_ACELLRANGE6; //y:Cell range in kmdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=0.0; //t:Soft handover gain in dBu=0.0; //u:Penetration loss in car in dBv=(w*log10(y))+x; //v:Allowable path loss for cell rang e in dBdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=v+s-t+u; //r:Maximum path loss in dBdouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT6+m_AGT6-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n,z;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/384); //l:Processing gain in dBn=d+m_AGR6-p-q-r; //n:Receiver sensitivity in dBmz=n +l-k; //z:Eb/No ratio in dBCERPS pERPS;pERPS.m_ERPS=z;pERPS.DoModal();}Result of Eb/N0 for Packet-Switched Service .CPP File:// ERPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ERPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CERPS dialogCERPS::CERPS(CWnd * pParent /*=NULL*/): CDialog(CERPS::IDD, pParent){//{{AFX_DATA_INIT(CERPS)m_ERPS = 0.0;//}}AFX_DATA_INIT}void CERPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CERPS)DDX_Text(pDX, IDC_ERPS, m_ERPS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CERPS, CDialog)//{{AFX_MSG_MAP(CERPS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CERPS message handlerspersoalanya...sy nk buat mcmane utk tgk hasil coding ni??plzzz..tolong sangat2...lecturer sy bagi utk final year projek...die srh sy tgk hasil code ni..tolong sangat2...sy bdk electronik...kurang mahir Quote Share this post Link to post Share on other sites
KaMbEnG KeR 0 Report post Posted March 17, 2008 salam semua...nk mintak tolong sangat2..sy baru blaja...sy ade coding visual c++..tp xtau mcmane nk compile dan tgk result die...try gune microsoft visual c++ tp xreti..ni code die..VISUAL C++ SOURCE CODESCWCDMA Radio Link Budget .CPP File:// RLBDlg.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "RLBDlg.h"#include "CellRange.h"#include "EBN0.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialog{public:CAboutDlg();// Dialog Data//{{AFX_DATA(CAboutDlg)enum { IDD = IDD_ABOUTBOX };//}}AFX_DATA// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CAboutDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support//}}AFX_VIRTUAL// Imp lementationprotected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP()};CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD){//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT}void CAboutDlg::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)//{{AFX_MSG_MAP(CAboutDlg)// No message handlers//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CRLBDlg dialogCRLBDlg::CRLBDlg(CWnd* pParent /*=NULL*/): CDialog(CRLBDlg::IDD, pParent){//{{AFX_DATA_INIT(CRLBDlg)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT// Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);}void CRLBDlg::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CRLBDlg)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CRLBDlg, CDialog)//{{AFX_MSG_MAP(CRLBDlg)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_CELLRANGE, OnCellrange)ON_BN_CLICKED(IDC_EBNO, OnEbno)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CRLBDlg message handlersBOOL CRLBDlg::OnInitDialog(){CDialog::OnInitDialog();// Add "About..." menu item to system menu.// IDM_ABOUTBOX must be in the system command range.ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX < 0xF00 0);CMenu* pSysMenu = GetSystemMenu(FALSE);if (pSysMenu != NULL){CString strAboutMenu;strAboutMenu.LoadString(IDS_ABOUTBOX);if (!strAboutMenu.IsEmpty()){pSysMenu->AppendMenu(MF_SEPARATOR);pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX,strAboutMenu);}}// Set the icon for this dialog. The framework does this automatically// when the application's main window is not a dialogSetIcon(m_hIcon, TRUE); // Set big iconSetIcon(m_hIcon, FALSE); // Set small icon// TODO: Add extra initialization herereturn TRUE; // return TRUE unless you set the focus to a control}void CRLBDlg::OnSysCommand(UINT nID, LPARAM lParam){if ((nID & 0xFFF0) == IDM_ABOUTBOX){CAboutDlg dlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID, lParam);}}// If you add a minimize button to your dialog, you will need the code below// to draw the icon. For MFC applications using the documen t/view model,// this is automatically done for you by the framework.void CRLBDlg::OnPaint(){if (IsIconic()){CPaintDC dc(this); // device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);// Center icon in client rectangleint cxIcon = GetSystemMetrics(SM_CXICON);int cyIcon = GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(&rect);int x = (rect.Width() - cxIcon + 1) / 2;int y = (rect.Height() - cyIcon + 1) / 2;// Draw the icondc.DrawIcon(x, y, m_hIcon);}else{CDialog::OnPaint();}}// The system calls this to obtain the cursor to display while the user drag s// the minimized window.HCURSOR CRLBDlg::OnQueryDragIcon(){return (HCURSOR) m_hIcon;}void CRLBDlg::OnCellrange(){// TODO: Add your control notification handler cod e hereCCellRange pCellRange;pCellRange.DoModal();}void CRLBDlg::OnEbno(){// TODO: Add your control notification handler cod e hereCEBN0 pEBN0;pEBN0.DoModal();}Calculation of Cell Range .CPP File:// CellRange.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CellRange.h"#include "CVoice.h"#include "CCS.h"#include "CPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCellRange dialogCCellRange::CCellRange(CWnd* pParent /* =NULL*/): CDialog(CCellRange::IDD, pParent){//{{AFX_DATA_INIT(CCellRange)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT}void CCellRange::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCellRange)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCellRange, CDialog)//{{AFX_MSG_MAP(CCellRange)ON_BN_CLICKED(IDC_VOICE, OnCVoice)ON_BN_CLICKED(IDC_CS, OnCCS)ON_BN_CLICKED(IDC_PS, OnCPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCellRange message handlersvoid CCellRange::OnCVoice(){// TODO: Add your control notification handler cod e hereCCVoice pCVoice;pCVoice.DoModal();}void CCellRange::OnCCS(){// TODO: Add your control notification handler cod e hereCCCS pCCCS;pCCCS.DoModal();}void CCellRange::OnCPS(){// TODO: Add your control notification handler cod e hereCCPS pCCPS;pCCPS.DoModal();}Calculation of Eb/N0 .CPP File:// EBN0 .cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "EBN0.h"#include "EVOICE.h"#include "ECS.h"#include "EPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CEBN0 dialogCEBN0::CEBN0(CWnd* pParent /*=NULL*/): CDialog(CEBN0::IDD, pParent){//{{AFX_DATA_INIT(CEBN0)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT}void CEBN0::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CEBN0)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CEBN0, CDialog)//{{AFX_MSG_MAP(CEBN0)ON_BN_CLICKED(IDC_VOICE2, OnEVOICE)ON_BN_CLICKED(IDC_CS2, OnECS)ON_BN_CLICKED(IDC_PS2, OnEPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CEBN0 message handlersvoid CEBN0::OnEVOICE(){// TODO: Add your control notification handler cod e hereCEVOICE pEVOICE;pEVOICE.DoModal();}void CEBN0::OnECS(){// TODO: Add your control notification handler cod e hereCECS pECS;pECS.DoModal();}void CEBN0::OnEPS(){// TODO: Add your control notification handler cod e hereCEPS pEPS;pEPS.DoModal();}Calculation of Cell Range for Voice Serv ice .CPP File:// CVoice.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CVoice.h"#include "CRVOICE.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCVoice dialogCCVoice::CCVoice(CWnd* pParent /*=NULL*/): CDialog(CCVoice::IDD, pParent){//{{AFX_DATA_INIT(CCVoice)m_AEBN01 = 5.0;m_AGR1 = 18.0;m_AGT1 = 0.0;m_APT1 = 21.0;//}}AFX_DATA_INIT}void CCVoice::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCVoice)DDX_Text(pDX, IDC_AEBN01, m_AEBN01);DDX_Text(pDX, IDC_AGR1, m_AGR1);DDX_Text(pDX, IDC_AGT1, m_AGT1);DDX_Text(pDX, IDC_APT1, m_APT1);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCVoice, CDialog)//{{AFX_MSG_MAP(CCVoice)ON_BN_CLICKED(IDOK, OnGOTOCRVOICE)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCVoice message handlersvoid CCVoice::OnGOTOCRVOICE(){// TODO: Add your control notification handler cod e heredouble c,d;c=3 .0; //c:Body/orientation loss in dBd=m_APT1+m_AGT1-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,m,n;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/12.2); //l:Processing gain in dBn=m_AEBN01-l+k; //n:Receiver sensitivity in dBmdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=0.0; //q:Fast fading margin in dBr=d-n+m_AGR1-p-q; //r:Maximum path loss in dBdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=3.0; //t:Soft handover gain in dBu=10.0; //u:Penetration loss in car in dBv=r-s+t-u; //v:Allowable path loss for cell range in dBdouble w,x,y;w=34.4; //w:Slope Ax=125.5; //x:Intercept By=pow(10,((v-x)/w)); //y:Cell range in kmCCRVOICE pCRVOICE;pCRVOICE.m_CRVOICE=y;pCRVOICE.DoModal();}Result of Cell Range for Vo ice Service .CPP File:// CRVOICE.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CRVOICE.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCRVOICE dialogCCRVOICE::CCRVOICE(CWnd* pParent /*=NULL* /): CDialog(CCRVOICE::IDD, pParent){//{{AFX_DATA_INIT(CCRVOICE)m_CRVOICE = 0.0;//}}AFX_DATA_INIT}void CCRVOICE::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCRVOICE)DDX_Text(pDX, IDC_CRVOICE, m_CRVOICE);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCRVOICE, CDialog)//{{AFX_MSG_MAP(CCRVOICE)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCRVOICE message handlersCalculation of Cell Range for Circuit-Switched Service .CPP File:// CCS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CCS.h"#include "CRCS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCCS dialogCCCS::CCCS(CWnd* pParent /*=NULL*/): CDialog(CCCS::IDD, pParent){//{{AFX_DATA_INIT(CCCS)m_AEBN02 = 1.5;m_AGR2 = 18.0;m_AGT2 = 2.0;m_APT2 = 24.0;//}}AFX_DATA_INIT}void CCCS::DoDataExch ange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCCS)DDX_Text(pDX, IDC_AEBN02, m_AEBN02);DDX_Text(pDX, IDC_AGR2, m_AGR2);DDX_Text(pDX, IDC_AGT2, m_AGT2);DDX_Text(pDX, IDC_APT2, m_APT2);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCCS, CDialog)//{{AFX_MSG_MAP(CCCS)ON_BN_CLICKED(IDOK, OnGOTOCRCS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCCS message handlersvoid CCCS::OnGOTOCRCS(){// TODO: Add your control notification handler cod e heredouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT2+m_AGT2-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/144); //l:Processing gain in dBn=m_AEBN02-l+k; //n:Receiver sensitivity in dBmdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=d-n+m_AGR2-p-q; //r:Maximum path loss in dBdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=2.0; //t:Soft handover gain in dBu=16.0; //u:Penetration loss in car in dBv=r-s+t-u; //v:Allowable path loss for cell range in dBdouble w,x,y;w=34.4; //w:Slope Ax=122.3; //x:Intercept By=pow(10,((v-x)/w)); //y:Cell range in kmCCRCS pCRCS;pCRCS.m_CRCS=y;pCRCS.DoModal();}Result of Cell Range for Circuit-Switched Service .CPP File:// CRCS.cpp : implementatio n file//#include "stdafx.h"#include "RLB.h"#include "CRCS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCRCS dialogCCRCS::CCRCS(CWnd* pParent /*=NULL*/): CDialog(CCRCS::IDD, pParent){//{{AFX_DATA_INIT(CCRCS)m_CRCS = 0.0;//}}AFX_DATA_INIT}void CCRCS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCRCS)DDX_Text(pDX, IDC_CRCS, m_CRCS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCRCS, CDialog)//{{AFX_MSG_MAP(CCRCS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCRCS message handlersCalculation of Cell Range for Packet-Switched Service .CPP File:// CPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CPS.h"#include "CRPS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCPS dialogCCPS::CCPS(CWnd* pParent /*=NULL*/): CDialog(CCPS::IDD, pParent){//{{AFX_DATA_INIT(CCPS)m_AEBN03 = 1.0;m_AGR3 = 18.0;m_AGT3 = 2.0;m_APT3 = 24.0;//}}AFX_DATA_INIT}void CCPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCPS)DDX_Text(pDX, IDC_AEBN03, m_AEBN03);DDX_Text(pDX, IDC_AGR3, m_AGR3);DDX_Text(pDX, IDC_AGT3, m_AGT3);DDX_Text(pDX, IDC_APT3, m_APT3);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCPS, CDialog)//{{AFX_MSG_MAP(CCPS)ON_BN_CLICKED(IDOK, OnGOTOCRPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCPS message handlersvoid CCPS::OnGOTOCRPS(){// TODO: Add your control notification handler cod e heredouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT3+m_AGT3-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/384); //l:Processing gain in dBn=m_AEBN03-l+k; //n:Receiver sensitivity in dBmdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=d-n+m_AGR3-p-q; //r:Maximum path loss in dBdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=0.0; //t:Soft handover gain in dBu=0.0; //u:Penetration loss in car in dBv=r-s+t-u; //v:Allowable path loss for cell range in dBdouble w,x,y;w=34.4; //w:Slope Ax=127.5; //x:Intercept By=pow(10,((v-x)/w)); //y:Cell range in kmCCRPS pCRPS;pCRPS.m_CRPS=y;pCRPS.DoModal();}Result of Cell Range for Packet-Switched Service .CPP File:// CRPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "CRPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CCRPS dialogCCRPS::CCRPS(CWnd* pParent /*=NULL*/): CDialog(CCRPS::IDD, pParent){//{{AFX_DATA_INIT(CCRPS)m_CRPS = 0.0;//}}AFX_DATA_INIT}void CCRPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CCRPS)DDX_Text(pDX, IDC_CRPS, m_CRPS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CCRPS, CDialog)//{{AFX_MSG_MAP(CCRPS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CCRPS message handlersCalculation of Eb/N0 for Voice Service .CPP File:// EVOICE.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "EVOICE.h"#include "ERVOICE.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CEVOICE dialogCEVOICE::CEVOICE(CWnd* pParent /*=NULL*/): CDialog(CEVOICE::IDD, pParent){//{{AFX_DATA_INIT(CEVOICE)m_AGR4 = 18.0;m_AGT4 = 0.0;m_APT4 = 21.0;m_ACELLRANGE4 = 2.0;//}}AFX_DATA_INIT}void CEVOICE::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CEVOICE)DDX_Text(pDX, IDC_AGR4, m_AGR4);DDX_Text(pDX, IDC_AGT4, m_AGT4);DDX_Text(pDX, IDC_APT4, m_APT4);DDX_Text(pDX, IDC_ACELLRANGE4, m_ACELLRANGE4);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CEVOICE, CDialog)//{{AFX_MSG_MAP(CEVOICE)ON_BN_CLICKED(IDOK, OnGOTOERVOICE)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CEVOICE message handlersvoid CEVOICE::OnGOTOERVOICE(){// TODO: Add your control notification handler cod e heredouble w,x,y;w=34.4; //w:Slope Ax=125.5; //x:Intercept By=m_ACELLRANGE4; //y:Cell range in kmdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=3.0; //t:Soft handover gain in dBu=10.0; //u:Penetration loss in car in dBv=(w*log10(y))+x; //v:Allo wable path loss for cell range in dBdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=0.0; //q:Fast fading margin in dBr=v+s-t+u; //r:Maximum path loss in dBdouble c,d;c=3 .0; //c:Body/orientation loss in dBd=m_APT4+m_AGT4-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n,z;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/12.2); //l:Processing gain in dBn=d+m_AGR4-p-q-r; //n:Receiver sensitivity in dBmz=n +l-k; //z:Eb/No ratio in dBCERVOICE pERVOICE;pERVOICE.m_ERVOICE=z;pERVOICE.DoModal();}Result of Eb/N0 for Voice Service .CPP File:// ERVOICE.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ERVOICE.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CERVOICE dialogCERVOICE::CERVOICE(CWnd* pParent /*=NULL* /): CDialog(CERVOICE::IDD, pParent){//{{AFX_DATA_INIT(CERVOICE)m_ERVOICE = 0.0;//}}AFX_DATA_INIT}void CERVOICE::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CERVOICE)DDX_Text(pDX, IDC_ERVOICE, m_ERVOICE);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CERVOICE, CDialog)//{{AFX_MSG_MAP(CERVOICE)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CERVOICE message handlersCalculation of Eb/N0 for Circuit-Switched Service .CPP File:// ECS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ECS.h"#include "ERCS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CECS dialogCECS::CECS(CWnd* pParent /*=NULL*/): CDialog(CECS::IDD, pParent){//{{AFX_DATA_INIT(CECS)m_AGR5 = 18.0;m_AGT5 = 2.0;m_APT5 = 24.0;m_ACELLRANGE5 = 1.2;//}}AFX_DATA_INIT}void CECS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CECS)DDX_Text(pDX, IDC_AGR5, m_AGR5);DDX_Text(pDX, IDC_AGT5, m_AGT5);DDX_Text(pDX, IDC_APT5, m_APT5);DDX_Text(pDX, IDC_ACELLRANGE5, m_ACELLRANGE5);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CECS, CDialog)//{{AFX_MSG_MAP(CECS)ON_BN_CLICKED(IDOK, OnGOTOERCS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CECS message handlersvoid CECS::OnGOTOERCS(){// TODO: Add your control notification handler cod e heredouble w,x,y;w=34.4; //w:Slope Ax=122.3; //x:Intercept By=m_ACELLRANGE5; //y:Cell range in kmdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=2.0; //t:Soft handover gain in dBu=16.0; //u:Penetration loss in car in dBv=(w*log10(y))+x; //v:Allo wable path loss for cell range in dBdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=v+s-t+u; //r:Maximum path loss in dBdouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT5+m_AGT5-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n,z;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/144); //l:Processing gain in dBn=d+m_AGR5-p-q-r; //n:Receiver sensitivity in dBmz=n +l-k; //z:Eb/No ratio in dBCERCS pERCS;pERCS.m_ERCS=z;pERCS.DoModal();}Result of Eb/N0 for Circuit-Switched Service .CPP File:// ERCS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ERCS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CERCS dialogCERCS::CERCS(CWnd* pParent /*=NULL* /): CDialog(CERCS::IDD, pParent){//{{AFX_DATA_INIT(CERCS)m_ERCS = 0.0;//}}AFX_DATA_INIT}void CERCS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CERCS)DDX_Text(pDX, IDC_ERCS, m_ERCS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CERCS, CDialog)//{{AFX_MSG_MAP(CERCS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CERCS message handlersCalculation of Eb/N0 for Packet-Switched Service .CPP File:// EPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "EPS.h"#include "ERPS.h"#include "math.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CEPS dialogCEPS::CEPS(CWnd* pParent /*=NULL*/): CDialog(CEPS::IDD, pParent){//{{AFX_DATA_INIT(CEPS)m_AGR6 = 18.0;m_AGT6 = 2.0;m_APT6 = 24.0;m_ACELLRANGE6 = 1.8;//}}AFX_DATA_INIT}void CEPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CEPS)DDX_Text(pDX, IDC_AGR6, m_AGR6);DDX_Text(pDX, IDC_AGT6, m_AGT6);DDX_Text(pDX, IDC_APT6, m_APT6);DDX_Text(pDX, IDC_ACELLRANGE6, m_ACELLRANGE6);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CEPS, CDialog)//{{AFX_MSG_MAP(CEPS)ON_BN_CLICKED(IDOK, OnGOTOERPS)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CEPS message handlersvoid CEPS::OnGOTOERPS(){// TODO: Add your control notification handler cod e heredouble w,x,y;w=34.4; //w:Slope Ax=127.5; //x:Intercept By=m_ACELLRANGE6; //y:Cell range in kmdouble s,t,u,v;s=10.5; //s:Log-normal fading margin in dBt=0.0; //t:Soft handover gain in dBu=0.0; //u:Penetration loss in car in dBv=(w*log10(y))+x; //v:Allowable path loss for cell rang e in dBdouble p,q,r;p=2.0; //p:Base station cable/connection loss in dBq=4.0; //q:Fast fading margin in dBr=v+s-t+u; //r:Maximum path loss in dBdouble c,d;c=0 .0; //c:Body/orientation loss in dBd=m_APT6+m_AGT6-c; //d:Equivalent isotropic radiated power in dBmdouble e,f,g,h,i,j,k,l,n,z;e=-174.0; //e:Thermal noise density in dBm/Hzf=5.0; //f:Base station receiver noise figure in dBg=e+f; //g:Receiver noise density in dBm/Hzh=g+(10*log10(3840000)); //h:Receiver noise power in dBmi=3.0; //i:Interference margin [50% loading] in dBj=10*log10((pow(10,((h+i)/10)))-(pow(10,(h/10)))); //j:Receiver interference power in dBmk=10*log10((pow(10,(h/10)))+(pow(10,(j/10)))); //k:Total effective noise andinterference in dBml=10*log10(3840/384); //l:Processing gain in dBn=d+m_AGR6-p-q-r; //n:Receiver sensitivity in dBmz=n +l-k; //z:Eb/No ratio in dBCERPS pERPS;pERPS.m_ERPS=z;pERPS.DoModal();}Result of Eb/N0 for Packet-Switched Service .CPP File:// ERPS.cpp : implementation file//#include "stdafx.h"#include "RLB.h"#include "ERPS.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CERPS dialogCERPS::CERPS(CWnd * pParent /*=NULL*/): CDialog(CERPS::IDD, pParent){//{{AFX_DATA_INIT(CERPS)m_ERPS = 0.0;//}}AFX_DATA_INIT}void CERPS::DoDataExchange(CDataExchange* pDX){CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CERPS)DDX_Text(pDX, IDC_ERPS, m_ERPS);//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CERPS, CDialog)//{{AFX_MSG_MAP(CERPS)// NOTE: the ClassWizard will add message map macros here//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CERPS message handlerspersoalanya...sy nk buat mcmane utk tgk hasil coding ni??plzzz..tolong sangat2...lecturer sy bagi utk final year projek...die srh sy tgk hasil code ni..tolong sangat2...sy bdk electronik...kurang mahirSalam..nk tnye ckit..ni gna software ape yer?lecturer x btau ke? Quote Share this post Link to post Share on other sites
kerimike 0 Report post Posted March 17, 2008 Salam..nk tnye ckit..ni gna software ape yer?lecturer x btau ke?visual c++ microsoft punyemntk tlg sgt2 ni...upah pon xpeSalam..nk tnye ckit..ni gna software ape yer?lecturer x btau ke?visual c++ microsoft punyemntk tlg sgt2 ni...upah pon xpe Quote Share this post Link to post Share on other sites