---
title: Daubechies 4 (db4) Wavelet Function
url: https://www.emergentmind.com/topics/daubechies-4-wavelet-function
type: topic
---

# Daubechies 4 (db4) Wavelet Function

The Daubechies 4 (db4) wavelet is a compactly supported, orthonormal wavelet constructed for discrete and continuous wavelet analysis. As a member of the Daubechies family, the db4 wavelet exhibits minimal compact support for a given number of vanishing moments and is characterized by four finite impulse response (FIR) filter coefficients. Recent advances provide both explicit analytic approximations for its waveform and a polynomial spline construction route, clarifying its core mathematical structure and facilitating efficient numerical implementation [1502.01424], [1507.03057].

## 1. Explicit Time-Domain Approximations of db4 Wavelet and Scaling Functions

Traditional representations of compactly supported wavelets like db4 rely on recursive algorithms or filter-bank constructions. "Close Approximations for Daublets and their Spectra" [1502.01424] introduces closed-form, near-exact analytic representations of the db4 wavelet ($\psi_4$) and scaling function ($\phi_4$) as sums of inharmonic sinusoids:
\[
\tilde\psi_4(t) = \sum_{k=1}^8 a_k \sin(b_k t + c_k)
\]
\[
\tilde\phi_4(t) = \sum_{k=1}^8 A_k \sin(B_k t + C_k)
\]
where $K=8$ suffices to achieve $>99.99\%$ root-mean-square fit accuracy to the cascade-defined db4 over $[0,7]$.

### db4 Wavelet Coefficients $(a_k, b_k, c_k)$

| $k$ | $a_k$   | $b_k$   | $c_k$   |
|:---:|:--------|:--------|:--------|
| 1   | 0.3452  | 4.586   | -2.316  |
| 2   | 0.2783  | 3.460   |  1.413  |
| 3   | 0.3015  | 5.770   | -0.373  |
| 4   | 0.2129  | 6.960   | -4.943  |
| 5   | 0.1293  | 2.414   | -1.794  |
| 6   | 0.1120  | 8.161   | -3.225  |
| 7   | 0.0295  | 9.366   | -7.567  |
| 8   | 0.0223  | 1.372   |  1.102  |

### db4 Scaling Function Coefficients $(A_k, B_k, C_k)$

| $k$ | $A_k$   | $B_k$   | $C_k$   |
|:---:|:--------|:--------|:--------|
| 1   | 0.3762  | 0.672   |  0.171  |
| 2   | 0.2113  | 3.226   | -2.404  |
| 3   | 0.3900  | 1.204   |  0.939  |
| 4   | 0.0770  | 4.193   |  2.098  |
| 5   | 0.2661  | 2.384   | -1.379  |
| 6   | 0.0081  | 5.586   | -1.379  |
| 7   | 0.0226  | 8.537   | -1.184  |
| 8   | 0.0205  | 9.424   |  3.346  |

These analytic "near-daublet" forms eliminate the need for recursive cascades and provide explicit, continuous, closed-form expressions [1502.01424].

## 2. Filter-Bank Foundation: FIR Coefficients and Mask Construction

The orthonormal db4 is derived from a four-tap FIR filter defined by:
\[
\begin{aligned}
h_0 &= \frac{1+\sqrt{3}}{4\sqrt{2}} \approx 0.4829629131 \\
h_1 &= \frac{3+\sqrt{3}}{4\sqrt{2}} \approx 0.8365163037 \\
h_2 &= \frac{3-\sqrt{3}}{4\sqrt{2}} \approx 0.2241438680 \\
h_3 &= \frac{1-\sqrt{3}}{4\sqrt{2}} \approx -0.1294095226
\end{aligned}
\]
The low-pass filter mask is explicitly constructed using spline-type masks and Lorentz polynomials [1507.03057]:
\[
P_2(z) = \tfrac{1}{4}(1 + 2z + z^2), \quad S_2(z) = \frac{1+\sqrt{3}}{2}z + \frac{1-\sqrt{3}}{2}z^2
\]
The mask $P(z) = P_2(z) S_2(z)$, upon shifting and normalization, yields the $h_k$. The associated high-pass coefficients are $g_k = (-1)^k h_{3-k}$. These filters underpin the standard two-scale relations
\[
\phi_4(t) = \sqrt{2} \sum_{k=0}^3 h_k \phi_4(2t-k), \quad \psi_4(t) = \sqrt{2} \sum_{k=0}^3 g_k \phi_4(2t-k)
\]
ensuring compactly-supported, orthonormal bases in $L^2(\mathbb{R})$ [1507.03057].

## 3. Inharmonic Series Model and Fitting Methodology

