Unexpectred results using Mod and Unwrap
Show older comments
I was playing with the Unwrap function when I noticed some unexpected results when working with a phase angle in degrees instead of radians.
The unwarp function unwarps a signal by adding or subtracting a multiple of 2*x. So, in theory unwarp(signal,x) and mod(signal, 2*x) should cancel eachother. This is true for x=pi, but does not seem to hold for any other number. See the example below:
x = pi; % x=pi : ok, x=4 : trouble
% Make some random numbers
signal = 2*x*rand(1,1000);
% Mod(signal,2*x) should be equal to Mod(unwrap(signal,x),2*x)
plot(mod(signal,2*x), mod(unwrap(signal,x),2*x));
Can anybody tell me what I'm missing?
Accepted Answer
More Answers (1)
Ruben de Bruin
on 23 Oct 2012
0 votes
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!