For reference, the same problem with TikZ could be fixed as shown in Problem with TikZ and vertical alignment of text inside nodes.
Combining that hint with Connecting nodes with brace in TikZ, it is possible to build the following solution:
\documentclass{article}
\usepackage{tikz,pdftexcmds}
\usetikzlibrary{calc,shapes.arrows,decorations.pathreplacing,shadows}
% list of keys
\pgfkeys{/tikz/.cd,
border color/.initial=black,
border color/.get=\bordercol,
border color/.store in=\bordercol,
brace color/.initial=black,
brace color/.get=\bracecol,
brace color/.store in=\bracecol,
brace distance/.initial=5pt,
brace distance/.get=\bracedistance,
brace distance/.store in=\bracedistance,
brace position/.initial=north,
brace position/.get=\bracepos,
brace position/.store in=\bracepos,
items height/.initial=1cm,
items height/.get=\itemheight,
items height/.store in=\itemheight,
items width/.initial=3cm,
items width/.get=\itemwidth,
items width/.store in=\itemwidth,
items distance/.initial=\itemwidth,
items distance/.get=\itemdistance,
items distance/.store in=\itemdistance,
}
% list of styles
\tikzset{module/.style={
draw=\bordercol,
minimum height=\itemheight,
minimum width=\itemwidth,
text height=1.5ex,
text depth=.25ex,
},
brace/.style={
decoration={brace,raise=\bracedistance,amplitude=0.75em,#1},
decorate,
draw=\bracecol,
very thick,
}
}
\makeatletter
\newcommand{\braceddiagram}[3][]{
\begin{tikzpicture}[scale=0.9,transform shape,#1] % here we can pass options:
% scale=0.9,transform shape are used to avoid overfull and underfull boxes
% counting all the items to be displayed
\foreach \items/\colors [count=\xi] in {#2}{\global\let\maxnumitem\xi}
% foreach item we are going to compute at which distance it should be located
% and then we put it with the module style and with a name <module><num-module>
\foreach \items/\colors [count=\xi] in {#2}{%
\path let
\n1={0+\xi*\itemdistance} in
node[module,fill=\colors] (module\xi) at +(\n1,0) {\items};
}
% at the end we draw the brace with the comment
\ifnum\pdf@strcmp{\bracepos}{south}=\z@
\draw[brace=mirror] (module1.south west)--(module\maxnumitem.south east)
node[below=3*\bracedistance, midway]{#3};
\else
\draw[brace] (module1.north west)--(module\maxnumitem.north east)
node[above=3*\bracedistance, midway]{#3};
\fi
\end{tikzpicture}
}
\makeatother
\begin{document}
Generic examples:
\braceddiagram[brace distance=4pt]{Bla/red, Bla/blue, Bla/green}{Some comment}
\vspace{1cm}
\tikzset{my style for the diagram/.style={
brace distance=6pt,
brace position=south,
}
}
\braceddiagram[my style for the diagram]{Bla/red, Bla/blue, Bla/green,Bla/yellow}{Some other comment}
\vspace{1cm}
The real example:
\begin{center}
\braceddiagram[my style for the diagram]{Preamble/red, Start code/blue}{Stage 1: estimate M}
\braceddiagram[my style for the diagram]{Data/green,Stop code/yellow}{Stage 2: sample and decode}
\end{center}
\end{document}
The result:

amsmath
package, one can simply "smash" the bottom of a word with descenders:\smash[b]{Stop} code
– barbara beeton Jun 3 '13 at 12:37