mod_demod.cpp

来自「三种模拟调制与解调的算法」· C++ 代码 · 共 92 行

CPP
92
字号
// mod_demod.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "mod_demod.h"
#include "head.h"
#include "AMGen.h"
#include "FMGen.h"
#include "SSBGen.h"
#include "DemodClass.h"
#include "AWGNClass.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		//cerr << _T("Fatal Error: MFC initialization failed") << endl;
		nRetCode = 1;
	}
	else
	{
		// TODO: code your application's behavior here.
		//CString strHello;
		//strHello.LoadString(IDS_HELLO);
		//cout << (LPCTSTR)strHello << endl;
		AMGen   AM_Mod("AM_Mod","Analog",400e+3,40e+6,32,
					  "d:\\AFS.dat",
					  "d:\\AM_Mod.dat",
					  0.1,8e+6,0,1.0);

		AM_Mod.run();
        
		DemodClass AM_Demod("AM_Demod","Analog",
							400e+3,40e+6,
							32,"d:\\AM_mod.dat",
							"d:\\AM_Out.dat",1,
							0.1,8e+6,
							0,1.0);
		AM_Demod.run();

		FMGen	FMMod("FM_Mod","Analog",5e+6,40e+6,32,
					  "d:\\AFS.dat",
					  "d:\\FM_Mod.dat",
					  1.0,8e+6,0,300e+3);
		//300e+3是调制指数
        FMMod.run();
        
        /*DemodClass _FMDemod("FM_Demod","Analog",
							500e+3,40e+6,
							32,"d:\\FM_Mod.dat",
							"d:\\FM_Out.dat",2,
							1.0,8e+6,
							0,300e+3);
		_FMDemod.run();*/

		SSBGen SSBMod("SSB_Mod","Analog",400e+3,40e+6,32,
					  "d:\\AFS.dat",
					  "d:\\SSB_Mod.dat",
					  1.0,8e+6,0,0);
        SSBMod.run();	

		/*DemodClass _SSBDemod("SSB_Demod","Analog",
							400e+3,40e+6,
							32,"d:\\SSB_Mod.dat",
							"d:\\SSB_Out.dat",3,
							1.0,8e+6,
							0,0);
		_SSBDemod.run();*/

	}

	return nRetCode;
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?