Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Elimination of transition portion of a sampled logical channel

1 view (last 30 days)
Hi all,
I have some sampled signals measured from the CAN-Bus. It's a logical channel, it ranges from 0 to 12, only integer numebers are allowed. Unfortunately the signals is sequential so during a transition from a state to another one it assumes all values included between them. So if the real signal should be A=[zeros(1,100) 5*ones(1,4000) 2*ones(1,500)], it's equal to B=[zeros(1,100) 1 2 3 4 5 6 7 8 9 10*ones(1,4000) 9 8 7 6 5 4 3 2*ones(1,6000)]. The problem is a bit more complex because in some conditions, the transition is sligthly slower so some values in between two states are repeated, so it might be: C=[zeros(1,100) 1 2 2 2 3 4 5 6 6 6 7 8 9 10*ones(1,4000) 9 8 7 7 7 7 6 5 4 4 4 4 3 2*ones(1,6000)]. There should be less than 10 reapeted numbers during a state transition.
I need to compute the array A from the array C. How could I do it without using any loop because the signals are quite big?
Thanks is advance
Cheers
Pietro

Answers (0)

This question is closed.

Products

Community Treasure Hunt

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

Start Hunting!