pulsewidth not working with higher sampling rates?

15 ビュー (過去 30 日間)
Eric Kuebler
Eric Kuebler 2019 年 11 月 6 日
コメント済み: Daniel M 2019 年 11 月 6 日
I have a waveform like this:
And I would like to know the width of this spike at half height, a nice function to do so is pulsewidth (thank you Daniel M!!). Since the waveform is originally sampled at 200 kHz, I tried running pulsewidth using this code:
figure
pulsewidth(x,2e5);
This is the output:
There is no pulse width identified.
Now I resample the waveform at 50 kHz and run pulsewidth again using the following code:
x = resample(x,5e4,2e5);
figure
pulsewidth(x,5e4);
And here is my pulsewidth clearly identified:
Anyone know why this would not work at 200 kHz; but work at 50 kHz?
BTW I've also tried using a time-stamped vector for input instead Fs; but get the same exact output. Also tried adding the statelevels for max and min values on this trace.
Thank you in advance!!
Eric
  3 件のコメント
Eric Kuebler
Eric Kuebler 2019 年 11 月 6 日
I actually didn't notice that the function identified the post-peak portion as the lower state with the 200kHz waveform.
Perhaps the edge effects in the 50 kHz waveform has something to do with the function picking the pre-peak portion as lower state?
Sorry about posting two questions, I suppose I could have posted in the other question; but wasn't sure the answer would be overlapping.
Thank you!
Daniel M
Daniel M 2019 年 11 月 6 日
Yes, probably because of the edge effects. Try to deal with those. My proposed solution also seems like it would be robust to the edge effects, but I can't test that.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by