Applies to: NetSim Pro v14/v15
Frequency hopping changes a radio's operating frequency among a set of channels within a configured band. In NetSim DTDMA, the available hopping-channel count is derived from the frequency span and the channel bandwidth. During a hopping event, the simulation selects one channel index and sets the operating frequency for that node.
A hopping channel is one bandwidth-sized frequency position within the configured lower-to-upper frequency span.
Hopping channel count =
(Upper frequency - Lower frequency)
-----------------------------------
Channel bandwidthThe simulation converts the result to an integer:
int range = (int)(
(phy->dUpperFrequency - phy->dLowerFrequency) /
phy->dBandwidth);If the span is not an exact multiple of the bandwidth, the integer conversion truncates the fractional part. Configure a frequency span that is divisible by the channel bandwidth when a whole set of equal-width channels is required.
| Lower frequency | 2400 MHz |
|---|---|
| Upper frequency | 2480 MHz |
| Channel bandwidth | 5 MHz |
| Computed count | (2480 - 2400) / 5 = 16 channels |
The channel indices are 0 through 15. With the calculation, the corresponding selected frequencies are obtained from:
Selected frequency =
Lower frequency + Channel index × Channel bandwidthThe function generates a random channel index in the calculated range and sets the node's current operating frequency:
r = random channel index from 0 to range - 1;
phy->dFrequency =
phy->dLowerFrequency + r * phy->dBandwidth;The selected frequency is subsequently used by DTDMA propagation and interference processing.
| Location | Purpose |
|---|---|
<NetSim_Install_Directory>\src\Simulation\DTDMA\FrequencyHopping.cfn_NetSim_DTDMA_FrequencyHopping() | Calculates the integer channel range, selects a random channel index, and assigns the current frequency during simulation. |
<NetSim_Install_Directory>\src\Simulation\DTDMA\DTDMA_Phy.c | Uses the selected frequency for propagation, reception, and interference-related processing. |
The displayed hopping-channel count is informational. The simulation engine calculates its channel range from the configured lower frequency, upper frequency, and bandwidth in FrequencyHopping.c.