배승주

last change of Channel & Evalute part

No preview for this file type
No preview for this file type
#include "channel.h"
void Cchannel::AWGN() {
std::default_random_engine generator;
std::normal_distribution<double> distribution(0.0, No);
int NN = Nbits / Nbitspersymbol * Nsamplespersymbol;
for (int i = 0; i < NN; i++) {
r[i] = s[i] + distribution(generator);
}
}
\ No newline at end of file
......@@ -110,7 +110,9 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="channel.cpp" />
<ClCompile Include="constellation_main.cpp" />
<ClCompile Include="evaluate.cpp" />
<ClCompile Include="myMatrix.cpp" />
</ItemGroup>
<ItemGroup>
......
......@@ -21,6 +21,12 @@
<ClCompile Include="myMatrix.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="channel.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="evaluate.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="sender.h">
......
#include "evaluate.h"
void Cevaluate::evaluate() {
float errors = 0;
for (int i = 0; i < Nbits; i++) if (Data[i] != DecodedData[i]) errors += 1;
BER = errors / Nbits;
}
\ No newline at end of file