xref: /aosp_15_r20/external/webrtc/tools_webrtc/matlab/maxUnwrap.m (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1*d9f75844SAndroid Build Coastguard Workerfunction sequence = maxUnwrap(sequence, max)
2*d9f75844SAndroid Build Coastguard Worker%
3*d9f75844SAndroid Build Coastguard Worker% sequence = maxUnwrap(sequence, max)
4*d9f75844SAndroid Build Coastguard Worker% Unwraps when a wrap around is detected.
5*d9f75844SAndroid Build Coastguard Worker%
6*d9f75844SAndroid Build Coastguard Worker% Arguments
7*d9f75844SAndroid Build Coastguard Worker%
8*d9f75844SAndroid Build Coastguard Worker% sequence: The vector to unwrap.
9*d9f75844SAndroid Build Coastguard Worker% max: The maximum value that the sequence can take,
10*d9f75844SAndroid Build Coastguard Worker%      and after which it will wrap over to 0.
11*d9f75844SAndroid Build Coastguard Worker%
12*d9f75844SAndroid Build Coastguard Worker% Return value
13*d9f75844SAndroid Build Coastguard Worker%
14*d9f75844SAndroid Build Coastguard Worker% sequence: The unwrapped vector.
15*d9f75844SAndroid Build Coastguard Worker%
16*d9f75844SAndroid Build Coastguard Worker
17*d9f75844SAndroid Build Coastguard Worker% Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
18*d9f75844SAndroid Build Coastguard Worker%
19*d9f75844SAndroid Build Coastguard Worker% Use of this source code is governed by a BSD-style license
20*d9f75844SAndroid Build Coastguard Worker% that can be found in the LICENSE file in the root of the source
21*d9f75844SAndroid Build Coastguard Worker% tree. An additional intellectual property rights grant can be found
22*d9f75844SAndroid Build Coastguard Worker% in the file PATENTS.  All contributing project authors may
23*d9f75844SAndroid Build Coastguard Worker% be found in the AUTHORS file in the root of the source tree.
24*d9f75844SAndroid Build Coastguard Worker
25*d9f75844SAndroid Build Coastguard Workersequence = round((unwrap(2 * pi * sequence / max) * max) / (2 * pi));
26