Unwrap with tolerance other than default (=pi)
    11 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    pSchi
 il 22 Mar 2017
  
    
    
    
    
    Commentato: Bryan Wingert
 il 16 Lug 2024
            I encountered a problem with the Matlab function “unwrap” when I tried to unwrap the phase of a signal with a jump tolerance other than pi. I used the following phase for testing the behavior of the “unwrap” function:
phs  = [0.1, 0.2, 0.3, 0.4, 0.4+pi-0.1, 0.4+pi-0.05, 0.4+pi-0.01];
There is a jump in the phase angle between elements four and five that is smaller than pi. I then tried to eliminate this jump using the “unwrap” function and the tolerance pi/2:
phs = unwrap(phs,  pi/2);
The phs vector didn’t change. It also didn’t change by using any other value for the tolerance. Shouldn’t it eliminate the jump by adding +/- 2pi or by adding +/- pi/2?
2 Commenti
  Bryan Wingert
 il 16 Lug 2024
				I know I'm resurrecting a dead thread, but this aspect of the unwrap function frustrated me. See this answer for an explanation of why this hack works, and how to adapt it.
Risposta accettata
  David Goodmanson
      
      
 il 25 Mar 2017
        Hello pSchi, from 'doc unwrap':
Note A jump tolerance less than π has the same effect as a tolerance of π. For a tolerance less than π, if a jump is greater than the tolerance but less than π, adding ±2π would result in a jump larger than the existing one, so unwrap chooses the current point. If you want to eliminate jumps that are less than π, try using a finer grid in the domain.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Multirate Signal Processing in Help Center e File Exchange
			
	Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!