how to output last sample of every 16 samples

7 visualizaciones (últimos 30 días)
byb
byb el 10 de Sept. de 2018
Comentada: Walter Roberson el 18 de Sept. de 2018
I have to store 16 samples of ADC output and then use only last sample of every 16 sample to be the display on scope, How I do it in Simulink only please???
I have used buffer to create store the 16 samples and the took average to display only one signal in scope but that is not as accurate as it would be to get last signal for every 16 signal to be displayed.

Respuesta aceptada

Walter Roberson
Walter Roberson el 15 de Sept. de 2018
You can potentially convert your samples into frames and then index into the frames https://www.mathworks.com/help/dsp/ug/sample-and-frame-based-concepts.html or you can downsample the frame. Or you can just downsample or here

Más respuestas (1)

JohnGalt
JohnGalt el 10 de Sept. de 2018
Not sure if I understand the question correctly but if you have an array
myArray = 1:81;
you can get every 16th value using:
myArray(16:16:end) % gives answer: = 16 32 48 64 80
the notation is (startingIndex:stepSize:lastIndex)
  1 comentario
Walter Roberson
Walter Roberson el 18 de Sept. de 2018
Normally Yes, but this turns out to be a Simulink question.

Iniciar sesión para comentar.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by