Borrar filtros
Borrar filtros

Remove elements from vector to change the sampling rate

1 visualización (últimos 30 días)
marcusbarnet
marcusbarnet el 2 de En. de 2018
Comentada: marcusbarnet el 10 de En. de 2018
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 comentarios
Gaurav Ahuja
Gaurav Ahuja el 9 de En. de 2018
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 el 10 de En. de 2018
Thank you, Gaurav! It was the second case and your solution worked fine for me!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matched Filter and Ambiguity Function en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by