📄 detector.m
字号:
function [indata_est,training1_est, training2_est]=detector(inphase_symbols,training_length1,training_length2,model)% [indata_est,training1_est, training2_est]=detector(inphase_symbols,training_length1,training_length2,model) %% Output:% indata_est - Estimated bits {0,1}% training1_est - Estimated training bits sequence 1% training2_est - Estimated training bits sequence 2
%
% Input:
% inphase_symbols - Downsampled inphase component % training_length1 - Length of training sequence 1% training_length2 - Length of training sequence 2
% model - 0: no Alamouti (only 1 antenna), 1: Alamouti
%% Short Theoretical Background for the Function:% % Estimates the received bits from the inphase-component of % the received BPSK-symbols. % symbols < 0 => data_est = 0% symbols > 0 => data_est = 1% this is done by taking sign of inphase_symbols which gives% -ones and ones. By adding one and dividing by two zeros and ones are achieved. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% Function part of simulation for Space-Time%%% coding project, group Grey-2001.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Author: Fredrik Hansson% Date: 2001-03-22% Version: 1.1% Revision (Name & Date & Comment):% SU 2001-03-25 Added parameteres: model and training_length2 for
% the case of having two antennas sending with
% one train-sequence each.%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%data_est = floor((sign(inphase_symbols)+1)/2); if model == 0 % no alamouti coding
training1_est = data_est(1:training_length1);
training2_est = 0;
indata_est = data_est(training_length1+1:end); elseif model == 1 % alamouti coding
training1_est = data_est(1:training_length1);
training2_est = data_est(training_length1+1:training_length1+training_length2);
indata_est = data_est(training_length1+training_length2+1:end);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -