?? cp0203_qpsk_demod.m
字號:
%
% FUNCTION 2.10 : "cp0203_qpsk_mod"
%
% This function receives a binary stream in input ('bits')
% and returns the corresponding sequence of QPSK symbols
% ('S'),
% plus the two sequences 'Sc' and 'Ss' containing the real
% and the imaginary part of each symbol
%
% Programmed by Guerino Giancola
%
function [r_bits] = cp0203_qpsk_demod(S)
ns = length(S); % number of bits
nb = ceil(2*ns); % number of symbols
r_bits = zeros(1,nb);
for i = 1 : ns
if (angle(S(i))>0 & angle(S(i))<pi/2)
r_bits(2*(i-1)+1) = 1;
r_bits(2*(i-1)+2) = 1;
end
if (angle(S(i))>pi/2 & angle(S(i))<pi)
r_bits(2*(i-1)+1) = 0;
r_bits(2*(i-1)+2) = 0;
end
if (angle(S(i))>-pi/2 & angle(S(i))<0)
r_bits(2*(i-1)+1) = 1;
r_bits(2*(i-1)+2) = 0;
end
if (angle(S(i))>-pi & angle(S(i))<-pi/2)
r_bits(2*(i-1)+1) = 0;
r_bits(2*(i-1)+2) = 1;
end
end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -