How do I find the peak of a signal and the time of peak?

3 ビュー (過去 30 日間)
Tanay Kumar
Tanay Kumar 2022 年 9 月 21 日
回答済み: Kiran Kintali 2022 年 9 月 25 日
I am trying to implement a model in simulink in which I need to identify the magnitude and time of the occurance of the peak (max magnitude) for a time varying discrete signal. I can not use a buffer because it does not have HDL support. I tried using MinMax Running Resettable block but that only gives the magnitude and not the time. Any idea how can I do this?
Thanks in advance!


Timo Dietz
Timo Dietz 2022 年 9 月 21 日
編集済み: Timo Dietz 2022 年 9 月 21 日
if you are already able to catch the 'max', just attach a 'Detect Change' block to it and apply this output to a triggered subsystem. (The subsystem contains just a connection from input to output.)
The input of the subsystem should now be connected to a 'Clock' block. Thus, the output delievers the current clock value, each time a new max has been detected.
Btw, for the max detection you can just use a 2-input max block. One input connected to the signal and the second to the max blocks output via a unit delay block - as feedback.
Does this solve your issue?
  4 件のコメント
Timo Dietz
Timo Dietz 2022 年 9 月 21 日
編集済み: Timo Dietz 2022 年 9 月 21 日
Concerning the three last peaks:
Provided that a got your point, you can just attach unit delay blocks to your current max value and stored Clock (both outputs of the triggered subsystem block in the second solution I described).
Attach the outputs of the delay blocks to the inputs of a second triggered subsystem (copy of the first).
Again, these outputs to the inputs of a third subsystem.
The trigger inputs for the subsystems are all the same.
The subysystems outputs should deliver the last three value/time pairs.


その他の回答 (1 件)

Kiran Kintali
Kiran Kintali 2022 年 9 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by