Unwrap function not operating correctly

8 vues (au cours des 30 derniers jours)
Nikolaos Zafirakis
Nikolaos Zafirakis le 26 Sep 2019
Modifié(e) : Stephen23 le 27 Sep 2019
B = (:,1:3);
C = (:,4); % Group packets restart at 0 and finish at a specific number
group = cumsum(C == 0) + double(C(1) ~= 0); % Splits the groups further
% into ones then twos then therees etc...
% [1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 4 4 4]'
Bb = splitapply(@(m) {(unwrap(m/2^15*pi)*2^15/pi)}, B, group); % Splits the groups up and performs the
% caculation unwrap(m/2^15*pi)*2^15/pi
Original output input at B
The result of the algorithm can be seen below. Unfortunately, it is not operating correctly as it has a drift in the y-direction. Can anyone provide any insight into how to correct this code?
  4 commentaires
Guillaume
Guillaume le 27 Sep 2019
Modifié(e) : Guillaume le 27 Sep 2019
Unless, I'm missing something, it seems to work correctly with your example data. This is the output I get:
R2019b (please enter your version to the right of the question).
Nikolaos Zafirakis
Nikolaos Zafirakis le 27 Sep 2019
Modifié(e) : Nikolaos Zafirakis le 27 Sep 2019
Hello Guilaume, sorry in the figure I provided,
C =[2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;2;3;3;3;3;3;3;4;4;4;4;4;4;4;4;4;4;4;4]
To break it up further.
Regarding the values the yellow and blue data lines should not surpass +-60000. The red you have plotted is correct, however the yellow and blue have drifted out of the range required. Thus, by splitting the values up further I got a something solution closer to the truth but now the red value has drifted.
I have MATLAB R2019b for some reason it does not let me input it on the web page.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Historical Contests dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by