?? runrayleigh.cpp
字號:
#include <iostream.h>
#include <stdio.h>
#include <math.h>
#include <fstream.h>
#include <string.h>
#include "Complex.h"
#include "Random.h"
#include "flat_rayleigh.h"
main(int argc, char *argv[])
{
const int blocklength = 4000;
const int maxblocks = 100;
const double fD = 0.01;
char logfile[35];
if (argc == 3)
sprintf(logfile, argv[2]);
else {
sprintf(logfile, "logR%.3f.txt", fD);
}
// construct it: seed, discrete Doppler fD, pwr=1.0, and continuous
long seed = -115;
flat_rayleigh mychan(seed, fD, 1.0, false);
int i, blocknum;
Complex inp[blocklength], outp[blocklength];
for (i=0; i<blocklength; i++)
inp[i] = Complex(1.0, 0.0);
// If you want to run it on the background,
// just comment out the following three lines.
cout << "***********************************\n";
cout << "************ BEGIN ************\n";
cout << "***********************************\n";
for (blocknum = 1; blocknum<=maxblocks; blocknum++) {
mychan.pass_through(blocklength, inp, outp);
ofstream out(logfile, ios::app);
if (!out)
cout << "Sorry, I cannot write on the output file\n";
else {
for (i=0; i<blocklength; i++)
out << i << "\t" << outp[i] << endl;
}
out.close();
}
return 0;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -