<< Chapter < Page Chapter >> Page >

Real time implementation

The environment

Figure 21 shows the block-diagram for the real time implementation. The DSP will deliver two outputs. The first is the reference spectrum; the second is an estimated spectrum of the output of the all-pole filter. Three real-time models will be created, each one corresponding to an estimator. The user will be able to select the desired estimator through a Graphic User Interface (GUI).

Real Time Implementation Environment

The real-time implementation model will be created from the simulation model, after the following changes:

  • The noise generator block will be replaced by the CODEC of the DSK6713
  • The virtual scope will be replaced also by the CODEC
  • A target definition block (DSK6713) will be added.

Equipment Used:

  • DSK6713
  • Dual Channel Oscilloscope
  • Signal Generator
Real Spectrum Estimation Equipment

Creating the models

  1. Open the simulation model “SpectrumEstimation.mdl”.
  2. Remove the “Burg” and “MCov AR” estimators.
  3. Add the C6713DSK target to the model
    The C6713DSK target Block
  4. Replace the vector scope by the “Digital to Analog” converter (DAC)
    The DAC Block
  5. Configure the DAC block to a sampling rate to 8 KHZ and 16-bit samples.
    The DAC Block Configuration
  6. Double- click on the concatenation object and change the number of inputs from 4 to 2.
  7. Replace the white noise generator by the “Analog to Digital” converter (ADC).
    The ADC Block
  8. Configure the ADC blocks to a sampling rate to 8 KHZ and 16-bit samples.
    The ADC Block Configuration
  9. The final model should look as follows:
    Periodogram Real-Time Model
  10. Set the AR-coefficients data type to single.
  11. Configure the Model to generate and build (without executing) the CCS code as shown:
    Model Configuration
  12. Save the model as “Periodogram.mdl”
  13. Build the model (CTRL-B)
  14. Replace the Periodogram estimator block by the Burg estimator
  15. The final model should look as follows:
    Burg Real-Time Model
  16. Save the model as “Burg.mdl”
  17. Build the model (CTRL-B)
  18. Replace the Burg estimator block by the MCov AR estimator
  19. The final model should look as follows:
    MCov AR Burg Real-Time Model
  20. Save the model as “MCcov_AR.mdl”
  21. Build the model (CTRL-B)At this step you’ll have three .out files to be loaded to the DSK. Each one corresponding to an estimator.

The graphic user interface (gui)

The GUI shown in Figure 32 will be used to select the model. Upon selecting a model, its correspondent load file will be loaded to the DSP.

Graphic User Interface (GUI)
  1. Enter GUIDE in the MATLAB® command line.
  2. Choose a new GUI, and name it Spectrum
  3. Add a list-box to your GUI with the string: Periodogram BurgM-Cov
  4. A script file “spectrum.m” will open, when you press the “play” button. Name the script “spectrum.m”
  5. The GUI will perform the following tasks:
    • Upon activating the GUI, the default model is loaded to the DSP.
    • When the user selects a new model, it is loaded to the DSP.
  6. The initialization routine “Spectrum_OpeningFcn” will be: function Spectrum_OpeningFcn(hObject, eventdata, handles, varargin) modelName = gcs;%connect to target: CCS_Obj = connectToCCS(modelName);% Identify RTDX channel names/modes CodegenDir = fullfile(pwd, ['Periodogram' '_c6000_rtw']); OutFile = fullfile(CodegenDir, ['Periodogram' '.out']); %load the model to the DSK:CCS_Obj.load(OutFile,20); handles.CCS_Obj=CCS_Obj;handles.output = hObject; %remember the current model:handles.last_model=1; CCS_Obj.run;% Update handles structure guidata(hObject, handles);
  7. Selecting a new model: %1. halts the current model %2. loads the current model%inputs: %m - 3 levels flag that tells which model to load.%CCS_Obj - the target object function ChangeModel(m,CCS_Obj)CCS_Obj.halt; switch mcase 1 model='Periodogram';case 2 model='Burg';case 3 model= 'MCov_AR';end CodegenDir = fullfile(pwd, [model '_c6000_rtw']); OutFile = fullfile(CodegenDir, [model '.out']); CCS_Obj.load(OutFile,20);CCS_Obj.run; if last_y~=15000r.writemsg(chan_struct(2).name,1/last_y); end
  8. When the user changes the model, the list-box handler function is invoked: function listbox1_Callback(hObject, eventdata, handles) handles.last_model=get(hObject,'Value') ;ChangeModel(handles.last_model,handles.CCS_Obj); guidata(hObject, handles);

The handler saves the new model as the current model and invokes the change model function we described above.

Now you can run the model, and observe the results in the oscilloscope for the various estimators.

Questions & Answers

Discuss the differences between taste and flavor, including how other sensory inputs contribute to our  perception of flavor.
John Reply
taste refers to your understanding of the flavor . while flavor one The other hand is refers to sort of just a blend things.
Faith
While taste primarily relies on our taste buds, flavor involves a complex interplay between taste and aroma
Kamara
which drugs can we use for ulcers
Ummi Reply
omeprazole
Kamara
what
Renee
what is this
Renee
is a drug
Kamara
of anti-ulcer
Kamara
Omeprazole Cimetidine / Tagament For the complicated once ulcer - kit
Patrick
what is the function of lymphatic system
Nency Reply
Not really sure
Eli
to drain extracellular fluid all over the body.
asegid
The lymphatic system plays several crucial roles in the human body, functioning as a key component of the immune system and contributing to the maintenance of fluid balance. Its main functions include: 1. Immune Response: The lymphatic system produces and transports lymphocytes, which are a type of
asegid
to transport fluids fats proteins and lymphocytes to the blood stream as lymph
Adama
what is anatomy
Oyindarmola Reply
Anatomy is the identification and description of the structures of living things
Kamara
what's the difference between anatomy and physiology
Oyerinde Reply
Anatomy is the study of the structure of the body, while physiology is the study of the function of the body. Anatomy looks at the body's organs and systems, while physiology looks at how those organs and systems work together to keep the body functioning.
AI-Robot
what is enzymes all about?
Mohammed Reply
Enzymes are proteins that help speed up chemical reactions in our bodies. Enzymes are essential for digestion, liver function and much more. Too much or too little of a certain enzyme can cause health problems
Kamara
yes
Prince
how does the stomach protect itself from the damaging effects of HCl
Wulku Reply
little girl okay how does the stomach protect itself from the damaging effect of HCL
Wulku
it is because of the enzyme that the stomach produce that help the stomach from the damaging effect of HCL
Kamara
function of digestive system
Ali Reply
function of digestive
Ali
the diagram of the lungs
Adaeze Reply
what is the normal body temperature
Diya Reply
37 degrees selcius
Xolo
37°c
Stephanie
please why 37 degree selcius normal temperature
Mark
36.5
Simon
37°c
Iyogho
the normal temperature is 37°c or 98.6 °Fahrenheit is important for maintaining the homeostasis in the body the body regular this temperature through the process called thermoregulation which involves brain skin muscle and other organ working together to maintain stable internal temperature
Stephanie
37A c
Wulku
what is anaemia
Diya Reply
anaemia is the decrease in RBC count hemoglobin count and PVC count
Eniola
what is the pH of the vagina
Diya Reply
how does Lysin attack pathogens
Diya
acid
Mary
I information on anatomy position and digestive system and there enzyme
Elisha Reply
anatomy of the female external genitalia
Muhammad Reply
Organ Systems Of The Human Body (Continued) Organ Systems Of The Human Body (Continued)
Theophilus Reply
what's lochia albra
Kizito
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




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?

Ask