The output of function resample shows a signal with peaks unexpected
4 ビュー (過去 30 日間)
古いコメントを表示
Hello everybody,
I have a issue, the resample function is supposed to give you a rough signal with new data added. But in my case, for instance, the two first adjacent samples have almost the same value, in other words are constant in tim; and it is supposed the aproximation signal at the beginning should show a serial points with the same value.
Here is the issue. The resampled output signal shows a peak curve at the begining. The data points are sampled irregularly, so the arrangement of the points are not spaced equally in time. The average of period that I calculated is 0.051 s. But from the source of data tells me that they was sampled with 0.034 s. So for that reason I've tried get a new signal with estimated added points as shown in the picture below. I want to understand why it happens and/or how to solve it. Thank you.
realPeriod=34e-3;% Check-in
[newMag, newTime] = resample(magAxis_xyz{1}(2,:), magTime{1}', 1/realPeriod, 1, 1, 'spline');

Original signal

0 件のコメント
採用された回答
Star Strider
2020 年 5 月 10 日
‘...the resample function is supposed to give you a rough signal with new data added.’
I am not certain of the specific syntax you are using with resample, and particularly what those variables are. However, the resample function only interpolates the input data to a new time vector (it does not actually ‘add’ anything else, and uses an anti-aliasing filter to prevent problems associated with the interpolation), usually defined by the sampling frequency argument and produces an accurate (not ‘rough’) interpolation. You are also using the 'spline' interpolation method, and that can have unpredictable results with step transitions such as exist at the beginning of your signal, and noise that exists in much of the rest of it. I always use the default 'linear' method, and have always been pleased with the results.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!