윤보민

merge

No preview for this file type
No preview for this file type
1 +#include "channel.h"
2 +void Cchannel::AWGN() {
3 + std::default_random_engine generator;
4 + std::normal_distribution<double> distribution(0.0, No);
5 +
6 + int NN = Nbits / Nbitspersymbol * Nsamplespersymbol;
7 + for (int i = 0; i < NN; i++) {
8 + r[i] = s[i] + distribution(generator);
9 + }
10 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -110,7 +110,9 @@ ...@@ -110,7 +110,9 @@
110 </Link> 110 </Link>
111 </ItemDefinitionGroup> 111 </ItemDefinitionGroup>
112 <ItemGroup> 112 <ItemGroup>
113 + <ClCompile Include="channel.cpp" />
113 <ClCompile Include="constellation_main.cpp" /> 114 <ClCompile Include="constellation_main.cpp" />
115 + <ClCompile Include="evaluate.cpp" />
114 <ClCompile Include="myMatrix.cpp" /> 116 <ClCompile Include="myMatrix.cpp" />
115 <ClCompile Include="receiver.cpp" /> 117 <ClCompile Include="receiver.cpp" />
116 </ItemGroup> 118 </ItemGroup>
......
...@@ -21,7 +21,14 @@ ...@@ -21,7 +21,14 @@
21 <ClCompile Include="myMatrix.cpp"> 21 <ClCompile Include="myMatrix.cpp">
22 <Filter>소스 파일</Filter> 22 <Filter>소스 파일</Filter>
23 </ClCompile> 23 </ClCompile>
24 +
24 <ClCompile Include="receiver.cpp"> 25 <ClCompile Include="receiver.cpp">
26 +
27 + <ClCompile Include="channel.cpp">
28 + <Filter>소스 파일</Filter>
29 + </ClCompile>
30 + <ClCompile Include="evaluate.cpp">
31 +
25 <Filter>소스 파일</Filter> 32 <Filter>소스 파일</Filter>
26 </ClCompile> 33 </ClCompile>
27 </ItemGroup> 34 </ItemGroup>
...@@ -45,4 +52,4 @@ ...@@ -45,4 +52,4 @@
45 <Filter>헤더 파일</Filter> 52 <Filter>헤더 파일</Filter>
46 </ClInclude> 53 </ClInclude>
47 </ItemGroup> 54 </ItemGroup>
48 -</Project>
...\ No newline at end of file ...\ No newline at end of file
55 +</Project>
......
1 +#include "evaluate.h"
2 +void Cevaluate::evaluate() {
3 + float errors = 0;
4 + for (int i = 0; i < Nbits; i++) if (Data[i] != DecodedData[i]) errors += 1;
5 + BER = errors / Nbits;
6 +}
...\ No newline at end of file ...\ No newline at end of file