faq214
DESCRIPTION
dspaceTRANSCRIPT
-
dSPACE FAQ 214
Displaying the results of an FFT with ControlDesk FAQ Version: 5 / 2013-09-03 Page 1
FAQ 214
Displaying the results of an FFT with ControlDesk
Keywords
FFT; display spectral data; Table Editor; ControlDesk; visualization; plot a vector
Question
How can I display the result of an FFT or similar data versus a frequency vector?
Solution
ControlDesk does not provide a specific instrument to display spectral data, for instance the result of an FFT. However, you can use a Table Editor instrument for this purpose.
Please note that the following information describes only a workaround. The Table Editor is generally used to work with characteristic curves and characteristic maps.
The described method can also be used to simply display the data of a vector signal under ControlDesk. In this case it is not necessary to provide data for the X-axis. In ControlDesk NG (since version 4.1) you can simply drop the measurement vector or 2D measurement array to a layout and have the signal automatically connected to the default instrument, the Table Editor
Prerequisites
The Simulink model must provide a vector signal both for the calculation result and for the frequency
values (abscissa). For further information about the abscissa see below (Calculating the Frequency Vector).
Step-by-step Instructions for ControlDesk 3.x
1. Insert a Table Editor instrument in a ControlDesk layout.
2. Drag the Frequency Vector variable to the X row of the Table Editor table with the right mouse key.
When you drop the variable, a pop-up menu is displayed. From this menu, select Custom Connection...
3. In the following dialog select the System -> System:Poll event and close the window
with the Finish button.
4. Drag the FFT result vector to the Table Editor table with the right mouse key.
From the pop-up menu, select Custom Connection... again and then the System:Poll
event in the dialog.
5. Switch to the Animation mode.
The Custom Connection for the System:Poll event results in continuous updating of the Table Editor contents. If you dragged the variables with the left mouse key as usual, you would have to press the Upload button of the Table Editor each time to update the displayed data.
6.
-
dSPACE FAQ 214
Displaying the results of an FFT with ControlDesk FAQ Version: 5 / 2013-09-03 Page 2
Step-by-step Instructions for ControlDesk NG
1. Insert a Table Editor instrument in a ControlDesk layout.
2. Drag the Frequency Vector variable to the X row of the Table Editor table
3. Drag the FFT result vector to the Table Editor table
4. Start Online calibration or measurement.
When starting online calibration, the data is updated by the variable observer (every 250ms until ControlDesk NG 4.3, every 100ms from ControlDesk NG 5.0 on). When starting the measurement, the data is updated with the selected measurement raster. Mind the bandwidth.
Calculating the Frequency Vector
Typically the FFT blocks output only the result vector of the calculation but not the corresponding abscissa values. Thus the model must provide an additional signal representing the Frequency Vector. You can simply use a Constant block to create this signal, which you then connect to a Terminator block. The following example shows how the frequency values must be calculated. They depend on the model step size and the number of FFT points.
Step size = 100us => f_sample = 10kHz
FFT points = 1024
FFT interval width = 1/10kHz * 1024 = 0.1024s
Frequency resolution of FFT = 1/0.1024s = 9.765625 Hz
Frequency Vector with 1024 elements => Vf = [9.765625, 19.53125, ... , 10000]
You can of course also enter a MATLAB expression in the Constant block:
Vf = [9.765625 :9.765625: 10000]
If the FFT block also outputs the constant component of the analyzed signal, the Frequency Vector must have an additional element for "frequency zero": Vf =[0 :9.765625: 10000]
Related FAQs
-
dSPACE FAQ 214
Displaying the results of an FFT with ControlDesk FAQ Version: 5 / 2013-09-03 Page 3
How to Contact dSPACE Support
dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany
++49 5251 1638-941
mailto:[email protected] http://www.dspace.com/support
dSPACE recommends that you use the support request form on the Internet to contact dSPACE Support. It is available at:
http://www.dspace.com/go/supportrequest
Software Updates and Patches
dSPACE strongly recommends that you download and install the most recent patches for your current dSPACE installation. Visit http://www.dspace.com/go/patches for software updates and patches.
FAQ
FAQ documents are available at http://www.dspace.com/go/faq.
Important Notice
This document contains proprietary information that is protected by copyright. All rights are reserved. Neither the documentation nor software may be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable form, in whole or in part, without the prior written consent of dSPACE GmbH.
Copyright 2013 by:
dSPACE GmbH Rathenaustrae 26 33102 Paderborn Germany
This publication and the contents hereof are subject to change without notice.
A list of registered dSPACE trademarks is available at: http://www.dspace.com/go/Trademarks
FAQ 214Displaying the results of an FFT with ControlDeskKeywordsQuestionSolutionPrerequisitesStep-by-step Instructions for ControlDesk 3.xStep-by-step Instructions for ControlDesk NGCalculating the Frequency Vector
How to Contact dSPACE Support