Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2019-1-software-lab-1
/
0509_team4
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
윤보민
2019-05-12 21:24:02 +0900
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
594ff53bc3d4c50393af14543326f1ea5d7c1656
594ff53b
2 parents
9599005e
a0671514
Merge remote-tracking branch 'origin/eon'
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
97 additions
and
4 deletions
constellation/constellation/sender.h
constellation/constellation/sender.h
View file @
594ff53
...
...
@@ -2,11 +2,104 @@
#define __SENDER
#include <cmath>
#include "variables.h"
class
Csender
{
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <fstream>
#define PI 3.141592
using
namespace
std
;
class
Csender
{
private
:
public
:
Csender
()
{};
char
data
[
Nbits
];
float
c0
;
float
c1
;
float
T
=
20
;
float
t
=
0
;
float
A
=
100
;
float
b0
[
500
];
float
b1
[
500
];
int
sum
=
0
;
float
data
[
Nbits
];
// 1000°³
Csender
()
{};
float
s
[
Nbits
/
Nbitspersymbol
*
Nsamplespersymbol
];
// trasmitted signal
void
transmitData
();
void
transmitData
()
{
ofstream
out
(
"senderoutput.txt"
);
srand
((
unsigned
int
)
time
(
NULL
));
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
data
[
i
]
=
rand
()
%
2
;
out
<<
data
[
i
]
<<
endl
;
}
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
if
(
data
[
i
]
==
0
)
{
data
[
i
]
=
1
;
}
else
if
(
data
[
i
]
==
1
)
{
data
[
i
]
=
-
1
;
}
}
for
(
int
i
=
0
;
i
<
500
;
i
++
)
{
b0
[
i
]
=
data
[
2
*
i
];
b1
[
i
]
=
data
[(
2
*
i
)
+
1
];
}
c0
=
sqrt
(
2
/
T
)
*
cos
(
2
*
PI
/
T
*
t
);
c1
=
sqrt
(
2
/
T
)
*
sin
(
2
*
PI
/
T
*
t
);
sum
=
0
;
for
(
int
i
=
0
;
i
<
500
;
i
++
)
{
for
(
t
=
0
;
t
<
20
;
t
++
)
{
s
[
sum
]
=
A
*
((
b0
[
i
]
*
sqrt
(
2
/
T
)
*
cos
(
2
*
PI
/
T
*
t
))
+
b1
[
i
]
*
sqrt
(
2
/
T
)
*
sin
(
2
*
PI
/
T
*
t
));
sum
++
;
}
}
}
//1½Éº¼À» 20°³·Î ÂÉ°µ´Ù.
};
#endif
...
...
Please
register
or
login
to post a comment