How do I find the peak of a signal and the time of peak?
9 views (last 30 days)
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 on 21 Sep 2022
Edited: Timo Dietz on 21 Sep 2022
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?