フィルターのクリア

Help!! I want to plot "pdf_ky" for different value of "L" in a same graph

1 回表示 (過去 30 日間)
sharif shikder
sharif shikder 2016 年 2 月 1 日
コメント済み: sharif shikder 2016 年 2 月 3 日
%clc;
%clear all;
%close all;
L_0=10; %Average outer scale of turbulance in m.
c_n=5*10^(-12); %Structure constant of refractive index in m^-2/3.
c=3*10^8; % Speed of light in m/s.
f=20*10^9; % Frequency in HZ.
lamda=c/f;
L=1000;%Equivalent Path length through the turbulence area
del_ky=0.01;
[EbN0_dB]=[10 15 20 25 30 35 40 45 50 55];
sigma=((0.307*(c_n).^2)*((2*3.1416/lamda)^1.17)*(L^(1.833)))-((0.742*(c_n)^2)*((2*23.1416/lamda)^0.17)*((L^2.833)*(L_0^2)))
for i= 1:10
snr=10.^(EbN0_dB(i)/10);
ky=0:del_ky:10;
pe=1/2.*erfc(ky.*sqrt(snr/2));
% sigma=1;
% sigma=sigma*10^(-13);
ky=ky*10^(-13);
% pdf_ky=((-ky.^2)/(2*sigma^2));
pdf_ky=(1/(sqrt(2*3.1416)*sigma))*exp((-ky.^2)/(2*sigma^2));
prod=pe.*pdf_ky;
ber(i)=trapz(prod)*del_ky;
end
CDF_ky=trapz(pdf_ky)*del_ky
ber=ber./CDF_ky;
semilogy(EbN0_dB,ber)
% plot(pdf_ky)
ylabel('Bit Error Rate(BER)')
xlabel('Signal to Noise Ratio(SNR)');
%variance_ky=sigma^2
% semilogy(variance_ky,L)

採用された回答

Alexandra Topciov
Alexandra Topciov 2016 年 2 月 2 日
Make a vector of you L values and introduce it in a loop. For the "same graph" part use "hold on"(<http://www.mathworks.com/help/matlab/ref/hold.html>)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by