Resample produces unexpected vector length

1 回表示 (過去 30 日間)
Alexis
Alexis 2021 年 8 月 7 日
コメント済み: Alexis 2021 年 8 月 7 日
I have two vectors of simultaneously recorded physiological signals, one is sampled at 20 kHz and the other at 1 kHz. I'd like to sample the latter upwards so they can be analysed together.
Length of the 20 kHz vector = 1228446
Length of the 1 kHz vector = 61423
1228446 / 61423 = 20
Makes sense to me! But the command
resample(1kHzSignal,20,1);
Returns a vector with length = 1228460, not 1228446. What am I missing? It's late here, so pointing out the obvious is appreciated.

採用された回答

Dave B
Dave B 2021 年 8 月 7 日
I think the error is in your arithmetic (?)
1228446 / 61423
ans = 19.9998
1228460 / 61423
ans = 20
  1 件のコメント
Alexis
Alexis 2021 年 8 月 7 日
Thanks, I just realised I had
format bank
turned on. Obvious is pointed out!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by