Targeting specific samples and extracting the data from the that signal
Show older comments
I have a frequency signal which is the output of a subsystem in Simulink (I have attached an image how the signal looks like and also the subsystem from which this signal appears an output). I want to extract data from this signal i.e System_Freq signal whenever this signal starts decreasing until it reaches a point let say 49.7 Hz or in other words I want to target the samples surrounding the frequency excursion which is also shown by the dotted blue window in the image (Frequency_signal) attached. Any suggestions?
Answers (2)
Pravarthana P
on 2 Dec 2022
0 votes
I understand you are trying to extract the data from Simulink signal, the following workaround may help you to perform the desired function:
- Configuring the signal to be exported to workspace by right clicking on the signal and selecting “log selected signals”. More customization on how the signal has to be logged can be done in "Data Import/Export" section of Configuration parameters. For more information refer to the following documentation:
- By using "To Workspace" block the signal can be logged into Workspace and subsequently to a MAT file. To learn more about this block refer to the following documentation:
Once, the signal is logged the required frequency operation can be done by using a programmatic approach. The following MATLAB answer could be referred for extracting the requried frequency:
1 Comment
Taimoor Khan Mehmand
on 2 Dec 2022
Edited: Taimoor Khan Mehmand
on 2 Dec 2022
Pravarthana P
on 9 Dec 2022
0 votes
I understand that you are trying to find the “Rate of Change of Signal” using a Simulink block, the following workaround may help you:
The Derivative block approximates the derivative of the input signal u with respect to the simulation time t Thereby, by passing the signal of interest through the Derivation block the rate of change of the signal might be obtained. For more information on the Derivative block, the following documentation link may be helpful:
Hope this information helps you!
Categories
Find more on Simulink in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!