Question

In: Advanced Math

Hi. I want matlab code that implements a mimo system that uses the mmse and zf...

Hi. I want matlab code that implements a mimo system

that uses the mmse and zf methods with Rayleigh fading.

Thank you.

Solutions

Expert Solution

% Script for computing the BER for BPSK modulation in 3 tap ISI 
% channel. Minimum Mean Square Error (MMSE) equalization with 7 tap 
% and the BER computed (and is compared with Zero Forcing equalization)

clear
N  = 10^6; % number of bits or symbols
Eb_N0_dB = [0:15]; % multiple Eb/N0 values
K = 3;

for ii = 1:length(Eb_N0_dB)

   % Transmitter
   ip = rand(1,N)>0.5; % generating 0,1 with equal probability
   s = 2*ip-1; % BPSK modulation 0 -> -1; 1 -> 0 

   % Channel model, multipath channel
   nTap = 3;
   ht = [0.2 0.9 0.3]; 
   L  = length(ht);

   chanOut = conv(s,ht);  
   n = 1/sqrt(2)*[randn(1,N+length(ht)-1) + j*randn(1,N+length(ht)-1)]; % white gaussian noise, 0dB variance 
   
   % Noise addition
   y = chanOut + 10^(-Eb_N0_dB(ii)/20)*n; % additive white gaussian noise

   
   % zero forcing equalization
   hM = toeplitz([ht([2:end]) zeros(1,2*K+1-L+1)], [ ht([2:-1:1]) zeros(1,2*K+1-L+1) ]);
   d  = zeros(1,2*K+1);
   d(K+1) = 1;
   c_zf  = [inv(hM)*d.'].';
   yFilt_zf = conv(y,c_zf);
   yFilt_zf = yFilt_zf(K+2:end); 
   yFilt_zf = conv(yFilt_zf,ones(1,1)); % convolution
   ySamp_zf = yFilt_zf(1:1:N);  % sampling at time T
 
   % mmse equalization
   hAutoCorr = conv(ht,fliplr(ht));
   hM = toeplitz([hAutoCorr([3:end]) zeros(1,2*K+1-L)], [ hAutoCorr([3:end]) zeros(1,2*K+1-L) ]);
   hM = hM + 1/2*10^(-Eb_N0_dB(ii)/10)*eye(2*K+1);
   d  = zeros(1,2*K+1);
   d([-1:1]+K+1) = fliplr(ht);
   c_mmse  = [inv(hM)*d.'].';
   yFilt_mmse = conv(y,c_mmse);
   yFilt_mmse = yFilt_mmse(K+2:end); 
   yFilt_mmse = conv(yFilt_mmse,ones(1,1)); % convolution
   ySamp_mmse = yFilt_mmse(1:1:N);  % sampling at time T
  
   % receiver - hard decision decoding
   ipHat_zf = real(ySamp_zf)>0;
   ipHat_mmse = real(ySamp_mmse)>0;

   % counting the errors
   nErr_zf(1,ii) = size(find([ip- ipHat_zf]),2);
   nErr_mmse(1,ii) = size(find([ip- ipHat_mmse]),2);

   

end

simBer_zf = nErr_zf/N; % simulated ber
simBer_mmse = nErr_mmse/N; % simulated ber
theoryBer = 0.5*erfc(sqrt(10.^(Eb_N0_dB/10))); % theoretical ber

% plot
close all
figure
semilogy(Eb_N0_dB,simBer_zf(1,:),'bs-','Linewidth',2);
hold on
semilogy(Eb_N0_dB,simBer_mmse(1,:),'gd-','Linewidth',2);
axis([0 14 10^-5 0.5])
grid on
legend('sim-zf', 'sim-mmse');
xlabel('Eb/No, dB');
ylabel('Bit Error Rate');
title('Bit error probability curve for BPSK in ISI with MMSE equalizer');







Related Solutions

I want the code for the 2D Ising model using Matlab
I want the code for the 2D Ising model using Matlab
I want to create an image compression program with matlab use PCA. I have the code...
I want to create an image compression program with matlab use PCA. I have the code listed below. But this code is fail, the image is colorless, but still gray. Can you help me to fix my code. clc clear all picture = im2double(imread('picture1.jpg')); Red = picture(:,:,1); premean = mean(Red(:)); premax = max(Red(:)); premin = min(Red(:)); x = size(Red,1); y = size(Red,2); Z = ones(x,y)*premean; A = (Red - Z)*(1/premax - premin); B = cov(A); [veceig,eig,C] = pcacov(B); NewRed =...
Hi, I need a Matlab code satisfies the following question. Output should be a graph similar...
Hi, I need a Matlab code satisfies the following question. Output should be a graph similar to a sine or cosine graph or similar to electrocardiograms (EKG/ECG) graph. Please I'd appreciate it. All love. Thanks :) In elementary quantum mechanics, the square well is used to model the behavior of a bound particle, in which one or more forces (external potentials, interaction with other particles, etc) prevent or restrict its ability to move about. We have seen in class that...
Hi, I'm currently writing a Matlab program to simulate the Apollo 11 trajectory. Now I want...
Hi, I'm currently writing a Matlab program to simulate the Apollo 11 trajectory. Now I want to plot a 3D animated orbit which is a 60 by 58 nautical miles orbit. Can you provide a code or some idea of how to plot an orbit like this in 3D?
write a matlab code to simulate fiber optics communication system on matlab simulink
write a matlab code to simulate fiber optics communication system on matlab simulink
I'm new in MATLAB and I have to write a code in MATLAB which converts a...
I'm new in MATLAB and I have to write a code in MATLAB which converts a number from one base to another without using base2base, etc
matlab code to calculate cost of generator in power system
matlab code to calculate cost of generator in power system
Hi, can you please verify with the basic code of a beginner MATLAB user, and try...
Hi, can you please verify with the basic code of a beginner MATLAB user, and try explaining how to approach if possible. Thanks a lot! :) 1. Answer the following questions regarding complex numbers. You must provide all handwritten working and MATLAB code/outputs for the problems below. (a) Express the complex number w = √ 3+i in complex exponential form. (Provide a handwritten solution) (b) (1 mark) Use MATLAB to check your answer for part (a) by calculating the length...
this is my code I want the opposite i want to convert a postfix expression to...
this is my code I want the opposite i want to convert a postfix expression to infix expression #include <iostream> #include <string> #define SIZE 50 using namespace std; // structure to represent a stack struct Stack {   char s[SIZE];   int top; }; void push(Stack *st, char c) {   st->top++;   st->s[st->top] = c; } char pop(Stack *st) {   char c = st->s[st->top];   st->top--;   //(A+B)*(C+D)   return c; } /* function to check whether a character is an operator or not. this function...
Hi I have an exercise and I want to you to solve it step by step,...
Hi I have an exercise and I want to you to solve it step by step, please.. I found the solution here but it did not have steps .. *Answer the following questions using the information below: Tiger Pride produces two product lines: T-shirts and Sweatshirts. Product profitability is analyzed as follows: T-SHIRTS SWEATSHIRTS Production and sales volume 60,000 units 35,000 units Selling price $16.00 $29.00 Direct material $ 2.00 $ 5.00 Direct labor $ 4.50 $ 7.20 Manufacturing overhead...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT