フィルターのクリア

Remove elements from vector to change the sampling rate

1 回表示 (過去 30 日間)
marcusbarnet
marcusbarnet 2018 年 1 月 2 日
コメント済み: marcusbarnet 2018 年 1 月 10 日
Hi to all,
I have a vector " imu" with a size of 11497 elements. These elements are samples captured at a very high rate (the total time is 71 seconds so I think the frequency is about 160 Hz). Since I acquired all the other values at 10Hz, the size of all my other vectors is 719.
I would like to remove the oversampled elements from the vector " imu" in order to have only 10 samples per second.
Is there any way to do this? Can you help me, please?
  2 件のコメント
Gaurav Ahuja
Gaurav Ahuja 2018 年 1 月 9 日
Could you provide more clarification on this:- 1.) do you wish to make an application that would achieve this? 2.) or do you already have "imu" vector and now wish to get the required data?
For the 1st case, you would need to write a custom logic for doing so. If you are using Simulink, you could use rate transition block to achieve something like this.
For 2nd case, write a custom logic to store the 'n'th element into another vector. Refer the following code for a better understanding.
if true
a = magic(4)
b = a(1:16) % this vector is similar to "imu"
c=b(4:4:16) % accepting every 4th elecment.
end
Hope this helps.
marcusbarnet
marcusbarnet 2018 年 1 月 10 日
Thank you, Gaurav! It was the second case and your solution worked fine for me!

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

回答 (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