김보민

change channel

No preview for this file type
#include <iostream>
#include "channel.h"
#include "variables.h"
#include <random>
#include <ctime>
using namespace std;
Cchannel::Cchannel()
{
}
void Cchannel::AWGN()
{
srand((unsigned int)time(NULL));
for (int i = 0; i < 10000; i++)
{
default_random_engine generator(rand());
normal_distribution<double> myGauss(0, (float)No / 2);
number = myGauss(generator);
r[i] = s[i] + number;
}
}
\ No newline at end of file
......@@ -10,5 +10,6 @@ public:
float *s; // trasmitted signal
float r[Nbits / Nbitspersymbol*Nsamplespersymbol]; // corrupted signal
void AWGN();
double number;
};
#endif
\ No newline at end of file
......
......@@ -21,32 +21,32 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{6FF25C27-45BF-4502-A1F8-0EFB069E1515}</ProjectGuid>
<RootNamespace>constellation</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.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>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</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>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
......@@ -115,6 +115,7 @@
<ClCompile Include="sender.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="channel.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="channel.h" />
......
......@@ -24,6 +24,9 @@
<ClCompile Include="sender.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="channel.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="sender.h">
......