forked from neelabhro/QPSK-Modulation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetect.m
More file actions
26 lines (24 loc) · 672 Bytes
/
Copy pathdetect.m
File metadata and controls
26 lines (24 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function bhat = detect(r)
% bhat = detect(r)
%
% Computes the received bits given a received sequence of (phase-corrected)
% QPSK symbols. Gray coding of the individual bits is assumed. Hence, the
% two bits for each symbol can be detected from the real and imaginary
% parts, respectively. The first of the two bits below is output first in
% the bhat-sequence.
%
% Assumed mapping:
%
% 10 x | x 00
% |
% -------+-------
% |
% 11 x | x 01
%
% Input:
% r = sequence of complex-valued QPSK symbols
%
% Output:
% bhat = bits {0,1} corresponding to the QPSK symbols
bhat = [real(r)<0; imag(r)<0];
bhat = bhat(:)';