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

📄 bin2bipo.m

📁 Matlab communication toolbox.
💻 M
字号:
function [bipolar_sequence] = bin2bipo(binary_sequence)

% BIN2BIPO ....	Binary to bipolar conversion
%
%	[P] = BIN2BIPO(B) converts the binary sequence B into a bipolar sequence
%		using the transformation:
%
%			    1 ----> +1, -1, alternating
%			    0 ----> 0 
%
% 		For example:  [1 0 1 1 1 ...] ----> [1 0 -1 1 -1 ...] 

%	AUTHORS : M. Zeytinoglu & N. W. Ma
%             Department of Electrical & Computer Engineering
%             Ryerson Polytechnic University
%             Toronto, Ontario, CANADA
%
%	DATE    : August 1991.
%	VERSION : 1.0

%===========================================================================
% Modifications history:
% ----------------------
%	o	Tested (and modified) under MATLAB 4.0/4.1 08.16.1993 MZ
%===========================================================================

no_binary = length(binary_sequence);

for ii = 1:no_binary
    bipolar_sequence(ii,1) =  ...
                  binary_sequence(ii) * (-1)^(sum(binary_sequence(1:ii)) - 1);
end

⌨️ 快捷键说明

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