# Unwrap Signal

This example shows how to use the Unwrap block to unwrap a 3-by-2-by-3 array that has discontinuity.

Each 3-by-2 frame of the signal has a discontinuity. In the first frame, there is a discontinuity between the second and the third element greater than the tolerance of set in the block parameters. In the second frame, the discontinuity between the second and third element is less than , and in the third frame, the discontinuity is equal to . Since we expect the block to wrap signals with discontinuities greater than the tolerance, unwrapping the signal does not affect the second or third frame.

model = "ex_unwrap"; open_system(model); frame1 = [0 0; 2*(pi)/3 0; -2*(pi)/3 0]; frame2 = [2*pi 0; 8*pi/3 0; 9.5*pi/3 0]; frame3 = [4*pi 0; 13*pi/3 0; 16*pi/3 0]; signal = cat(3,frame1,frame2,frame3) 
signal(:,:,1) = 0 0 2.0944 0 -2.0944 0 signal(:,:,2) = 6.2832 0 8.3776 0 9.9484 0 signal(:,:,3) = 12.5664 0 13.6136 0 16.7552 0 

The Tolerance parameter of the Unwrap block is set to . The block therefore unwraps discontinuities which are larger than .

Run the model.

output = sim(model); 

See that the output, output.unwrapped_signal does not have the first discontinuity, but the other two remain.

output.unwrapped_output 
ans = 0 0 2.0944 0 4.1888 0 6.2832 0 8.3776 0 9.9484 0 12.5664 0 13.6136 0 16.7552 0