How can I calculate value of a signal (using MATLAB Function block of Simulink) between two time instants i.e. between 5.04 s to 5.25 s?

2 ビュー (過去 30 日間)
Actually I have a signal (figure attached) which is a frequency signal and that signal would be input to the " MATLAB Function block of Simulink" . So this input signal is not a vector, it is just a one dimension signal of 50Hz value and the value changes at 5 seconds because there is a disturbance event at 5 seconds. So eventually , I want to find the value between 5.04s to 5.25s (which is actually the rate of change of this signal between 5.04s to 5.25s). Also I don't know how many samples do I need to take between 5.04s to 5.25s in order to have accurate rate of change of this signal. Can anyone please guide or anyone have any idea how to do this using MATLAB Function block of the Simulink?
  1 件のコメント
Mathieu NOE
Mathieu NOE 2023 年 1 月 2 日
hello
why not using a buffer block to store the samples (for a duration of 0.2 s) then use the math block with mean(diff(u))
NB : your solver must use fixed time steps dt
the output of the math block then needs to be divided by dt to get the average slope of the frequency signal
a simpler alternative (IMHO) is to use a first order high pass filter (used as a frequency limited derivator).

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by