Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2019-1-software-lab-1
/
0509_team1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Heo Jin Nyeong
2019-05-09 16:50:33 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
664a6cd935737d652f79b07ea7281173b13108e9
664a6cd9
1 parent
84f4ac2f
sender.cpp complete
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
114 additions
and
0 deletions
constellation/.vs/constellation/v14/.suo
constellation/constellation.VC.db
constellation/constellation/constellation.vcxproj
constellation/constellation/constellation.vcxproj.filters
constellation/constellation/sender.cpp
constellation/.vs/constellation/v14/.suo
View file @
664a6cd
No preview for this file type
constellation/constellation.VC.db
View file @
664a6cd
No preview for this file type
constellation/constellation/constellation.vcxproj
View file @
664a6cd
...
...
@@ -112,6 +112,7 @@
<ItemGroup>
<ClCompile Include="constellation_main.cpp" />
<ClCompile Include="myMatrix.cpp" />
<ClCompile Include="sender.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="channel.h" />
...
...
constellation/constellation/constellation.vcxproj.filters
View file @
664a6cd
...
...
@@ -21,6 +21,9 @@
<ClCompile Include="myMatrix.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
<ClCompile Include="sender.cpp">
<Filter>소스 파일</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="sender.h">
...
...
constellation/constellation/sender.cpp
0 → 100644
View file @
664a6cd
#ifndef __SENDER
#define __SENDER
#define PI 3.1415926535
#include <iostream>
using
namespace
std
;
#include <cmath>
#include "variables.h"
#include "myMatrix.h"
#include "sender.h"
class
Csender
{
public
:
Csender
()
{};
char
data
[
Nbits
];
float
s
[
Nbits
/
Nbitspersymbol
*
Nsamplespersymbol
];
// trasmitted signal
void
transmitData
();
};
char
data
[
Nbits
];
float
s
[
Nbits
/
Nbitspersymbol
*
Nsamplespersymbol
];
// trasmitted signal
void
Csender
::
transmitData
()
{
float
T
;
float
f0
,
f1
;
float
A
;
float
c0
[
20
],
c1
[
20
];
float
t
[
20
];
float
data0
[
500
];
float
data1
[
500
];
for
(
int
i
=
0
;
i
<
Nbits
;
i
++
)
{
data
[
i
]
=
rand
()
%
2
;
}
T
=
1000.0
;
//ֱ? ?
f0
=
1
/
T
;
f1
=
1
/
T
;
A
=
5.0
;
for
(
int
j
=
0
;
j
<
Nbits
;
j
++
)
{
if
(
j
%
2
==
0
)
{
data0
[
j
/
2
]
=
data
[
j
];
}
else
if
(
j
%
2
==
1
)
{
data1
[
j
/
2
]
=
data
[
j
];
}
}
//showMatrix(1, 1000, data0);
//showMatrix(1, 1000, data1);
float
data00
[
Nbits
/
2
];
float
data11
[
Nbits
/
2
];
for
(
int
k
=
0
;
k
<
Nbits
/
2
;
k
++
)
{
if
(
data0
[
k
]
==
0
)
{
data00
[
k
]
=
A
;
}
else
if
(
data0
[
k
]
==
1
)
{
data00
[
k
]
=
-
A
;
}
if
(
data1
[
k
]
==
0
)
{
data11
[
k
]
=
A
;
}
else
if
(
data1
[
k
]
==
1
)
{
data11
[
k
]
=
-
A
;
}
}
//showMatrix(1, 1000, data00);
//showMatrix(1, 1000, data11);
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
t
[
i
]
=
T
/
20.0
;
}
for
(
int
i
=
0
;
i
<
20
;
i
++
)
{
c0
[
i
]
=
sqrt
(
2
/
T
)
*
cos
(
2
*
PI
*
f0
*
t
[
i
]);
c1
[
i
]
=
sqrt
(
2
/
T
)
*
sin
(
2
*
PI
*
f1
*
t
[
i
]);
}
float
s0
[
Nbits
/
Nbitspersymbol
*
Nsamplespersymbol
];
float
s1
[
Nbits
/
Nbitspersymbol
*
Nsamplespersymbol
];
matrixmult
(
500
,
1
,
20
,
data00
,
c0
,
s0
);
matrixmult
(
500
,
1
,
20
,
data11
,
c1
,
s1
);
matrixadd
(
500
,
20
,
s0
,
s1
,
s
);
showMatrix
(
1
,
10000
,
s
);
}
#endif
\ No newline at end of file
Please
register
or
login
to post a comment