Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi folks! I need to correct my code in order to reproduce this graph of this figure. -What I need: To insert those blue lines

Hi folks! I need to correct my code in order to reproduce this graph of this figure.

-What I need:

To insert those blue lines like the figure below that representing FTR fading model who has this two parameters:

image text in transcribed

and

image text in transcribed

Please correct my code. Thank you.

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Figure:

image text in transcribed

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

My Matlab Code:

close all; clear all; clc;

N =1e6; randn('state',100); randn('state',200); M=8; K=5; divorder=1; EbNo = -10:5:40; BER_Ray=berfading(EbNo,'psk',M,divorder) BER_Rician = berfading(EbNo,'psk',2,1,K); BER = berawgn(EbNo,'psk',M,'nondiff');

%TX ip = randn(1,N)>0.5; % s = 2*ip-1; % BPSK 0 -> -1; 1 -> 1 n = 1/sqrt(2)*[randn(1,N) + 1i*randn(1,N)]; % Additive white Gaussian noise (AWGN), 0dB variance

for ii = 1:length(EbNo) y = s + 10^(-EbNo(ii)/20)*n; % additive white gaussian noise (AWGN)

%RX ipHat = real(y)>0;

nErr(ii) = size(find([ip- ipHat]),2);

end

simBer = (nErr/N); theoryBer = erfc(sqrt(10.^(EbNo/20)));

% plot 1

close all figure semilogy(EbNo,theoryBer,'b.-'); hold on semilogy(EbNo,simBer,'mx-'); axis([-10 40 1e-5 0.5]) grid on

hold on semilogy (EbNo,BER_Ray,'*-'); semilogy (EbNo,BER_Rician,'+-'); % plot 2 xlabel('Eb/No, dB'); ylabel('Bit Error Rate'); title('Bit error probability curve for BPSK modulation'); legend('m=2','m=8'); axis([-10 40 1e-5 .5]) grid on

= + = +

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

Students also viewed these Databases questions