Simulate the outage probability that the recieve SNR is greater than $SNR_{th} = constant$
34 次查看(过去 30 天)
显示 更早的评论
I have finished the probability of the qpsk,passing flat fading channel.And now i have to write the outage probability that the received SNR is greater than $SNR_{th}=3$ with N0=1(SNR=0dB),N0=12(SNR=3dB),N0=14(SNR=6dB),N0=18(SNR=9dB),and N0=116(SNR=12dB)
My problem is that i don't know how to write the code about outage probability,outage_prob=1-(exp(−SNRth/(Eb/N0)),i have write the outage probability in this code below,but the simulation is wrong,because it always said that outage probability is 1.
Can anyone show me how to write the outage probability code according the what i have to write?
clear symbol_number=1e5; EbN0_db=0:1:10; EbN0_1=(1)*10.^(EbN0_db/10); EbN0_2=(1/2)*10.^(EbN0_db/10); EbN0_3=(1/4)*10.^(EbN0_db/10); EbN0_4=(1/8)*10.^(EbN0_db/10); EbN0_5=(1/16)*10.^(EbN0_db/10); EbN0_choose=EbN0_1;
for(n=1:length(EbN0_db)) symbol_inphase=2*(round(rand(1,symbol_number))-0.5); symbol_quadrature=2*(round(rand(1,symbol_number))-0.5); symbol=symbol_inphase + 1i*symbol_quadrature; w=(1/sqrt(2*EbN0_choose(n)))*(randn(1,symbol_number)+1i*randn(1,symbol_number)); vComplexNoise = sqrt(1/2) * (randn(1,symbol_number) + (1i * randn(1,symbol_number))); H = abs(vComplexNoise); receive=symbol.*H+w; symbol_inphase_=sign(real(receive)); symbol_quadrature_=sign(imag(receive)); sim_error_prob_inphase=sum(sum(symbol_inphase~=symbol_inphase_))/(symbol_number); sim_error_prob_quadrature=sum(sum(symbol_quadrature~=symbol_quadrature_))/(symbol_number); sim_error_prob_sym(n)=mean([sim_error_prob_inphase sim_error_prob_quadrature]); theoretical_ber(n) = qfunc(sqrt(2 * EbN0_choose(n))); end sim_error_prob_bit=sim_error_prob_sym./2;
%outage probability% for (EbN0_db=3:1:10); outage_prob=1-(exp(-EbN0_db./sim_error_prob_sym)) end
%plot the picture semilogy(EbN0_db,theoretical_ber,'rx-')%theoretical hold on semilogy(EbN0_db,sim_error_prob_sym,'mx-')%simulation semilogy(EbN0_db,sim_error_prob_bit,'bx-')
回答(1 个)
Mohammad Ali
2022-6-13
For Outage probability, after generating your channel gains, you have to calculate SNR according to your recieved signal at reciever. Then start a for loop if give the condition "if SNR(i) < SNR(th) then j=j+1" where j can be defined above as j=0. Now Outage prob. = j/itration.
1 个评论
Najeeb Ud Din
2022-8-3
What if I need to find outage prob between user n destination with RIS in between
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!