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 12:51:24 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9227bac509f8d7f9e1e8061d78d756a7078aec65
9227bac5
1 parent
e4867937
changed receiver part
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
constellation/constellation/receiver.cpp
constellation/constellation/receiver.h
constellation/constellation/receiver.cpp
0 → 100644
View file @
9227bac
#include "receiver.h"
Creceiver
::
Creceiver
()
{}
void
Creceiver
::
demodulate
()
{
T
=
Nsamplespersymbol
;
float
c0
[
Nsamplespersymbol
],
c1
[
Nsamplespersymbol
];
for
(
int
i
=
1
;
i
<=
Nsamplespersymbol
;
i
++
)
{
c0
[
i
-
1
]
=
sqrt
(
2
/
T
)
*
cos
(
2
*
PI
/
T
*
i
);
c1
[
i
-
1
]
=
sqrt
(
2
/
T
)
*
sin
(
2
*
PI
/
T
*
i
);
}
float
temp0
[
1
],
temp1
[
1
];
for
(
int
i
=
0
;
i
<
Nbits
/
2
;
i
++
)
{
matrixmult
(
1
,
Nsamplespersymbol
,
1
,
r
+
(
Nbitspersymbol
*
i
),
c0
,
temp0
);
matrixmult
(
1
,
Nsamplespersymbol
,
1
,
r
+
(
Nbitspersymbol
*
i
),
c1
,
temp1
);
constellation
[
2
*
i
]
=
temp0
[
0
];
constellation
[
2
*
i
+
1
]
=
temp1
[
0
];
}
for
(
int
j
=
0
;
j
<
Nbits
;
j
++
)
{
if
(
constellation
[
j
]
>=
0
)
DecodedData
[
j
]
=
'0'
;
else
DecodedData
[
j
]
=
'1'
;
}
}
\ No newline at end of file
constellation/constellation/receiver.h
View file @
9227bac
#ifndef __RECEIVER
#define __RECEIVER
#define PI 3.141592
#include <cmath>
#include <fstream>
#include "variables.h"
#include "myMatrix.h"
class
Creceiver
{
public
:
Creceiver
()
{};
float
T
;
Creceiver
();
float
*
r
;
// corrupted signal = received signal
float
constellation
[
Nbits
];
char
DecodedData
[
Nbits
];
void
demodulate
();
};
#endif
#endif
\ No newline at end of file
...
...
Please
register
or
login
to post a comment