how can I convert one square wave to impulses ?
1 回表示 (過去 30 日間)
古いコメントを表示
I have the following picture and I want to convert it to impulse for counting how many picks there are. How can I count this picks ? , forexample # 4 for this picture .

0 件のコメント
採用された回答
Mischa Kim
2014 年 3 月 12 日
編集済み: Mischa Kim
2014 年 3 月 12 日
Onur, you could simply take the derivative of the signal, provided that it is somewhat well behaved. See example below:
t = 0:0.1:20;
x = square(t,5) + 0.1*rand(1,length(t)); % noisy square wave
val = +1; % deriv treshold value
num = length(find(diff(x)>val)); % data points with deriv > threshold
disp(num)
plot(t,x)
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!