N is auto-rounded to the nearest power of two (e.g. 250 → 256). Boundaries are handled with periodic (cyclic) convolution.
Top to bottom: original x[n] / approximation a^(L)[n] / per-level detail d^(L)[n] / reconstructed x_rec[n]
Daubechies-4 scaling coefficients $h_k$ and matching wavelet coefficients $g_k = (-1)^k h_{3-k}$:
$$h_0 = \frac{1+\sqrt3}{4\sqrt2},\ h_1 = \frac{3+\sqrt3}{4\sqrt2},\ h_2 = \frac{3-\sqrt3}{4\sqrt2},\ h_3 = \frac{1-\sqrt3}{4\sqrt2}$$One-level decomposition (periodic convolution + downsample by 2) with approximation $a$, detail $d$, signal $x$, filter length $K=4$:
$$a[i] = \sum_{k=0}^{3} h_k\,x[(2i+k)\bmod N], \qquad d[i] = \sum_{k=0}^{3} g_k\,x[(2i+k)\bmod N]$$Orthogonality $\sum h_k^2=1,\ \sum g_k^2=1,\ \sum h_k g_k=0$ guarantees that the transposed filter reconstructs the signal exactly.
Reconstruction MSE ($N$-point mean squared error):
$$\mathrm{MSE} = \frac{1}{N}\sum_{n=0}^{N-1}\bigl(x[n]-x_\text{rec}[n]\bigr)^2$$