% This is part of the TFTB Reference Manual.
% Copyright (C) 1996 CNRS (France) and Rice University (US).
% See the file refguide.tex for copying conditions.


\markright{tfrgrd}
\section*{\hspace*{-1.6cm} tfrgrd}

\vspace*{-.4cm}
\hspace*{-1.6cm}\rule[0in]{16.5cm}{.02cm}
\vspace*{.2cm}

{\bf \large \sf Purpose}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
Generalized rectangular time-frequency distribution.
\end{minipage}
\vspace*{.5cm}

{\bf \large \sf Synopsis}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
\begin{verbatim}
[tfr,t,f] = tfrgrd(x)
[tfr,t,f] = tfrgrd(x,t)
[tfr,t,f] = tfrgrd(x,t,N)
[tfr,t,f] = tfrgrd(x,t,N,g)
[tfr,t,f] = tfrgrd(x,t,N,g,h)
[tfr,t,f] = tfrgrd(x,t,N,g,h,rs)
[tfr,t,f] = tfrgrd(x,t,N,g,h,rs,alpha)
[tfr,t,f] = tfrgrd(x,t,N,g,h,rs,alpha,trace)
\end{verbatim}
\end{minipage}
\vspace*{.5cm}

{\bf \large \sf Description}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
        {\ty tfrgrd} computes the Generalized Rectangular Distribution of a
        discrete-time signal {\ty x}, or the cross GRD representation
        between two signals. Its expression is :
\[GRD_x(t,\nu)=
\iint_{-\infty}^{+\infty} \dfrac{2 r_s}{|\tau|^{\alpha}}\
\mbox{sinc}\left(\frac{2\pi r_s v}{|\tau|^{\alpha}}\right)\
x(t+v+\frac{\tau}{2})\ x^*(t+v-\frac{\tau}{2})\ e^{-j2\pi \nu \tau}\ dv\
d\tau\] where $r_s$ is a scaling factor which determines the spread of the
low-pass filter, and $\alpha$ is the dissymetry ratio.\\

\hspace*{-.5cm}\begin{tabular*}{14cm}{p{1.5cm} p{8cm} c}
Name & Description & Default value\\
\hline
        {\ty x}      & signal if auto-GRD, or {\ty [x1,x2]} if cross-GRD {\ty
			(Nx=length(x))} \\
        {\ty t}      & time instant(s)         & {\ty (1:Nx})\\
        {\ty N}      & number of frequency bins & {\ty Nx}\\
        {\ty g}      & time smoothing window, {\ty G(0)} being forced to
		{\ty 1}, where {\ty G(f)} is the Fourier transform of {\ty g(t)}.  
                                         & {\ty window(odd(N/10))}\\ 
        {\ty h}      & frequency smoothing window, {\ty h(0)} being forced to {\ty 1}.
                                         & {\ty window(odd(N/4))}\\ 
        {\ty rs}     & kernel width            & {\ty 1}\\
        {\ty alpha} & dissymmetry ratio       & {\ty 1}\\
        {\ty trace}  & if nonzero, the progression of the algorithm is shown
                                         & {\ty 0}\\

\hline\end{tabular*}\end{minipage} \newpage
\hspace*{1.5cm}\begin{minipage}[t]{13.5cm}
\hspace*{-.5cm}\begin{tabular*}{14cm}{p{1.5cm} p{8.5cm} c}
Name & Description & Default value\\\hline

        {\ty tfr}    & time-frequency representation\\
        {\ty f}      & vector of normalized frequencies\\

\hline
\end{tabular*}
\vspace*{.2cm}

When called without output arguments, {\ty tfrgrd} runs {\ty tfrqview}.
\end{minipage}
\vspace*{1cm}

{\bf \large \sf Example}
\begin{verbatim}
         sig=fmlin(128,0.05,0.3)+fmlin(128,0.15,0.4);  
         g=window(9,'Kaiser'); h=window(27,'Kaiser'); 
         t=1:128; tfrgrd(sig,t,128,g,h,36,1/5,1);
\end{verbatim}
\vspace*{.5cm}

{\bf \large \sf See Also}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
all the {\ty tfr*} functions.
\end{minipage}
\vspace*{.5cm}


{\bf \large \sf Reference}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
[1] F. Auger ``Some Simple Parameter Determination Rules for the
Generalized Choi-Williams and Butterworth Distributions'' IEEE Signal
processing letters, Vol 1, No 1, pp. 9-11, Jan. 1994.

\end{minipage}
