This is where navigation should be.

GABPHASEDERIV - DGT phase derivatives

Usage

[phased,c] = gabphasederiv(dflag,'dgt',f,g,a,M);
phased    = gabphasederiv(dflag,'cross',f,g,a,M)
phased    = gabphasederiv(dflag,'phase',cphase,a);
phased    = gabphasederiv(dflag,'abs',s,g,a,difforder);
[{phased1,phased2,...}] = gabphasederiv({dflag1,dflag2,...},...);
[{phased1,phased2,...},c] = gabphasederiv({dflag1,dflag2,...},'dgt',...);

Description

phased=gabphasederiv(dflag,method,...) computes the time-frequency derivative dflag of the phase of the dgt of a signal using algorithm method.

The following strings can be used in place of dflag:

't' First phase derivative in time.
'f' First phase derivative in frequency.
'tt' Second phase derivative in time.
'ff' Second phase derivative in frequency.
'tf' or 'ft Second order mixed phase derivative.

phased is scaled such that (possibly non-integer) distances are measured in samples. Similarly, the frequencies are scaled such that the Nyquist frequency (the highest possible frequency) corresponds to a value of L/2.

The computation of phased is inaccurate when the absolute value of the Gabor coefficients is low. This is due to the fact the the phase of complex numbers close to the machine precision is almost random. Therefore, phased attain very large random values when abs(c) is close to zero.

The phase derivative computation can be done using four different methods depending on the string method:

'dgt' Directly from the signal using algorithm by Auger and Flandrin.
'cross' Directly from the signal using algorithm by Nelson.
'phase' From the unwrapped phase of a DGT of the signal using a finite differences scheme. This is the classic method used in the phase vocoder.
'abs' From the absolute value of the DGT exploiting explicit dependency between partial derivatives of log-magnitudes and phase. Currently this method works only for Gaussian windows.

phased=gabphasederiv(dflag,'dgt',f,g,a,M) computes the time-frequency derivative using a DGT of the signal f. The DGT is computed using the window g on the lattice specified by the time shift a and the number of channels M. The algorithm used to perform this calculation computes several DGTs, and therefore this routine takes the exact same input parameters as dgt.

[phased,c]=gabphasederiv(dflag,'dgt',f,g,a,M) additionally returns the Gabor coefficients c, as they are always computed as a byproduct of the algorithm.

phased=gabphasederiv(dflag,'cross',f,g,a,M) does the same as above but this time using algorithm by Nelson which is based on computing several DGTs.

phased=gabphasederiv(dflag,'phase',cphase,a) computes the phase derivative from the phase cphase of a DGT of the signal. The original DGT from which the phase is obtained must have been computed using a time-shift of a using the default phase convention ('freqinv') e.g.:

phased=gabphasederiv(dflag,'phase',angle(dgt(f,g,a,M)),a)

phased=gabphasederiv(dflag,'abs',s,g,a) computes the phase derivative from the absolute values of DGT coefficients s. The spectrogram must have been computed using the window g and time-shift a e.g.:

phased=gabphasederiv(dflag,'abs',abs(dgt(f,g,a,M)),g,a)

Currently the 'abs' method only works if the window g is a Gaussian window specified as a string or a cell array.

phased=gabphasederiv(dflag,'abs',s,g,a,difforder) uses a centered finite diffence scheme of order difforder to perform the needed numerical differentiation. Default is to use a 4th order scheme.

Phase conventions

First derivatives in either direction are subject to phase convention. The following additional flags define the phase convention the original phase would have had:

'freqinv' Derivatives reflect the frequency-invariant phase of dgt. This is the default.
'timeinv' Derivatives reflect the time-invariant phase of dgt.
'symphase' Derivatives reflect the symmetric phase of dgt.
'relative' This is a combination of 'freqinv and 'timeinv'. It uses 'timeinv' for derivatives along frequency and and 'freqinv' for derivatives along time and for the mixed derivative. This is usefull for the reassignment functions.

Please see ltfatnote042 for the description of relations between the phase derivatives with different phase conventions. Note that for the 'relative' convention, the following holds:

gabphasederiv('t',...,'relative') == gabphasederiv('t',...,'freqinv')
gabphasederiv('f',...,'relative') == -gabphasederiv('f',...,'timeinv')
gabphasederiv('tt',...,'relative') == gabphasederiv('tt',...)
gabphasederiv('ff',...,'relative') == -gabphasederiv('ff',...)
gabphasederiv('tf',...,'relative') == gabphasederiv('tf',...,'freqinv')

Several derivatives at once

phasedcell=gabphasederiv({dflag1,dflag2,...},...) computes several phase derivatives at once while reusing some temporary computations thus saving computation time. {dflag1,dflag2,...} is a cell array of the derivative flags and cell elements of the returned phasedcell contain the corresponding derivatives i.e.:

[pderiv1,pderiv2,...] = deal(phasedcell{:});

[phasedcell,c]=gabphasederiv({dflag1,dflag2,...},'dgt',...) works the same as above but in addition returns coefficients c which are the byproduct of the 'dgt' method.

Other flags and parameters work as before.

References:

F. Auger and P. Flandrin. Improving the readability of time-frequency and time-scale representations by the reassignment method. IEEE Trans. Signal Process., 43(5):1068--1089, 1995.

E. Chassande-Mottin, I. Daubechies, F. Auger, and P. Flandrin. Differential reassignment. Signal Processing Letters, IEEE, 4(10):293--294, 1997.

J. Flanagan, D. Meinhart, R. Golden, and M. Sondhi. Phase Vocoder. The Journal of the Acoustical Society of America, 38:939, 1965.

K. R. Fitz and S. A. Fulop. A unified theory of time-frequency reassignment. CoRR, abs/0903.3080, 2009. [ http ]

D. J. Nelson. Instantaneous higher order phase derivatives. Digital Signal Processing, 12(2-3):416--428, 2002. [ DOI | http ]

F. Auger, E. Chassande-Mottin, and P. Flandrin. On phase-magnitude relationships in the short-time fourier transform. Signal Processing Letters, IEEE, 19(5):267--270, May 2012. [ DOI ]

Z. Průša. STFT and DGT phase conventions and phase derivatives interpretation. Technical report, Acoustics Research Institute, Austrian Academy of Sciences, 2015. [ .pdf ]