이준영

channel revised

......@@ -6,9 +6,24 @@
#include "variables.h"
class Cchannel {
public:
Cchannel() {};
Cchannel();
float *s; // trasmitted signal
float r[Nbits / Nbitspersymbol*Nsamplespersymbol]; // corrupted signal
float r[Nbits]; // corrupted signal
float noise[Nbits];
void AWGN();
};
Cchannel::Cchannel()
{
default_random_engine generator;
normal_distribution<double> myGauss(0, No / 2);
for (int i = 0; i < Nbits; i++)
noise[i] = myGauss(generator);
}
void Cchannel::AWGN()
{
for (int i = 0; i < Nbits; i++)
r[i] = s[i] + noise[i];
}
#endif
\ No newline at end of file
......