Count rising edge in wave
古いコメントを表示
Hello,
I have the wave data in csv file which contains the time and the corresponding value.
I can plot the wave in matlab to see that it is ok.
However, I would like to count the rising edges of the wave.
I tried using simulink these are the steps I took
1. After CSVread, I saved the data in a .mat file.
2. I tried to read the signal using the 'From File' in simulink.
3. The output of the 'From File' was sent to Scope. (This I did just to make sure I am using the 'From File' correctly)----------It gave me error.
4. I also sent the output of 'From File' to Detect Rise positive----------It gave me error.
Please advice me on what to do to.
NB, I wrote a simple code that counts, but I somehow do not trust myself.
If there are other was of doing it, I would like to know.
Thanks
2 件のコメント
Star Strider
2015 年 5 月 4 日
Please attach your .mat file. We can’t help unless we know what your data are.
kyin gab
2015 年 5 月 4 日
採用された回答
その他の回答 (1 件)
Jonathan
2016 年 3 月 16 日
0 投票
Star's solution worked a treat for me. Previously I was using a loop to check each bit individually to see if it was less than the subsequent bit, in order to find the index locations corresponding to my clock rising edge times.
The output is almost exactly the same for the two methods, but Star's solution takes a few seconds, as opposed to a few minutes, for my large (10 million sample) data set! Perfect, thanks :)
1 件のコメント
Star Strider
2016 年 3 月 16 日
As always, my pleasure!
I appreciate your compliment!
カテゴリ
ヘルプ センター および File Exchange で Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!