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
백승재
2019-05-09 16:56:36 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7acce18d9e226ea5cd9702d266ed32ef2acf52c1
7acce18d
1 parent
84f4ac2f
receiver.h
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
constellation/constellation/receiver.h
constellation/constellation/receiver.h
View file @
7acce18
...
...
@@ -11,4 +11,49 @@ public:
char
DecodedData
[
Nbits
];
void
demodulate
();
};
void
Creceiver
::
demodulate
()
{
for
(
int
i
=
0
;
i
<
Nbits
;
i
++
)
{
constellation
[
i
]
=
r
[
i
]
/
Eb
;
}
for
(
int
i
=
0
;
i
<
Nbits
;
i
+=
2
)
{
if
(
constellation
[
i
]
>
0
&&
constellation
[
i
+
1
]
>
0
)
{
DecodedData
[
i
]
=
1
;
DecodedData
[
i
+
1
]
=
1
;
}
else
if
(
constellation
[
i
]
<
0
&&
constellation
[
i
+
1
]
>
0
)
{
DecodedData
[
i
]
=
0
;
DecodedData
[
i
+
1
]
=
1
;
}
else
if
(
constellation
[
i
]
<
0
&&
constellation
[
i
+
1
]
<
0
)
{
DecodedData
[
i
]
=
0
;
DecodedData
[
i
+
1
]
=
0
;
}
else
if
(
constellation
[
i
]
>
0
&&
constellation
[
i
+
1
]
<
0
)
{
DecodedData
[
i
]
=
1
;
DecodedData
[
i
+
1
]
=
0
;
}
}
}
#endif
#ifndef __RECEIVER
#define __RECEIVER
#include <cmath>
#include "variables.h"
class
Creceiver
{
public
:
Creceiver
()
{};
float
*
r
;
// corrupted signal = received signal
float
constellation
[
Nbits
];
char
DecodedData
[
Nbits
];
void
demodulate
();
};
#endif
...
...
Please
register
or
login
to post a comment