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

📄 combiner.m

📁 这个程序主要是实现空时编码的matlab编解码仿真。
💻 M
字号:
function [combined_signal]=combiner(alpha1, theta1, alpha2, theta2, sampled_inphase_signal, sampled_quad_signal, model)%   [combined_signal]=combiner(alpha1, theta1, alpha2, theta2, sampled_inphase_signal, sampled_quad_signal, model)%%   Output:%   combined_signal         - The combined signal using Alamouti algorithm%   %   Using the channelmodel h = alpha * exp(theta), h1 and h2 are%   channels over which the information is sent via antenna 1 and 2.%%	alpha1                  - Channel 1%   theta1                  -%   alpha2                  - Channel 2%   theta2                  -%   %   sampled_inphase_signal  - Inphase signal which has been downsampled in reciever.%   sampled_quad_signal     - Quadrature dito.
%%   model		            - 0: no Alamouti coding, 1: Alamouti coding
%%   Short Theoretical Background for the Function:%%   This funcion combines signals sent from two different%   antennas, using the Alamouti algorithm and the estimates%   from the channel estimator.%   s0 = h1* r0 + h2 r1*%   s1 = h2* r0 - h1 r1*, where r0 is recieved signal at time (0,T) and r1 at time (T,2T).%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%     %%% Function part of simulation for Space-Time%%% coding project, group Grey-2001.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   Author: Stefan Uppg錼d%   Date: 2001-03-23%   Version: 1.0%   Revision (Name & Date):%   FH 2001-04-02       more efficient combining without for...%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
received = complex(sampled_inphase_signal,sampled_quad_signal);s = zeros(1,length(received));
if model == 0 				% This case, no Alamouti, compensating for phase only.
       s = exp(j*(-theta1)) * received;
elseif model == 1           % Alamouti coding    
    odd = received(1:2:end);    even = received(2:2:end);    s(1:2:end) = alpha1 * exp(j*(-theta1)) * odd + alpha2 * exp(j*theta2) * conj(even);    s(2:2:end) = alpha2 * exp(j*(-theta2)) * odd - alpha1 * exp(j*theta1) * conj(even);endcombined_signal = s;

⌨️ 快捷键说明

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