임준영

change channel.cpp

1 +#include"channel.h"
2 +#include<cstdlib>
3 +using namespace std;
4 +
5 +
6 +void Cchannel::AWGN() {
7 + ofstream myout;
8 + myout.open("channel.txt");
9 +
10 + default_random_engine generator;
11 + normal_distribution<double> dist(0.0, No);
12 +
13 +
14 + for (int k = 0; k < Nbits / Nbitspersymbol * Nsamplespersymbol; k++)
15 + n[k] = dist(generator);
16 +
17 + matrixadd(1, Nbits / Nbitspersymbol * Nsamplespersymbol, s, n, r);
18 +
19 + for (int i = 0; i < Nbits / Nbitspersymbol * Nsamplespersymbol; i++)
20 + {
21 +
22 + myout << r[i] << endl;
23 + }
24 +
25 + myout.close();
26 +}
...\ No newline at end of file ...\ No newline at end of file