Re: Phase Unwrapping Algorithms? [message #7451 is a reply to message #7450] |
Wed, 20 November 1996 00:00  |
Sergei Senin
Messages: 23 Registered: February 1996
|
Junior Member |
|
|
William Ryu wrote:
> Let's say we have a 2D matrix of complex data a+bi and would like to
> extract the phase value. A simple way would be to take arctan (b/a) but a
> problem exists because arctan is modulo 2PI. The data often gets
> "wrapped."
Time domain phase unwrapping:
K.W.Wan, J. Austin, E. Vilar, "A Novel Approach to the Simultaneous
Measurement
of Phase and Amplitude Noise of Oscillators', 44th Ann. Symp. on Freq.
Control,
Baltimore, USA, May 1990, 5p."
For fractional phase calculations (Sorry, the programs are not exactly
very well written)
;----------------------------------------------------------- ----
;fract_phas.pro
;----------------------------------------------------------- ----
;+
; NAME: fract_phas
; PURPOSE: Calculates fractional phase (phase difference between i and
i+1
; samples) for the input IQ array
; CATEGORY: Signal Processing
; CALLING SEQUENCE: y=fract_phas(x)
; INPUTS: x- two dimensional array, x(0,*) - I signal , x(1,*) - Q
signal
; MODIFICATION HISTORY:
; ss@.ee.port.ac.uk on Wed Mar 6 09:58:10 GMT 1996 , UoP, MT&SPRG
;-
;----------------------------------------------------------- ----
; fract_phas.pro start line
;----------------------------------------------------------- ----
function fract_phas, x
y=imaginary(alog((complex(x(0,*), x(1,*)))* $
(shift(complex(x(0,*), -x(1,*)), 0, 1))))
nn=n_elements(y)
y=reform(y,nn)
y=double(y)
;y(0)=0.0d
return, y
end
;----------------------------------------------------------- ----
; fract_phas.pro stop line
;----------------------------------------------------------- ----
For phase curve:
;----------------------------------------------------------- -----------
;phas_sum.pro
;----------------------------------------------------------- -----------
;+
; NAME: phas_sum
; CATEGORY: Signal Processing
; CALLING SEQUENCE:c6 = phas_sum(c5)
; INPUTS: c5 - output from fract_phas
; OUTPUTS: c6 - phase curve with trend
; MODIFICATION HISTORY:
; ss@.ee.port.ac.uk on Mon Apr 15 12:34:26 BST 1996
;-
;----------------------------------------------------------- -----------
;phas_sum.pro start line
;----------------------------------------------------------- -----------
function phas_sum, c5, c6
c6=fltarr(n_elements(c5))
c6(0) = c5(0)
for i = 1L, n_elements(c5)-1L do begin
c6(i) = c6(i-1) + c5(i)
endfor
return, c6
end
;----------------------------------------------------------- -----------
;phas_sum.pro stop line
;----------------------------------------------------------- -----------
Cheers
Sergei
http://www.ee.port.ac.uk:80/~ss-www/WAVE/index.html
|
|
|