⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cp0203_qpsk_demod.m

📁 uwb无线电基础书本(电子工业出版社)的MATLAB程序
💻 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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -