A FIRST GUIDED TOUR to Gabor Analysis (*under construction, adapted from IRSATOUR)

THIS file is publically accessible  as  GABTOUR1.HTM  

Introduction

One way to describe  GABOR ANALYSIS  is to say that one of the central themes is  the problem of signal  x[n] from a sampled STFT (Short-Time Fourier Transform) with known window g  from a sequence of samples which may be taken in a regular or irregular way, and assuming some stability of the process.

Let us first describe the situation for the one-dimensional case of vectors of finite length.  Such a vector (real- or complex-valued) x[n] has spectrum in some set Omega (of its frequency domain) if all of the Fourier coefficients of x[n] which correspond to parts of the frequency domain outside Omega are zero.  Typically, Omega will be some interval around the "origin" of the frequency domain.

Fig.1
 


(To distinguish the signal x[n] from its samples, see below, we draw it as a continuous signal. For more details about the Fast Fourier Transform and Labelling in MATLAB consult "The FFT-Guide".)
 
IN THIS AREA YOU FIND A LOT OF "old material" or templates or test version etc...  

HOW TO PLOT AND DISPLAY signals and functions on phase space....  

Standard signals (such as a discrete Gaussian):    g = gaussnk(n);   G = g'*g  (2D-Gaussian),

or  h = hanning(n); h=h(:); H = h*h'; H = fftshift(H);

plot(x) versus  plotc(x),    imgc(G)  versus   imagesc(abs(G)); 

GENERAL discussion of functions on the torus, the unit-roots of order n, and the corresponding phase-space

************************************************** 

The Case of Regular Sampling

Before explaining the case of irregular sampling, let us recall the case of regular sampling.  If the signal length of x[n] is N, then this means that one can sample this signal at a distance a, being  kept fixed throughout the vector x[n], with a being divisor of N.  Fig.2 shows the effect of sampling of a signal of length N=288 by a distance of a=4.  Up to normalization, the Fourier transform y_s[k] of the sampled signal x_s[n] coincides with the 4-periodized version of the original sampling sequence x[n].

Fig.2

Fig.1 plplotc.eps
 


Fig.1 plplotc.tif
 


Fig.1 plplotc.jpg
 


Fig.1
 


Further "routine" operators and actions (cf. FEITOOLS collection):  convmat.m 

C = convmat(c); then  (TEST):   MAT = convmat(kern);  then FT * diag ( fft (kern) ) * FT'
where: FT = sqrt(n)*fft(eye(n));  resp.   x * MAT =   ifft(  fft(x) .*  fft(c)); 

EXPERIMENT:     >> x = randc(1,12); c = randc(1,12);
>> compnorm( x * convmat(c), ifft( fft(x) .* fft(c)));
quotient of norms: norm(x)/norm(y) = 1
the difference of the normalized versions = 3.198e-016
 

fftu.m  delivers  "unitary version of FFT", either as operator (  y  = fftu(x),  or as matrix  FT = fftu(n)); 

Standard windows:   e.g.   g = gaussnk(n)  (row vector of length n, with  fftu(g) == g) , or  g = hanning(n); etc.

spyc.m ,  spycnew.m, spyctob.m   are suitable ways to display lattices, e.g.  LAM = lattp(n,a,b); 

 

Time-Frequency SHIFT operators:  

The linear mapping: cyclic shift: 

a) the operator    x  >>   rot(x,r);   e.g.  

>> x = (1:6)
x = 1 2 3 4 5 6
>> rot(x,2)
ans = 5 6 1 2 3 4
>> rot(x,-1)
ans = 2 3 4 5 6 1

b) the corresponding matrix:    M =  rot(eye(n),r)';   (because our operators are going to act on row vectors)! 

>> M = rot(eye(6),3)'
ans =
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0 

TEST:    >> x*M
ans = 4 5 6 1 2 3
>> rot(x,3)
ans = 4 5 6 1 2 3

The linear mapping: modulation by pure frequencies: 

