This example shows how to use an RTL-SDR radio connected to a BeagleBone Black hardware with Simulink®, Embedded Coder®, and Communications Toolbox® to monitor TV white space signal levels. To run this example, you need to install Communications Toolbox Support Package for RTL-SDR Radio and Embedded Coder Support Package for BeagleBone Black Hardware.
Embedded Coder Support Package for BeagleBone Black Hardware enables you to create and run Simulink models on BeagleBone Black hardware. Communications Toolbox Support Package for RTL-SDR Radio enables you to receive radio signals from the RTL-SDR radio. You can use these two support packages together to receive RF signals in a given bandwidth in the TV white space on the BeagleBone Black hardware.
In this example you will learn how to run the TV White Space Monitor Simulink model on BeagleBone Black hardware, and how to tune and monitor the algorithm in real time as it is executing.
Simulink's External mode feature enables you to accelerate the process of parameter tuning by letting you change certain parameter values while the model is running on target hardware, without stopping the model. When you change parameter values from within Simulink, the modified parameter values are communicated to the target hardware immediately. The effects of the parameters tuning activity may be monitored by viewing algorithm signals on scopes or displays in Simulink.
This example introduces the Simulink External mode feature by showing you how to:
Configure communications between Simulink and BeagleBone Black hardware
Tune parameters of an algorithm from the same Simulink model that is running on the BeagleBone Black hardware
Use Display block to monitor results from an algorithm running on BeagleBone Black hardware
To run this example, you will need the following hardware:
BeagleBone Black hardware
The following shows the TV white space monitor model. The model uses the RTL-SDR receiver block to receive radio signals and sends them to the signal strength estimator subsystem.
The signal strength estimator block estimates the signal power in a given band. You can vary the center frequency and signal bandwidth.
In this task, you will configure your model to run on BeagleBone Black hardware. You will then run your model on BeagleBone Black hardware in External mode. When you are prototyping and developing an algorithm, it is useful to monitor and tune the algorithm while it runs on hardware. The External mode feature in Simulink enables this capability.
1. In the model, set simulation stop time to 'inf' to run the simulation until you explicitly pause or stop the model.
2. In the Simulink model, click Tools > Run on Target Hardware> Options....
3. When the Configuration Parameters page opens up, set the Target hardware parameter to BeagleBone Black. Review the other parameters on that page. If you performed a Firmware Update, Board information will be automatically populated with the IP address, user name and password of your BeagleBone Black hardware. Click OK when you are done.
4. In your Simulink model, make sure that the Simulation mode on the toolbar is set to External. Then, click the Run button on the toolbar.
5. Observe the estimated signal power level in the Uncalibrated Signal Power (dBm) block. Note that this value is uncalibrated and assumes that the output of the RTL-SDR receiver block is in Volts and the measurements are reference to 1 Ohm load.
6. Double-click the Model Parameters block. Change the Center frequency value to another band and observe that the estimated signal power level changes. You can get a list of TV channel numbers in your area using a simple web search such as "TV channels near me". In North America, you can map channel numbers to actual frequencies using North American TV Frequencies. In Natick, MA, USA, Channel 2, which has an ATSC pilot at 54.31 MHz, is available for TV White Space applications.
7. When you are done changing model parameters, press the Stop button on the model.
This example introduced the workflow for receiving radio signals with an RTL-SDR radio and processing the received signals using a Simulink model running on BeagleBone Black hardware. Using External mode, you changed system parameters while the model was running and observed the effects of parameter value changes.