Communications Blockset | ![]() ![]() |
Troubleshooting a Passband Simulation
Passband modulation can be difficult to use because it requires you to choose appropriate values for carrier-related parameters and because it requires Simulink to sample signals at a high sampling rate. These factors can reduce the accuracy and speed of a passband simulation. The speed is particularly noticeable if you need to process large amounts of data before the results are meaningful. These sections offer tips that might help you improve the accuracy and/or speed of your simulation:
Use Baseband Simulation
Converting your model to a baseband simulation might improve the simulation's accuracy and/or speed substantially. Baseband modulation blocks do not use carrier-related parameters and, therefore, do not suffer from poor choices of such parameters. If you use baseband simulation, you can safely ignore the following sections, Decrease the Sample Time and Increase the Carrier Frequency.
Also, baseband simulations usually run faster than passband simulations because baseband simulations do not involve sampling a carrier signal at a high rate. The difference in speed might be dramatic.
Frame-based processing, which is available with baseband but not passband blocks, might further speed your baseband simulation. You can typically experiment with frame-based processing by varying parameters in the source blocks, while most other blocks in the model can remain as they are. For example, you can switch to frame-based processing in the example model bbmoddoc
by changing two parameters in the Random Integer Generator block. Specifically, check the Frame-based outputs check box and set the Samples per frame parameter to an integer greater than 1 (such as 20
).
Many algorithms can be simulated adequately at baseband. For example, to model the carrier frequency offset in a baseband simulation, multiply the transmitted baseband signal by a complex sinusoid. Because this sinusoid would typically have a much lower frequency than the carrier frequency, such a model is still less computationally intensive to simulate than an equivalent passband simulation would be.
Some situations require passband simulation, such as investigating the effects of radio frequency distortion. Even in such cases, you might be able to model part of the system at baseband initially and then switch to passband when you focus on the aspects of the system that require passband simulation.
Decrease the Sample Time
If you get results from a passband simulation that do not seem to match theoretical results, it could be that the sampling rate of the passband modulated signal is not sufficiently high. The sampling rate is the reciprocal of the sample time. You should decrease the sample time of the passband modulated signal, run the simulation again, and check the results. This sample time is the Output sample time parameter in digital passband modulator blocks and the Input sample time parameter in digital passband demodulator blocks.
After you decrease the sample time, the simulation might run more slowly.
Example of Excessive Sample Time of Modulated Signal. In the example model pbmoddoc
, the sample time of the modulated signal is modex_Td
, while the sample time of the unmodulated signal is modex_Ts
. If you assign
in the MATLAB Command Window and run the simulation, the error rate shown in the Display block is over 0.0066. This error rate is more than one-third greater than it was before making this parameter change. The simulation results no longer agree with the theoretical expected results because the sample time modex_Td
is too large compared to the sample time of the data. More specifically, the poorly chosen sample times cause aliasing of the signal spectrum in the frequency domain.
Increase the Carrier Frequency
If you get results from a passband simulation that do not seem to match theoretical results, it could be that the carrier frequency for passband modulation is not sufficiently high relative to the sampling frequency of the unmodulated signal. You should increase the Carrier frequency parameter of the modulator and demodulator blocks, run the simulation again, and check the results.
After you increase the carrier frequency, you might need to increase the sampling rate of the passband modulated signal to compensate.
Example of Insufficient Carrier Frequency. In the example model pbmoddoc
, the carrier frequency of the modulated signal is modex_fc
. Suppose you make the carrier frequency (modex_fc
) four times the sampling frequency of the unmodulated signal (modex_Ts
), and then use the inequalities on the modulation block's reference page to determine a threshold value for the modulated signal's sampling rate. For example, you might choose
These parameter values satisfy the inequalities and the simulation runs relatively quickly. However, the parameter values cause the model to produce an error rate of over 0.016, which is more than twice the theoretical expected result.
Use the Simulink Accelerator to Increase Speed
If you have access to the Simulink Accelerator, you can use it to make your simulation run more quickly. The Simulink Accelerator is part of the Simulink Performance Tools product.
![]() | Comparing Baseband and Passband Signals | Demonstration Models | ![]() |