pointwise multiplication with pure frequence:   f = purfr(n,k);  [ n = signal length, k = frequency number, k = 0 means constant]

norm( purfr(256,4) - conj(purfr(256,256-4)))
ans = 9.4683e-013

a)  the operation is just "pointwise multiplication with pure frequencies" 

>> norm( modul(x,2) - x.*purfr(6,2))
ans = 1.2755e-015
 

b) the matrix is correspondingly:    M  = diag(purfr(n,k));   

Fig.1
 

Fig.1
 

TF-shift operators:

a) the operator:   y =  rotmod(x,3,5);  does a time-frequency shift operator, with the time shift applied first and the frequency shift afterwards.

b) the corresponding matrix   M =  tfmat(n,t-shift,fr-shift); 

compatible in the sense that    x *  tfmat(x, t-shift, fr-shift)  ==   rotmod(x,t-shift,fr-shift); 

STFT of a signal    x   with window   g:    stft(x,g,[a,b]);

devlivers the complete (  ST = stft(x,g) == stft(x,g,1,1), by default)  resp.

ST(k,l) ==   scalar-product of   x   with   rotmod(g,l+1,k+1), or     rotmod(g,l+1,k+1)' * x ;

Display mode:  imgc(ST);   e.g.   imgc( stft(g,g));  plotax;  shg (= figure(gcf)); 

COVARIANCE property of  (absolute value of) STFT (  TF-shift of  signal versus 2D-shift of STFT):

rotrc(testmat(5), 1 , 2  )     %rotation of row-numbers by cyclic shift  1 ,  rotation of column numbers by 2:
ans =
20 25 5 10 15
16 21 1 6 11
17 22 2 7 12
18 23 3 8 13
19 24 4 9 14

norm(rotrc(abs(stft(x,g)),1,2)-abs(stft(rotmod(x,2,1),g)))
ans = 7.3003e-016

g  = gausnk(144); imgc(  stft(   rotmod(g,12,30), g)));

obtained by call:   imgc( stft( rotmod(g,2,3), g)); plotax;

Shows that the center of the STFT is movd two units to the right and 3 units into the frequency direction.   

 

Spreading function 

Spreading representation:   every matrix is the superposition of  TF-shifts

Is a simple "change of basis"  in the linear space of all  n x n - matrices  (with Hilbert Schmidt product): 

a)  SPRD(A)   provides the  "spreading function" of  matrix  A, with inverse:  SPRD2MAT(SPA)

SPRD(tfmat(n,k,l))  == unimat(n,l+1,k+1)  because!  in the description of a "unit"-matrix it is more natural (usual) to say that the matrix has a "1"  in the third row (note that row number is mentioned first) and 5-th column (second). So the arrangement has been made to preserve rather the relation  time = column-number =  x-axes (for the continuous case) and  frequency = vertical or y-coord = row-number ....

TEST:   norm(   unitmat(n,l+1,k+1) -  sprd(tfmat(n,k,l)), 'fro') 

The (non-zero, living on the adjoint lattice)  Spreading-Coefficients of the Gabor frame operator generated by (g,a,b) can be obtained using   [J,domfact] = janscof(g,a,b); 

It is not hard to see that they are "essentially"  the row-wise Fourier coefficients of the blockn-matrix (corresponding to the Walnut representation of the Gabor frame operator for (g,a,b)).  

GENERAL TOOLS

Comparing signals and their Fourier transforms:

Comparing two images (resp. functions on phase space):   COMPIMRI.M  compimri.m   

spy, spyc, spyctob, 

GENERAL REMARK:  names of M-files are DISPLAYED  in a capitalized for only, but should be CALLED in small form (? better alternative in HTML:  small and boldface??) 

 

GABOR FAMILIES 

G = gabbasp(G), or equivalently using the more general tool   gabbas(g,xpo); with xpo = lattp(n,a,b); 

The frame operator is then given  by    y  >>  y * G'  * G  =  y  * (G'*G);  hence S =  G' * G is the frame operator.