The analytic approximation in [1502.01424] leverages an "inharmonic" sum:
\[
y(t) \approx \sum_{k=1}^K a_k \sin(\omega_k t + \phi_k)
\]
The frequencies $\omega_k$ are non-integer multiples selected to enforce exact zero mean over the wavelet's compact support. The phases and amplitudes are determined to minimize mean-square error to the cascade-generated wavelet by nonlinear least-squares (Levenberg–Marquardt algorithm), using the FIR filter output as the regression target. This provides analytic, zero-mean, compactly-supported approximations matching discrete wavelets to within $10^{-4}$ error on $[0,T]$ without repeated filtering or B-spline construction [1502.01424].

## 4. Spectral Properties and Scalogram Analysis

### Fourier Transform and Spectrum

For the periodic extension, the transform is a sum of Dirac deltas:
\[
\Psi_4^{\rm long}(\omega) = j\pi\sum_{k=1}^8 a_k\left[e^{jc_k}\delta(\omega+b_k) - e^{-jc_k}\delta(\omega-b_k)\right]
\]
Compact support ($T=7$ for db4) induces spectral convolution by a $\operatorname{sinc}$, so that the true spectrum is:
\[
\Psi_4(\omega) = \frac{T}{2} \sum_{k=1}^8 a_k \left[ \mathrm{sinc}\left(\frac{T}{2\pi}(\omega - b_k)\right) - \mathrm{sinc}\left(\frac{T}{2\pi}(\omega + b_k)\right) \right]
\]
This sum of shifted $\mathrm{sinc}$ lobes provides a close match to the canonical db4 spectrum [1502.01424].

### Scalogram and Frequency Localization

Time–frequency analysis via continuous scalograms shows that, despite visual smearing in 2D projections, the analytic near-daublet accurately preserves db4's known frequency-detection properties. 3D scalogram visualization resolves the correct localization of tone frequencies, confirming fidelity of the analytic approximation for applications in time–scale analysis [1502.01424].

## 5. Explicit Polynomial Representation via Spline-Type Approach

The alternative construction [1507.03057] uses quadratic B-splines:
\[
B_2(x) = 
\begin{cases}
\frac{1}{2}x^2, & 0\leq x < 1 \\
\frac{1}{2}(-2x^2+6x-3), & 1\leq x < 2 \\
\frac{1}{2}(3-x)^2, & 2 \leq x < 3 \\
0, & \text{otherwise}
\end{cases}
\]
The scaling function can be written as a shifted linear combination of these B-splines:
\[
\phi(x) = a_1 B_2(2x-1) + a_2 B_2(2x-2), \quad a_1 = \frac{1+\sqrt{3}}{2},\,\, a_2 = \frac{1-\sqrt{3}}{2}
\]
The wavelet $\psi(x)$ then follows via the high-pass mask applied to the refinement relation. This yields explicit piecewise-cubic forms for both $\phi(x)$ and $\psi(x)$, illustrating the algebraic structure behind the FIR/cascade output [1507.03057].

## 6. Key Properties, Accuracy, and Implementation

- **Compact Support:** Both $\psi_4$ and $\phi_4$ are supported in $[0,3]$ (filter length minus one).
- **Vanishing Moments:** $\psi_4$ possesses exactly two vanishing moments: $\int x^m \psi_4(x)\,dx = 0$ for $m=0,1$.
- **Orthonormality:** Translates and dilates form an orthonormal multiresolution basis for $L^2(\mathbb{R})$.
- **Smoothness:** Both functions are piecewise-cubic and Hölder-continuous with exponent $\approx 0.55$.
- **Approximation Accuracy:** The inharmonic sum achieves better than $99.99\%$ accuracy in root-mean-square error relative to the true cascade-based db4.
- **MATLAB® Integration:** The $\tilde\phi_4$ and $\tilde\psi_4$ near-daublet family (`cdb4`) is implemented in MATLAB’s Wavelet Toolbox, with analytic time-domain expressions providing seamless integration and display indistinguishable from standard db4 [1502.01424].

## 7. Theoretical and Practical Significance

The db4 wavelet combines FIR filter efficiency, compact support, explicit orthogonality, and sufficient regularity for signal-processing and analysis tasks. The analytic forms obtained via inharmonic sums and spline masks facilitate hardware synthesis, explicit spectral analysis, and rapid computation. The connection between the FIR/cascade and spline constructions illuminates the algebraic and analytic foundations of Daubechies' original framework. These representations support both rigorous theoretical investigations and practical applications in wavelet-based systems, such as wavelet OFDM or time–frequency analysis [1502.01424], [1507.03057].

Source: https://www.emergentmind.com/topics/daubechies-4-wavelet-function