简体   繁体   中英

How to find the minimum value of signal?

I have the message signal of s(t) and I know the code of finding the minimum of signal min(s) .

If t > 2 , s(t) will be equal to 0 .

How can I find the minimum value of s(t) within 2 second?

I need to plot conventional AM signal, I have message signal s(t) and module signal, and the s(t) is equal to 0 when t > 2 , now I need to calculate the minimum value of s(t) for calculating the Ac value.

If I'm reading this right, you want to restrict the space in which you are searching for the minimum. You can use logical indexing to do this.

timevector = 1:10000; %in ms
signal = randi(1000, 10000, 1);
signal(2000:10000) = 0;

log_signal = timevector < 2000;
constrained_signal = signal(log_signal);
minimum = min(constrained_signal);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM