Add the “Analog to Digital” and “Digital to Analog” converters (ADC and DAC) to your model:
Add the multi-port selector, in order to split the stereo input.
After placing the selector, double-click to open the dialog box and choose “columns” in the “select” label and “{1,2}” in the “indices to output label.
Configure the ADC and DAC blocks to a sampling rate to 96 KHZ and 16-bit samples.
The final model should look as follows:
You should configure the DSP constants as shown in Figure 28. The frame period for all constants should be -1
Build the project and load the program to the DSK memory using ctrl+B.
Make sure that the signals generator amplitude is set to 1 Volt and frequency of [0.1,5] kHz.
Display the modulated and demodulated signals in the scope.
Model extensions
In this section we will extend the functionality of the example. Adding two more features:
A variable frequency carrier generator (Please refer to secion "A Configurable Carrier Wave Generator" in the Appendix)
An additional model for AM detection (Please refer to secion "The Coherent Detector (in brief)" in the Appendix).
Build GUI that we will enable:
Changing the modulation index
Changing the carrier frequency
Selecting the detection scheme
The modulation index and carrier frequency will be changed through RTDX.
Open the model created in the previous section
Replace the constant modulation index by an RTDX input (Please refer to Figure 30), and name it InputModulation.
Configure the RTDX input object to the values described bellow:
Replace the sine wave block used for the carrier by the configurable carrier blocks (you may find them in the
Configurable_Carrier.mdl file)
The principle of operation of the Configurable Carrier Module is described in the Appendix. , and create a subsystem for the carrier generator as shown in Figure 32.
Your model should look as shown in Figure 33.
Figure 32 – Inserting a Configurable Carrier
Enter the Configuration Parameters menu (ctrl+E). Choose Real-Time Workshop=>TIC6000 Code-Generator, In The Run-Time box change the Build Action to “Build”
The models will be loaded by the GUI script. :
Push the OK button and close the “Configuration Parameters” window.
Rebuild *.out file using ctrl+B.
Open the
AM_Coherent.mdl file, and repeat step for this file.
You now have two load files each one corresponding to a different AM scheme.
Creating the gui
Open a new GUI (Enter GUIDE in the MATLAB command line)
Add 2 sliders and one list box to the GUI, so it would look like:
Now, double click on the list-box and change the string field:
Change the string field to:
Coherent
SQRT
In the Modulation index slider set: Min=0.75, Max=1.5.
In the Carrier Frequency slider set: Min=1, Max=4.
Press the “play” button so you can save your GUI and open the GUI script m-file.
Receive real-time job alerts and never miss the right job again
Source:
OpenStax, From matlab and simulink to real-time with ti dsp's. OpenStax CNX. Jun 08, 2009 Download for free at http://cnx.org/content/col10713/1.1
Google Play and the Google Play logo are trademarks of Google Inc.
Notification Switch
Would you like to follow the 'From matlab and simulink to real-time with ti dsp's' conversation and receive update notifications?