on 9/24/05 7:44 PM, Doug Stewart at address@hidden wrote:
Ron Crummett wrote:
Hi -
I have a recent problem with unwrap; I tried plotting the phase of a
transfer function and it jumped halfway through the plot, from -180 to
180. I tried to unwrap the phase using unwrap and plotted the phase
again, but still had the same jump. Reading the help on unwrap, it
sounds like it will only really work if the phase is positive (it adds
2*pi). For me, I have a negative phase, so I need to subtract 2*pi.
Any idea of what the solution could be? I tried looking at the code
but couldn't make too much sense out of it from my few glances.
Thanks,
Ron Crummett
# fix the phase wrap arownd
ll=length(ph);
[qm iqm]=max(abs(diff(ph)));
if(qm>300)
ph(iqm+1:ll)=ph(iqm+1:ll)-360;
endif
Ron, Doug,
My experience with an alternative (Stearns and David, Signal Processing
Routines in Matlab, which is compatible with Octave) is that the phase
unwrap routines are good for 2*pi+, but then get confused. Maybe a more
robust version of unwrap is in order with an "if" (or some such) to check
the curve continuation.
Joe