three-gpp-ntn-channel-example.cc

28 views
Skip to first unread message

Jeļena T.

unread,
Apr 13, 2026, 7:25:54 AM (8 days ago) Apr 13
to 5G-LENA-users
Hello,
I'm looking into the example three-gpp-ntn-channel-example.cc and there is this line:
in function CreateTxPowerSpectralDensity:
unsigned int numRbs = std::floor(bwHz / rbWidthHz);

By default there are following values set in main:
double bandwidthHz = 400e6; // Hz
double RbBandwidthHz = 120e3; // Hz

Which leads to number of RBs to be: 3333.

According to doc there should be 264 (attached image).

Please correct me if I'm missing something?

Thanks! (Just wanted to understand this whole calculation stuff, so going line by line in Your code)

BR,
Jelena
Pasted image 20260413140709.png

Gabriel Ferreira

unread,
Apr 13, 2026, 11:43:54 AM (8 days ago) Apr 13
to 5G-LENA-users
You're totally right. Not discounting guard bands nor that you have 12 subcarriers per rb. 

Rbbandwidth = 120e3*12;
Numrbs = (bandwidth - 2*9.86e3) / rbbandwidth

Jeļena T.

unread,
Apr 14, 2026, 8:11:30 AM (7 days ago) Apr 14
to 5G-LENA-users
Understood, thanks a lot.

I rechecked the formula and seems that this way should be the most correct way (at least it gives results per different BWs and SCSs matching the doc):
const unsigned int minGbw = 9800; //Minimum Guardband per 400MHz BW and 120KHz RB Width
unsigned int numRbs = std::floor((bwHz/1000 - rbWidthHz/1000 - 2*minGbw)/(12*(rbWidthHz/1000)));

guard bands should be kept somewhere per BW+SCS as a list (as in doc) or passed as a parameter to CreateTxPowerSpectralDensity function.

I see that three-gpp-two-ray-channel-calibration.cc has the same way of numRbs calculation.. Should it be changed as well?

If you like, I can create PR with these fixes to NS3.

BR,
Jelena

Biljana Bojovic

unread,
Apr 14, 2026, 8:18:03 AM (7 days ago) Apr 14
to Jeļena T., 5G-LENA-users
That would be great!


--
You received this message because you are subscribed to the Google Groups "5G-LENA-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 5g-lena-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/5g-lena-users/b4204655-c6ef-427f-ab2d-a1f06b1b9588n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages