% 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{tfrsp}
\section*{\hspace*{-1.6cm} tfrsp}

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

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

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

{\bf \large \sf Description}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
        {\ty tfrsp} computes the spectrogram distribution of a
        discrete-time signal {\ty x}. It corresponds to the squared modulus
        of the short-time Fourier transform. Its expression writes
\[S_x(t,\nu) = \left|\int_{-\infty}^{+\infty} x(u)\ h^*(u-t)\ e^{-j2\pi \nu
u}\ du\right|^2.\]

\hspace*{-.5cm}\begin{tabular*}{14cm}{p{1.5cm} p{8cm} c}
Name & Description & Default value\\
\hline
        {\ty x}     & analyzed signal ({\ty Nx=length(x)})\\
        {\ty t}     & time instant(s)          & {\ty (1:Nx)}\\
        {\ty N}     & number of frequency bins & {\ty Nx}\\
        {\ty h}     & smoothing window, {\ty h} being normalized so as to
                be  of unit energy.      & {\ty window(odd(N/4))}\\ 
        {\ty trace} & if nonzero, the progression of the algorithm is shown
                                         & {\ty 0}\\
     \hline {\ty tfr}   & time-frequency representation\\
        {\ty f}     & vector of normalized frequencies\\

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

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

{\bf \large \sf Example}
\begin{verbatim}
         sig=fmlin(128,0.1,0.4);
         h=window(17,'Kaiser'); 
         tfrsp(sig,1:128,64,h,1);
\end{verbatim}

\newpage

{\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 References}\\
\hspace*{1.5cm}
\begin{minipage}[t]{13.5cm}
[1] W. Koenig, H. Dunn, L. Lacy ``The sound spectrograph'',
J. Acoust. Soc. Am., Vol. 18, No. 1, pp. 19-49, 1946.\\

[2] J. Allen, L. Rabiner ``A Unified Approach to Short-Time Fourier
Analysis and Synthesis'' Proc. IEEE, Vol. 65, No. 11, pp. 1558-64, 1977. 
\end{minipage}
