interest are indicator functions of bounded convex sets. Notice that, for any semi-admissible function and a rank-$m$ lattice $\Lambda$ in $W$, $$\sum_{{\mathbf{x}}\in \Lambda} {f({\mathbf{x}})} < +\infty.$$

If $f$ and its Fourier transform $\hat{f}$ are semi-admissible, then $f$ is said to be admissible. In this paper we will not be concerned about admissible functions, which play an important role in the development of the so-called linear programming bounds for packings.

Let $(p_j)_{j=1}^{\infty}$ be an increasing sequence of prime numbers such that there exist reductions $\phi_{p_j}:\Lambda\to\mathbb{F}_{p_j}^n$ and let $f:W\to\mathbb{R}$ be a semi-admissible function. If the first minimum of $\Lambda_{p_j}=\Lambda_{p_j}(\left\{0\right\})$ satisfies $$\lambda_1(\Lambda_{p_j}) \geq c p_{j}^{\frac{n-k}{m}+\alpha},$$ for some constants $c,\alpha>0$, then

1.  $$\lim_{p_j\to\infty} \mathbb{E}_{\mathbb{L}_{p_j}}\left[\sum_{{\mathbf{x}}\in \beta \Lambda_{p_j}(C){\backslash\left\{0\right\}}} f({\mathbf{x}}) \right] = V^{-1}\int_{\mathbb{R}^m} f({\mathbf{x}})\text{d}{\mathbf{x}},
                \label{eq:averageBehaviorNoTheta}$$

2.  $$\lim_{p_j\to\infty} \mathbb{E}_{\mathbb{L}_{p_j}}\left[\sum_{{\mathbf{x}}\in \beta \Lambda_{p_j}^{\prime}(C)} f({\mathbf{x}}) \right] = (\zeta(m)V)^{-1}\int_{\mathbb{R}^m} f({\mathbf{x}})\text{d}{\mathbf{x}},
        \label{eq:averageBehavior}$$

\[thm:AverageEnsembleGeneral\]where the averages are taken over all $\beta\Lambda_{p_j}(\mathcal{C})$ in the ensemble $\mathbb{L}_{p_j}$ (Equation ).

We will prove the “refined” statement (ii). The proof of (i) is similar, except for the last step. Recall that the set of $\mathcal{C}_{n,k}$ of all $(n,k)$-codes satisfies Loeliger’s balancedness equation [@Loeliger] $$\frac{1}{| \mathcal{C}_{n,k}|} \sum_{{C} \in \mathcal{C}_{n,k}} \sum_{c \in {C} \backslash \left\{\mathbf{0}\right\}}  g(c)= \frac{p_j^{k}-1}{p_j^{n}-1} \sum_{v \in  \mathbb{F}_{p_j}^n \backslash \left\{\mathbf{0}\right\}}g(v),
    \label{eq:LoeligerLemma}$$ for a function $g:\mathbb{F}_p^n \to \mathbb{R}$. Now 