Remove elements from vector to change the sampling rate

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matched 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