Bug in BLE performance simulation
17 views (last 30 days)
Show older comments
codeRate = 1/2;
snrVec = EbNo + 10*log10(codeRate) - 10*log10(sps);
The well-known formula mapping EbNo to SNR is SNR = EbNo + 10*log10(fs/B), where fb = information bit rate and B = receiver noise bandwidth, both in Hz. The ratio fb/B can be viewed as a code rate if redundancy is used. The problem is that the code rate is incorrect for the 125 kbps PHY. It's 1 for the 1 Mbps and 2 Mbps version of the PHY, which I think is correct, and 1/2 is correct for the 500 kbps PHY, but it should be 1/8 for the 125 kbps PHY.
Does anyone disagree? If not, I think it's important for someone from the MathWorks team to fix this issue and update this post. Otherwise, because this is publicly viewable on the internet, folks (like me) are going to come to the wrong conclusion about how the 125 kbps PHY should perform!
0 Comments
Answers (6)
Deepak@Mathworks
on 16 Dec 2020
Hi Gary,
I don't understand how are you reaching to the conclusion of 125kbps Phy will have a coderate of 1/8
% For Coded PHY's (LE500K and LE125K), the code rate factor is included
% in SNR calculation as 1/2 rate FEC encoder is used.
These lines in the example make it clear that for 500 kbps and 125kbps data rates, we are using a 1/2 FEC which means that if you have x input bits then you are going to add x redundant bits to it for better error rate performance so doesn't matter what data rates you use, your code rate is still going to be 1/2 (input_bits/output_bits = x/2x).
Hope this makes it clear.
Cheers,
Deepak
0 Comments
Gary Sugar
on 16 Dec 2020
2 Comments
Deepak@Mathworks
on 16 Dec 2020
Gary, in the example, spread factor is defined by sps. Hence the formula is updated to:
snrVec = EbNo - 10*log10(sps); for No FEC case and
snrVec = EbNo + 10*log10(codeRate) - 10*log10(sps); for FEC case.
From my understanding, i think there are two confusions.
- You want coderate = fb/B but in the example coderate/sps = fb/B
- You are assuming that it's only happening for 125kbps but not for 500kbps case?
But as you can see in the example sps is defined for both coded as well as non-coded transmissions, hence sps is kept seperate from coderate. Otherwise we will be having a coderate of 1/4 for even non-coded cases which seems wrong.
Deepak@Mathworks
on 16 Dec 2020
Code rate is defined for FEC only: Wikipedia_Link and not for the time diversity which is introduced by the repeatition of bits.
Alekhya Parisha
on 17 Dec 2020
Hi Gary,
Here is a quick mathematical equation for snr
SNR=E/(1 chip*No)*chips/bit*bits/symbol*symbols/sample
= E/(1 chip*No)*spreading factor*log2(M)/sps
We know that Eb = Ec*spreadingFactor then the equation deduces to
=E/(1 bit*No)*log2(M)/sps
For Uncoded modes, SNR = Eb/No -10*log10(sps)
For Coded modes, SNR = Eb/No + 10*log10(k) -10*log10(sps) [Here k is the code rate which is ½ ]
Here Eb/No refers to uncoded Eb/No.
If we consider Ec/No as the simulation parameter then we would have included spreadingFactor but as Eb/No is considered then there is no need to consider spreading factor.
Hope this clarifies your concern.
-Alekhya.
0 Comments
Gary Sugar
on 17 Dec 2020
3 Comments
Alekhya Parisha
on 29 Dec 2020
Hello Gary,
For repetition coding with repetition length of L, we get a coding gain of 10log10(Rc*dmin) = 10log10( 1/L · L) = 0 dB. Repetition coding does not result in a coding gain, because the minimum distance(dmin) is the same as the code rate(1/L).
For LE125Kbps, the repetition length in the standard is four (L=4) coding gain is 0dB.
snrVec = EbNo + 10*log10(codeRate) - 10*log10(sps)
Here we considered codeRate which corresponds to coding gain i.e.,1/2 same for LE 500 and LE 125 Kbps so we haven't considered 1/4 factor as there won't be any coding gain.
For LE125 Kbps spreading factor(4) needs to be included in the snr calculation.
Hence, snrVec = EbNo + 10*log10(1/8)- 10*log10(sps)
Hope this clarifies you.
See Also
Categories
Find more on Propagation and Channel Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!