A new expression for the moments about the origin of the output of sta
ck filtered data is derived in this paper. This expression is based on
the A and M vectors containing the well-known coefficients A(i) of st
ack filters and numbers M(Phi, gamma, N, i) defined in this paper. The
noise attenuation capability of any stack filter can now be calculate
d using the A and M vector parameters in the new expression. The conne
ction between the coefficients A(i) and so called rank selection proba
bilities r(i) is reviewed and new constraints, called rank selection c
onstraints, for stack filters are defined. The major contribution of t
he paper is the development of an extension of the optimality theory f
or stack filters presented by Yang et al. and Yin. This theory is base
d on the expression for the moments about the origin of the output, an
d combines the noise attenuation, rank selection constraints, and stru
ctural constraints on the filter's behaviour. For self-dual stack filt
ers it is proved that the optimal stack filter which achieves the best
noise attenuation subject to rank selection and structural constraint
s can usually be obtained in closed form. An algorithm for finding thi
s form is given and several design examples in which this algorithm is
used are presented in this paper.