伪代码latex

\documentclass[11pt]{
     article}
\usepackage{
     amsmath}
\usepackage{
     amssymb}
% \usepackage{
     euler}
\providecommand{
     \abs}[1]{
     \left\lvert#1\right\rvert}
\providecommand{
     \norm}[1]{
     \left\lVert#1\right\rVert}
\usepackage{
     bbm}
\usepackage{
     CJK}
\usepackage{
     listings}
\usepackage{
     xcolor}
\usepackage{
     listings}
\usepackage{
     amsmath,bm,graphicx,multirow,bm,bbm,amssymb,psfrag,algorithm,subfigure,color,mdframed,wasysym,subeqnarray,multicol}

\usepackage{
     algorithm}
\usepackage{
     algpseudocode}
\usepackage{
     amsmath}
\renewcommand{
     \algorithmicrequire}{
     \textbf{
     Input:}}
\renewcommand{
     \algorithmicensure}{
     \textbf{
     Output:}}
\renewcommand{
     \thealgorithm}{
     1}   %定义算法的编号
\begin{
     algorithm}[H]
	\caption{
     Doppler Profile Extraction}
\begin{
     algorithmic}[1]
	\REQUIRE{
     Spectrogram matrix $P$, centre frequency bin $cf$}
	\ENSURE{
     Doppler shift profile $DopShift$}\\
	\STATE{
     colNum=getColumNum($P$);} \\
	\STATE{
     $DopShift$(1:colNum)=$cf$;}  //initialization \\
	\FOR{
     i=1:colNum}
		\STATE row=getNonNullRows(col(i)); // get non-null rows of the $i$th col\\
	\IF{
     isNotEmpty(row)}
		\STATE{
     meanValue=mean(row);}\\
       \ElSE
              \STATE{
     meanValue\textgreater cf}\\
              \STATE{
     $DopShift$(i)=max(row);}\\
              \STATE{
     $DopShift$(i)=min(row);}\\
       \ENDIF
	\ENDFOR
	\STATE{
     $DopShift$ = SMA($DopShift$);} // SMA represents smoothed moving average filter\\
       \STATE{
     Return $DopShift$;}
\end{
     algorithmic}
\end{
     algorithm}

你可能感兴趣的:(伪代码latex)