zoukankan      html  css  js  c++  java
  • CCS

    Three different detectors for recovering the transmitted data symbols and
    evaluate their performance for Rayleigh fading and additive white Gaussian noise.

     

    Matlab coding

    Implement the three types of detectors.

    Nt = 2;                                                                             % No. of transmit antennas
    Nr = 2;                                                                             % No. of receive antennas
    S = [1 1 -1 -1; 1 -1 1 -1];                                                  % Reference codebook
    H = (randn(Nr,Nt) + 1i*randn(Nr,Nt))/sqrt(2); % Channel coefficients
    s = 2*randi([0 1],Nt,1) - 1;                                               % Binary transmitted symbols
    No = 0.1;                                                                         % Noise Noiance
    noise = sqrt(No/2)*(randn(Nr,1) + 1i*randn(Nr,1));         % AWGN noise
    y = H*s + noise;                                                              % Inputs to the detectors
    disp(['The transmitted symbols are: ',num2str(s')])

    % Maximum Likelihood Detector:
    mu = zeros(1,4);
    for i = 1:4
      mu(i) = sum(abs(y - H*S(:,i)).^2);                           % Euclidean distance metric
    end
    [Min idx] = min(mu);
    s_h = S(:,idx);
    disp(['The detected symbols using the ML method are: ',num2str(s_h')])

    % MMSE Detector:
    w1 = (H*H' + No*eye(2))^(-1) * H(:,1); % Optimum weight vector 1
    w2 = (H*H' + No*eye(2))^(-1) * H(:,2); % Optimum weight vector 2
    W = [w1 w2];
    s_h = W'*y;
    for i = 1:Nt
      if s_h(i) >= 0
        s_h(i) = 1;
      else
        s_h(i) = -1;
      end
    end
    disp(['The detected symbols using the MMSE method are: ',num2str(s_h')])

    % Inverse Channel Detector:
    s_h = Hy;
    for i = 1:Nt
      if s_h(i) >= 0
        s_h(i) = 1;
      else
        s_h(i) = -1;
      end
    end
    disp(['The detected symbols using the ICD method are: ',num2str(s_h')])

    Output,

    >> Round 1
    The transmitted symbols are: 1 1
    The detected symbols using the ML method are: 1 1
    The detected symbols using the MMSE method are: 1 1
    The detected symbols using the ICD method are: 1 1
    >> Round 2
    The transmitted symbols are: 1 -1
    The detected symbols using the ML method are: 1 -1
    The detected symbols using the MMSE method are: 1 -1
    The detected symbols using the ICD method are: 1 -1
    >> Round 3
    The transmitted symbols are: -1 1
    The detected symbols using the ML method are: -1 1
    The detected symbols using the MMSE method are: -1 1
    The detected symbols using the ICD method are: -1 1

    Reference,

      1. <<Contemporary Communication System using MATLAB>> - John G. Proakis

  • 相关阅读:
    洛谷P1352没有上司的舞会+树形二维DP
    高精度模板(从洛谷题解中骗来的
    Codeforces#398 &767C. Garland 树形求子节点的和
    LuoGu-P1122 最大子树和+树形dp入门
    HDU-3549Flow Problem 最大流模板题
    Codeforces Round #486 (Div. 3)988E. Divisibility by 25技巧暴力||更暴力的分类
    Codeforces Round #486 (Div. 3)988D. Points and Powers of Two
    数据结构&字符串:01字典树
    数据结构:可持久化平衡树
    数据结构:并查集-拆点
  • 原文地址:https://www.cnblogs.com/zzyzz/p/13580204.html
Copyright © 2011-2022 走看看