フィルターのクリア

How create enable signal ?

1 回表示 (過去 30 日間)
Henry Buck
Henry Buck 2015 年 12 月 26 日
回答済み: Walter Roberson 2015 年 12 月 26 日
Hi,
I want to second signal that depend on first signal like an enable signal. There is a counter that running while the first signal appears and after it reaches value(cnt=21), the second signal should create.
Can anyone guide me how to do it ?
Thanks a lot,
Henry
  2 件のコメント
Jan
Jan 2015 年 12 月 26 日
I do not understand the question. Please edit it to make it more clear.
Image Analyst
Image Analyst 2015 年 12 月 26 日
Henry, are you still there? Please read this and improve your post so people can help you.

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

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 26 日
gated_signal(counter) = second_signal(counter) .* (counter >= 21);
The above is for the case where the second signal is to "run" all of the time but the output is to be suppressed until the counter is 21.
If you have the entire second_signal array ahead of time then you can use
gated_signal = second_signal;
gated_signal(1:20) = 0;
If you have the entire second_signal array ahead of time but it is to be delayed by 20 then
gated_signal = zeros(1, length(second_signal) + 20);
gated_signal(21:end) = second_signal;
If you are producing signals one at a time and the second signal is not to start until the counter reaches 21 then
if counter >= 21
gated_signal = second_signal(counter-20);
else
gated_signal = 0;
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSignal Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by