realization:   Sx  =   x * S  =  x * gabfrmat(g,a,b)  =  gabsyn( stft(x,g,a,b), g)  =  gabfr(x,g,a,b); 

(i.e. gabfr  describeds the operator, look up details..)  

In block-description the essential infroatmion about the Gabor matrix is  contained in   B =  blockn(g,a,b);  (or blocknon(g,a,b)), and hence Sx = bvmult( x, B) =  bvmult(g, blockn(g,a,b));  

GDP =  pinv(G')   is the same as the Gabor system generated by the dual Gabor atom (if   (g,a,b)  generates a Gabor frame), i.e.

gd = gabddd(g,a,b),  or  gd = gabdw(g,a,b);  or gd =  ppdw(g,a,b);  etc.etc.etc.

Tight Gabor families:

gt = gabtgt(g,a,b),  or   GDT =    g  * sqrtm( inv( S));    gt = gabtgf(g,a,b);  gt = gramtgt(g,a,b);   (cf. GABTGT)  oder [gt,dat] = gabfrtgt(g,a,b);  

   Gabor Frame Operator 

cf. above

realization:   Sx  =   x * S  =  x * gabfrmat(g,a,b)  =  gabsyn( stft(x,g,a,b), g)  =  gabfr(x,g,a,b); 

(i.e. gabfr  describeds the operator, look up details..)  

In block-description the essential infroatmion about the Gabor matrix is  contained in   B =  blockn(g,a,b);  (or blocknon(g,a,b)), and hence Sx = bvmult( x, B) =  bvmult(g, blockn(g,a,b));  

 

            Gabor Multipliers  (implementation due to M.Hampejs)

GM =  gabmulmh(COEFF, g)   is GM = gabmulmh(g,ones(n/b,n/a));   !! coincides with  Gabor frame operator 

Best approximation  (in the Hilbert Schmidt norm) of a given operator  T  by a Gabor multiplier generated by the triple (g,a,b):    [TA,COEFF]=gmappmh(T,g,a,b,show); 

COEFF is the set of coefficients required in order to built the matrix  TA  from  the projection operators onto the building blocks of the Gabor system. Therefore they are arranged in matrix form, of format  (n/b,n/a) (compatible with the format of the lattice  L=L(a,b)).  These coefficients can be interpreted as the scalar product in HS of the matrix describing  T  with the set of  L-conjugated variants of a "canonical" dual atom (a "nice" operator:    [cdab,  A, B] =  plrieszb(g,a,b);   [Projection lattice Riesz Bounds for triple (g,a,b)];  

GENERAL  FRAME THEORY and BASES 

If we interpret a matrix as a collection of row vectors, then (for left matrix multiplication)   pinv(A)*A  describes the orthogonal projection onto the row space of  A. If these rows  span all of C^n  then this is the identity operator and   pinv(A)'   has as row vectors simply the elements of the dual frame, and for  x  in C^n  the  coefficients   c*pinv(A)   are the minimal norm coefficients (the same as the ones obtained by the dual frame) because    pinv(A) =  pinv(A'*A)*A.   (or  pinv(A)'  = pinv(A')  =  pinv(A'*A)*A ).. (?) 

 

        KERNEL THEORY for linear operators 

SUBDIRECTORY   /gabkern   on HGFei notebook, containing e.g.

sprd.m    allows to calculate the spreading function of a given operator

 mat2kns.m,  sprd2mat.m,  mat2kns.m, kns2mat.m, kns2car.m,  mat2car.m, car2mat.m , etc.

tfconj.m   determines the TF-conjugation of a given matrix with a particular TF-shift

 

 

1D Gabor specific tools 

adjlatt.m    determines (for a given  xpo-indicator matrix of size n x n)  the adjoint lattice (Lambda^circ)

 

2D-Gabor Analysis Tools  

rotmodxy.m   resp.  rotmod2.m   allow to carry out a 2D  time-frequency shift on a given signal.

GABPP2  is the directory (HGFei notebook) containing some of the available version of 2D Gabor analysis.