홍주원

최종파일

Showing 69 changed files with 848 additions and 0 deletions

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "constellation", "constellation\constellation.vcxproj", "{6FF25C27-45BF-4502-A1F8-0EFB069E1515}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Debug|x64.ActiveCfg = Debug|x64
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Debug|x64.Build.0 = Debug|x64
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Debug|x86.ActiveCfg = Debug|Win32
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Debug|x86.Build.0 = Debug|Win32
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Release|x64.ActiveCfg = Release|x64
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Release|x64.Build.0 = Release|x64
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Release|x86.ActiveCfg = Release|Win32
{6FF25C27-45BF-4502-A1F8-0EFB069E1515}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
 sender.cpp
c:\users\ghdwn\documents\hong joowon file\경희대\2019-1학기\소프트웨어 랩\과제 8\새 폴더\constellation\constellation\constellation\sender.cpp(42): warning C4244: '=': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
c:\users\ghdwn\documents\hong joowon file\경희대\2019-1학기\소프트웨어 랩\과제 8\새 폴더\constellation\constellation\constellation\sender.cpp(43): warning C4244: '=': 'double'에서 'float'(으)로 변환하면서 데이터가 손실될 수 있습니다.
constellation.vcxproj -> C:\Users\ghdwn\Documents\Hong joowon file\경희대\2019-1학기\소프트웨어 랩\과제 8\새 폴더\constellation\constellation\Debug\constellation.exe
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.16299.0
Debug|Win32|C:\Users\ghdwn\Documents\Hong joowon file\경희대\2019-1학기\소프트웨어 랩\과제 8\새 폴더\constellation\constellation\|
#include"channel.h"
#include<cstdlib>
using namespace std;
void Cchannel::AWGN() {
ofstream myout;
myout.open("channel.txt");
//N = 8;
default_random_engine generator;
normal_distribution<double> dist(0.0, N);
for (int k = 0; k < Nbits / Nbitspersymbol * Nsamplespersymbol; k++)
n[k] = dist(generator);
matrixadd(1, Nbits / Nbitspersymbol * Nsamplespersymbol, s, n, r);
for (int i = 0; i < Nbits / Nbitspersymbol * Nsamplespersymbol; i++)
{
myout << r[i] << endl;
}
myout.close();
}
\ No newline at end of file
#ifndef __CHANNEL
#define __CHANNEL
#include <cmath>
#include <random>
#include "variables.h"
class Cchannel {
public:
Cchannel() {};
float N=8;
float *s; // trasmitted signal
float r[Nbits / Nbitspersymbol*Nsamplespersymbol]; // corrupted signal
float n[Nbits / Nbitspersymbol * Nsamplespersymbol];
void AWGN();
};
#endif
\ No newline at end of file
This diff is collapsed. Click to expand it.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{6FF25C27-45BF-4502-A1F8-0EFB069E1515}</ProjectGuid>
<RootNamespace>constellation</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="channel.cpp" />
<ClCompile Include="constellation_main.cpp" />
<ClCompile Include="evaluate.cpp" />
<ClCompile Include="myMatrix.cpp" />
<ClCompile Include="receiver.cpp" />
<ClCompile Include="sender.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="channel.h" />
<ClInclude Include="evaluate.h" />
<ClInclude Include="myMatrix.h" />
<ClInclude Include="receiver.h" />
<ClInclude Include="sender2.h" />
<ClInclude Include="variables.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="소스 파일">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="헤더 파일">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="리소스 파일">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="constellation_main.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="myMatrix.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="sender.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="channel.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="receiver.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="evaluate.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="variables.h">
<Filter>헤더 파일</Filter>
</ClInclude>
<ClInclude Include="channel.h">
<Filter>헤더 파일</Filter>
</ClInclude>
<ClInclude Include="receiver.h">
<Filter>헤더 파일</Filter>
</ClInclude>
<ClInclude Include="evaluate.h">
<Filter>헤더 파일</Filter>
</ClInclude>
<ClInclude Include="myMatrix.h">
<Filter>헤더 파일</Filter>
</ClInclude>
<ClInclude Include="sender2.h">
<Filter>헤더 파일</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
\ No newline at end of file
#include <iostream>
using namespace std;
#include "sender2.h"
#include "channel.h"
#include "receiver.h"
#include "evaluate.h"
void main() {
Csender mySender;
Cchannel myChannel;
Creceiver myReceiver;
Cevaluate myEvaluator;
ofstream myout;
//myout.open("testSNR5.txt");
//for (myChannel.N = 12.; 0<myChannel.N; myChannel.N = myChannel.N-0.1)
//{
cout << myChannel.N << endl;
mySender.transmitData(); // generate data[ ], s[ ]
myChannel.s = mySender.s;
myChannel.AWGN(); // calculate r[ ]
myReceiver.r = myChannel.r;
myReceiver.c0 = mySender.c0;
myReceiver.c1 = mySender.c1;
myReceiver.demodulate(); // calculate constellation[ ], DecodedData[ ];
myEvaluator.At = mySender.At;
myEvaluator.Bt = mySender.Bt;
myEvaluator.At_ = myReceiver.At_;
myEvaluator.Bt_ = myReceiver.Bt_;
myEvaluator.A = mySender.A;
//myEvaluator.Data = mySender.data;
myEvaluator.N = myChannel.N;
//myEvaluator.DecodedData = myReceiver.DecodedData;
myEvaluator.evaluate(); // compare the original and the decoded
//myout << myEvaluator.SNR <<" "<< myEvaluator.errorrate<< " " << myEvaluator.SNR2 <<" "<< myEvaluator.errorrate << endl;
//}
myout.close();
getchar();
}
\ No newline at end of file
#include <cstdlib>
#include"evaluate.h"
using namespace std;
void Cevaluate::evaluate()
{
ofstream myout;
//myout.open("testsnr.txt");
float sum=0,sum2=0;
//cout << "At\t" << "A`t\t" << "|At-A`t|" << "\t\t" << "Bt\t" << "B`t\t" << "|Bt-B`t|" << "\n\n";
for (int i = 0; i < 500; i++)
{
sum += abs(At[i] - At_[i]) / abs(At[i]);
sum2 += abs(Bt[i] - Bt_[i]) / abs(Bt[i]);
//myout << At[i] << " " << Bt[i] << " " << At_[i] << " " << Bt_[i] << " " << abs(At[i] - At_[i])/At[i] << " " << abs(Bt[i] - Bt_[i])/Bt[i] << endl;
}
errorrate = ((sum / 500) + (sum2 / 500)) / 2;
E=A*A/4;
SNR = 10 * log10(E / N);
SNR2 = E / N;
cout << "에러율의 평균을 구해보자!" << endl;
//for (float a = 0; 0.1 < No ; a += 0.1)
cout << sum / 500 << "\t" << sum2 / 500 << "\t" << errorrate << "\t" << SNR <<"\t"<< SNR2 << endl;
//myout << ((sum / 500) + (sum2 / 500)) / 2 << " " << SNR2 << " " << SNR << endl;
//myout.close();
}
\ No newline at end of file
#ifndef __EVALUATE
#define __EVALUATE
#include <cmath>
#include "variables.h"
class Cevaluate {
public:
Cevaluate() {};
char *DecodedData; // from the receiver
char *Data; // from the sender
float A;
float *At, *Bt, *At_, *Bt_;
float N;
float E ;
float SNR ;
float SNR2;
float errorrate;
void evaluate();
};
#endif
This diff is collapsed. Click to expand it.
#include <iostream>
#include "myMatrix.h"
using namespace std;
void scalarmult(int n, int m, float a, float *b, float *c){
int N = n*m;
for(int i=0;i<N;i++) c[i] = a*b[i];
}
void matrixadd(int n, int m, float *a, float *b, float *c){
int N = n*m;
for (int i = 0; i<N; i++) c[i] = a[i]+b[i];
}
// (N by K) C X (K by M) D = (N by M) E
void matrixmult(int N, int K, int M, float*C, float*D, float*E) {
int n, k, m;
for (n = 0; n < N; n++)
for (m = 0; m < M; m++) {
float sum = 0;
for (k = 0; k < K; k++) sum += C[n*K + k] * D[k*M + m];
E[n*M + m] = sum;
}
}
// Solve equation Av = b
// return 0 when solution exists,
// -1 when solution does not exist.
// A ==> indentity matrix
// b ==> v (the solution)
int GaussElimination(int N, float *a, float *b)
{
float temp, aii, aji;
int i, j, k;
//showequation(N, a, b);
for (i = 0; i<N; i++) {
aii = a[i*N + i];
if (aii == 0.0) return -1; // 부정/불능 여기 더 할 일 있음
// i-th row를 aii로 모두 나누기
for (k = i; k<N; k++) a[i*N + k] /= aii;
b[i] /= aii;
// 다른 row들의 i번째 항을 모두 0으로 만들기
for (j = 0; j<N; j++) {
if (i != j) {
aji = a[j*N + i];
for (k = i; k<N; k++) a[j*N + k] -= a[i*N + k] * aji;
b[j] -= b[i] * aji;
}// if(i!=j)
} // other rows
//showequation(N, a, b);
}
return 0;
}
void showMatrix(int n, int m, float* F) {
int i, j;
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) cout << F[i*m + j] << "\t";
cout << "\n";
}
}
void showMatrix(char*name, int n, int m, float* F) {
cout << name << endl;
showMatrix(n, m, F);
}
// show N X N matrix
void showequation(int N, float *a, float *b)
{
int i, j;
for (i = 0; i<N; i++)
{
for (j = 0; j<N; j++) cout << a[i*N + j] << "\t";
cout << b[i];
}
cout << "\n";
}
\ No newline at end of file
void scalarmult(int n, int m, float a, float *b, float *c);
void matrixadd(int n, int m, float *a, float *b, float *c);
void matrixmult(int N, int K, int M, float*C, float*D, float*E);
int GaussElimination(int, float*, float*);
void showMatrix(int n, int m, float* F);
void showMatrix(char*name, int n, int m, float* F);
void showequation(int N, float *a, float *b);
\ No newline at end of file
#include"receiver.h"
#include<cstdlib>
using namespace std;
void Creceiver::demodulate()
{
int num = 0;
for (int i = 0; i < 500; i++) {
for (int k = 0; k < 20; k++) {
Temp[k]=r[i * 20 + k] ;
num++;
}
matrixmult(1, 20, 1, Temp, c0, receiver);
At_[i] = receiver[0];
matrixmult(1, 20, 1, Temp, c1, receiver);
Bt_[i] = receiver[0] ;
}
}
\ No newline at end of file
#ifndef __RECEIVER
#define __RECEIVER
#include <cmath>
#include "variables.h"
class Creceiver {
public:
Creceiver() {};
float *r; // corrupted signal = received signal
float *c0;
float *c1;
float At_[500];
float Bt_[500];
float dum1[Nbits / Nbitspersymbol];
float receiver[1];
float Temp[20];
float constellation[Nbits];
char DecodedData[Nbits];
void demodulate();
};
#endif
#include"sender2.h"
#include<cstdlib>
using namespace std;
void Csender::transmitData() {
srand((unsigned)time(NULL));
for (int i = 0; i < Nbits; i++)
{
int random = rand() % 2;
data[i] = random;
}
for (int k = 0; k < Nbits; k = k + 2)
{
if (data[k] == 0 && data[k + 1] == 0) {
At[k / 2] = A * 1;
Bt[k / 2] = A * 1;
}
else if (data[k] == 0 && data[k + 1] == 1) {
At[k / 2] = A * 1;
Bt[k / 2] = A * -1;
}
else if (data[k] == 1 && data[k + 1] == 0) {
At[k / 2] = A * -1;
Bt[k / 2] = A * 1;
}
else if (data[k] == 1 && data[k + 1] == 1) {
At[k / 2] = A * -1;
Bt[k / 2] = A * -1;
}
}
double t;
int k = 0;
for (t = 0; t < T; t += dt)
{
c0[k] = sqrt(2. / T)*cos(2 * PI*t / T);
c1[k] = sqrt(2. / T)*sin(2 * PI*t / T);
k++;
}
/*
for (int i = 0; i < 20; i++) {
cout <<"|" <<c0[i] << "\t" <<"|"<< "\t" << "|" << c1[i] << "\t" << "|"<<endl;
}
cout << "\n"<<"matrix c0xc1" << "\n";
matrixmult(1, 20, 1, c0, c1, sender);
cout << sender[0] << endl;
cout << "\n" << "matrix c0xc0" << "\n";
matrixmult(1, 20, 1, c0, c0, sender);
cout << sender[0] << endl;
cout << "\n" << "matrix c1xc1" << "\n";
matrixmult(1, 20, 1, c1, c1, sender);
cout << sender[0] << endl;
*/
for (int i = 0; i < Nbits / Nbitspersymbol; i++) {
for (int k = 0; k < Nsamplespersymbol; k++)
{
s[i * Nsamplespersymbol + k] = ((At[i] * c0[k]) + (Bt[i] * c1[k]));
}
}
for (int i = 0; i < 500; i++) {
for (int k = 0; k < 20; k++) {
Temp[k] = s[i * 20 + k];
}
matrixmult(1, 20, 1, Temp, c0, sender);
}
}
\ No newline at end of file
#pragma once
#ifndef __SENDER2
#define __SENDER2
#include <cmath>
#include "variables.h"
class Csender {
public:
Csender() {};
int data[Nbits];
float s[Nbits / Nbitspersymbol * Nsamplespersymbol]; // trasmitted signal
void transmitData();
float At[Nbits / Nbitspersymbol], Bt[Nbits / Nbitspersymbol];
float c0[Nsamplespersymbol],c1[Nsamplespersymbol],sender[1];
float A = 10.;
float Temp[20];
double T=20./1.,dt=1./1.;
};
#endif
\ No newline at end of file
0.63702 4.9485 3.125
0.629057 5.00313 3.16456
0.621095 5.05845 3.20513
0.613132 5.11449 3.24675
0.605169 5.17126 3.28947
0.597206 5.22879 3.33333
0.589244 5.28708 3.37838
0.581281 5.34617 3.42466
0.573318 5.40607 3.47222
0.565356 5.46682 3.52113
0.557393 5.52842 3.57143
0.54943 5.59091 3.62319
0.541467 5.65431 3.67647
0.533504 5.71865 3.73134
0.525542 5.78396 3.78788
0.517579 5.85027 3.84615
0.509617 5.9176 3.90625
0.501654 5.98599 3.96825
0.493691 6.05548 4.03226
0.485728 6.1261 4.09836
0.477766 6.19789 4.16667
0.469803 6.27088 4.23729
0.46184 6.34512 4.31034
0.453877 6.42065 4.38596
0.445914 6.49752 4.46428
0.437952 6.57577 4.54545
0.429989 6.65546 4.62963
0.422026 6.73664 4.71698
0.414063 6.81936 4.80769
0.406101 6.9037 4.90196
0.398138 6.9897 5
0.390175 7.07744 5.10204
0.382213 7.16699 5.20833
0.37425 7.25842 5.31915
0.366287 7.35182 5.43478
0.358324 7.44727 5.55555
0.350361 7.54487 5.68181
0.342399 7.64471 5.81395
0.334436 7.7469 5.95238
0.326473 7.85156 6.09756
0.31851 7.9588 6.24999
0.310548 8.06875 6.41025
0.302585 8.18156 6.57894
0.294622 8.29738 6.75675
0.286659 8.41637 6.94444
0.278697 8.53871 7.14285
0.270734 8.66461 7.35293
0.262771 8.79425 7.57575
0.254809 8.92789 7.81249
0.246846 9.06578 8.0645
0.238883 9.20818 8.33332
0.23092 9.35541 8.62068
0.222958 9.50781 8.92856
0.214995 9.66575 9.25924
0.207032 9.82966 9.61537
0.199069 9.99999 9.99998
0.191107 10.1773 10.4166
0.183144 10.3621 10.8695
0.175181 10.5552 11.3636
0.167218 10.7572 11.9047
0.159256 10.9691 12.5
0.151293 11.1919 13.1579
0.14333 11.4267 13.8888
0.135367 11.6749 14.7058
0.127405 11.9382 15.6249
0.119442 12.2185 16.6666
0.111479 12.5181 17.8571
0.103516 12.8399 19.2307
0.0955535 13.1876 20.8332
0.0875907 13.5655 22.7272
0.079628 13.9794 24.9999
0.0716652 14.4369 27.7776
0.0637025 14.9485 31.2498
0.0557397 15.5284 35.714
0.047777 16.1978 41.6663
0.0398142 16.9897 49.9995
0.0318514 17.9587 62.4992
0.0238887 19.2081 83.3318
0.0159259 20.969 124.997
0.00796318 23.9792 249.987
This diff is collapsed. Click to expand it.
0.955531 5.22879 3.33333
0.931642 5.33874 3.4188
0.907754 5.45155 3.50877
0.883866 5.56737 3.6036
0.859977 5.68636 3.7037
0.836089 5.80871 3.80952
0.812201 5.9346 3.92157
0.788313 6.06425 4.0404
0.764424 6.19789 4.16667
0.740536 6.33577 4.30108
0.716648 6.47818 4.44445
0.692759 6.62541 4.5977
0.668871 6.77781 4.76191
0.644983 6.93575 4.93827
0.621095 7.09966 5.12821
0.597206 7.26999 5.33334
0.573318 7.44728 5.55556
0.54943 7.63211 5.7971
0.525542 7.82516 6.06061
0.501653 8.0272 6.34921
0.477765 8.23909 6.66667
0.453877 8.46185 7.01755
0.429988 8.69667 7.40741
0.4061 8.9449 7.84314
0.382212 9.20819 8.33334
0.358324 9.48848 8.8889
0.334435 9.78811 9.52382
0.310547 10.11 10.2564
0.286659 10.4576 11.1111
0.262771 10.8355 12.1212
0.238882 11.2494 13.3334
0.214994 11.707 14.8148
0.191106 12.2185 16.6667
0.167217 12.7984 19.0477
0.143329 13.4679 22.2223
0.119441 14.2597 26.6667
0.0955527 15.2288 33.3335
0.0716644 16.4782 44.4447
0.0477762 18.2391 66.6672
0.0238879 21.2495 133.335
3.18759 0.955531 2.08333 0.955531
3.22393 0.947567 2.10084 0.947567
3.26058 0.939605 2.11864 0.939605
3.29754 0.931642 2.13675 0.931642
3.33482 0.923679 2.15517 0.923679
3.37242 0.915716 2.17391 0.915716
3.41035 0.907754 2.19298 0.907754
3.44862 0.899791 2.21239 0.899791
3.48722 0.891828 2.23214 0.891828
3.52617 0.883865 2.25225 0.883865
3.56547 0.875903 2.27273 0.875903
3.60514 0.867939 2.29358 0.867939
3.64516 0.859977 2.31482 0.859977
3.68556 0.852014 2.33645 0.852014
3.72634 0.844051 2.35849 0.844051
3.76751 0.836089 2.38095 0.836089
3.80907 0.828126 2.40385 0.828126
3.85103 0.820163 2.42719 0.820163
3.8934 0.8122 2.45098 0.8122
3.93619 0.804237 2.47525 0.804237
3.9794 0.796275 2.5 0.796275
4.02305 0.788312 2.52525 0.788312
4.06714 0.780349 2.55102 0.780349
4.11169 0.772386 2.57732 0.772386
4.15669 0.764424 2.60417 0.764424
4.20217 0.756461 2.63158 0.756461
4.24813 0.748498 2.65958 0.748498
4.29458 0.740535 2.68817 0.740535
4.34153 0.732572 2.71739 0.732572
4.38899 0.72461 2.74726 0.72461
4.43698 0.716647 2.77778 0.716647
4.48551 0.708684 2.80899 0.708684
4.53458 0.700721 2.84091 0.700721
4.58421 0.692759 2.87357 0.692759
4.63442 0.684796 2.90698 0.684796
4.68522 0.676833 2.94118 0.676833
4.73661 0.66887 2.9762 0.66887
4.78863 0.660907 3.01205 0.660907
4.84127 0.652945 3.04879 0.652945
4.89456 0.644982 3.08643 0.644982
4.94851 0.637019 3.12501 0.637019
5.00314 0.629056 3.16456 0.629056
5.05846 0.621094 3.20513 0.621094
5.1145 0.613131 3.24676 0.613131
5.17127 0.605168 3.28948 0.605168
5.2288 0.597205 3.33334 0.597205
5.28709 0.589243 3.37838 0.589243
5.34618 0.58128 3.42466 0.58128
5.40608 0.573317 3.47223 0.573317
5.46683 0.565355 3.52113 0.565355
5.52843 0.557392 3.57144 0.557392
5.59092 0.549429 3.6232 0.549429
5.65432 0.541466 3.67648 0.541466
5.71866 0.533503 3.73135 0.533503
5.78397 0.525541 3.78789 0.525541
5.85028 0.517578 3.84616 0.517578
5.91761 0.509615 3.90626 0.509615
5.986 0.501652 3.96826 0.501652
6.05549 0.49369 4.03227 0.49369
6.12611 0.485727 4.09837 0.485727
6.1979 0.477764 4.16668 0.477764
6.27089 0.469802 4.2373 0.469802
6.34513 0.461839 4.31035 0.461839
6.42066 0.453876 4.38597 0.453876
6.49753 0.445913 4.4643 0.445913
6.57578 0.43795 4.54546 0.43795
6.65547 0.429987 4.62964 0.429987
6.73665 0.422025 4.71699 0.422025
6.81938 0.414062 4.8077 0.414062
6.90371 0.406099 4.90197 0.406099
6.98971 0.398137 5.00001 0.398137
7.07745 0.390174 5.10205 0.390174
7.167 0.382211 5.20835 0.382211
7.25843 0.374248 5.31916 0.374248
7.35183 0.366286 5.4348 0.366286
7.44729 0.358323 5.55557 0.358323
7.54488 0.35036 5.68183 0.35036
7.64473 0.342398 5.81397 0.342398
7.74692 0.334435 5.9524 0.334435
7.85157 0.326472 6.09758 0.326472
7.95881 0.318509 6.25002 0.318509
8.06877 0.310546 6.41027 0.310546
8.18158 0.302584 6.57897 0.302584
8.2974 0.294621 6.75678 0.294621
8.41639 0.286658 6.94446 0.286658
8.53873 0.278696 7.14288 0.278696
8.66462 0.270733 7.35296 0.270733
8.79427 0.26277 7.57578 0.26277
8.92791 0.254807 7.81252 0.254807
9.0658 0.246845 8.06454 0.246845
9.2082 0.238882 8.33336 0.238882
9.35543 0.230919 8.62072 0.230919
9.50784 0.222956 8.9286 0.222956
9.66578 0.214993 9.25929 0.214993
9.82968 0.207031 9.61542 0.207031
10 0.199068 10 0.199068
10.1773 0.191105 10.4167 0.191105
10.3621 0.183143 10.8696 0.183143
10.5552 0.17518 11.3637 0.17518
10.7572 0.167217 11.9048 0.167217
10.9691 0.159254 12.5001 0.159254
11.1919 0.151292 13.158 0.151292
11.4267 0.143329 13.889 0.143329
11.6749 0.135366 14.706 0.135366
11.9382 0.127403 15.6251 0.127403
12.2185 0.119441 16.6668 0.119441
12.5181 0.111478 17.8573 0.111478
12.84 0.103515 19.2309 0.103515
13.1876 0.0955523 20.8335 0.0955523
13.5655 0.0875895 22.7275 0.0875895
13.9794 0.0796268 25.0002 0.0796268
14.437 0.0716641 27.7781 0.0716641
14.9486 0.0637013 31.2504 0.0637013
15.5285 0.0557385 35.7148 0.0557385
16.198 0.0477758 41.6673 0.0477758
16.9898 0.039813 50.0009 0.039813
17.9589 0.0318502 62.5015 0.0318502
19.2083 0.0238875 83.336 0.0238875
20.9693 0.0159247 125.006 0.0159247
23.9798 0.00796198 250.024 0.00796198
#ifndef __VARIABLES
#define __VARIABLES
#define Nbits 1000 // number of transmitted bits
#define Nsamplespersymbol 20
#define Nbitspersymbol 2 // QPSK
#define Eb 40 // fixed ;
#define No 4 // at SNR = 20dB, variable
#define PI 3.141592
//#define A 5;
#include"myMatrix.h"
#include<fstream>
#include<iterator>
#include<random>
#include <iostream>
#include<cstdlib>
#include<ctime>
#include<time.h>
#include<stdlib.h>
#include<math.h>
#endif