---
title: Frequency-Decomposed Similarity with Haar Wavelet
url: https://www.emergentmind.com/topics/frequency-decomposed-similarity-with-haar-wavelet
type: topic
---

# Frequency-Decomposed Similarity with Haar Wavelet

Frequency-decomposed similarity with Haar wavelet refers to a methodological framework for quantifying similarity between signals or images by decomposing them into frequency components using the Haar wavelet transform, then comparing the resulting multi-scale representations. This approach captures differences and agreements across spatial or temporal scales, leveraging the advantages of the Haar basis: orthogonality, dyadic band separation, and computational efficiency. Frequency-decomposed similarity metrics have been applied in domains such as image dataset analysis, climate field comparison, perceptual quality assessment, and statistical signal analysis, frequently outperforming global similarity scores by providing interpretable, scale-resolved insight [2002.10257, 2512.14656, 2511.02174, 1607.06140].

## 1. Haar Wavelet Transform Fundamentals

The Haar wavelet is the simplest orthogonal wavelet, with scaling (father) and wavelet (mother) functions:
- $\varphi(x) = 1$ for $0 \leq x < 1$; 0 otherwise
- $\psi(x) = 1$ for $0 \leq x < \frac12$, $-1$ for $\frac12 \leq x < 1$; 0 otherwise

The associated filter coefficients (unit $\ell_2$ norm) are $h = [1/\sqrt{2}, 1/\sqrt{2}]$ (low-pass) and $g = [1/\sqrt{2}, -1/\sqrt{2}]$ (high-pass). Applying the discrete wavelet transform (DWT) via iterated filtering and downsampling yields multi-level, separable decompositions for images and signals. In 2D, each level decomposes the signal into four subsampled subbands: LL (approximation), LH (horizontal detail), HL (vertical detail), and HH (diagonal detail) [2002.10257, 2512.14656].

The decomposition is performed recursively, typically to $J = \lfloor \log_2 \min(M,N) \rfloor$ levels for an $M \times N$ image. Fast algorithms such as Mallat’s pyramid exploit filter separability for $O(P)$ operations with $P$ pixels [2002.10257, 1607.06140].

## 2. Frequency-Decomposed Similarity: General Methodology

Frequency-decomposed similarity quantifies agreement between two signals (or images) not in the spatial/temporal domain, but in their wavelet (i.e., frequency–scale–space) representations. At a conceptual level:

- Signals/images $A$ and $B$ are transformed to produce, at each level $j$ and subband $S$, coefficient matrices $W_S^{(j)}(A)$, $W_S^{(j)}(B)$.
- Similarity at each scale–subband pair is evaluated, e.g., using cross-correlation, normed Euclidean distance, or more elaborate functionals tailored to perceptual invariance or application-specific patterns.
- The similarities across bands and scales are then aggregated, often with scale-dependent weights to control the relative importance of fine or coarse patterns [2002.10257, 2511.02174].

This approach yields a multi-level “similarity spectrum” capturing which frequency bands and spatial/temporal patterns are aligned or distinct between the objects under comparison.

## 3. Principal Implementations and Variants

### a) Cosine Similarity-Based Aggregation

A central implementation [2002.10257] uses normalized cross-correlation (cosine similarity) per subband:

$$
S_S^{(j)}(A,B) = 
\frac{\sum_{m,n} W_S^{(j)}(A)[m,n]\, W_S^{(j)}(B)[m,n]}
{\sqrt{\sum W_S^{(j)}(A)[m,n]^2} \sqrt{\sum W_S^{(j)}(B)[m,n]^2}}
$$

The aggregate similarity is

$$
S(A,B) = \sum_{j=1}^J \sum_{S \in \{LL,LH,HL,HH\}} w_{j,S} \cdot S_S^{(j)}(A,B)
$$

Weights $w_{j,LL} \propto \alpha^j$, $w_{j,subband \neq LL} \propto \beta^j$ ($\alpha > \beta$) emphasize coarse versus fine scales. Renormalization ensures $\sum_{j,S} w_{j,S} = 1$.

This method, validated on CIFAR-10/100 and landmark datasets, rapidly identifies redundancy, near-duplicates, and outliers. Pivoted-QR can be used to focus on the most informative coefficients, reducing computation time and improving specificity [2002.10257].

### b) Multi-component WaveSim Metric

The WaveSim framework [2512.14656] extends Haar-based similarity metrics with three orthogonal components computed per scale:
- **Magnitude**: Quantifies similarity in mean wavelet energy at each scale, using
  $$
  \mathcal{M}^s = 1 - \delta^s;\quad
  \delta^s = \frac{|\bar E_X^s-\bar E_Y^s|}{\bar E_X^s + \bar E_Y^s + \varepsilon}
  $$
- **Displacement**: Measures alignment of energy centers-of-mass along rows/cols, with
  $$
  \mathcal{D}^s = (1 - \Delta_{\mathrm{lat}}^s)(1 - \Delta_{\mathrm{lon}}^s)
  $$
- **Structure**: Assesses similarity of sorted, centralized and normalized coefficient patterns, with a cosine similarity and an amplitude penalty.

Scores are multiplicatively blended and then aggregated across scales with exponentiation and weighting:

$$
\text{WaveSim}(X,Y) = \sum_{s=1}^S w^s \left[ (\mathcal{M}^s)^\alpha (\mathcal{D}^s)^\beta (\mathcal{S}^s)^\gamma \right]
$$
(with $\alpha=\beta=\gamma=1$ by default).

This enables interpretability along physical modes of dissimilarity (energy, spatial shift, pattern organization), critical for complex spatial field comparison [2512.14656].

### c) Wavelet-Based Statistical Correlations

The work in [2511.02174] provides scale-resolved correlational analysis using Haar detail coefficients (for signals):

- At each scale $j$, compute correlation $R_{XY}(j)$ between corresponding detail coefficient vectors.
- Optionally, use partial correlation to control for other scales.
- Parseval’s identity gives that global Pearson correlation can be additively decomposed as a weighted sum of scale-wise correlations.

This enables signal dependence to be interpreted as a function of frequency band (octave), which is infeasible with global methods like Pearson correlation [2511.02174].

### d) HaarPSI: Perceptual Quality Index

HaarPSI [1607.06140] is an efficient similarity index for full-reference image quality assessment:

- Uses Haar detail coefficients at two high-frequency scales in two orientations (horizontal/vertical).
- Local similarity at each coefficient is measured by a stabilized ratio; nonlinearity is applied via a logistic function.
- A coarser-scale Haar response provides a saliency weight per pixel.
- The final similarity merges orientation- and scale-combined similarities with per-location weights, using an inverted logistic mapping and squaring to optimize agreement with human perception.

Empirical performance on large image quality datasets shows HaarPSI achieves state-of-the-art results with far lower computational cost than methods such as SSIM or FSIM [1607.06140].

## 4. Computational Properties and Scaling

All Haar-based similarity approaches leverage the minimal support and orthogonality of the Haar wavelet. Complexity for 2D Haar DWT is $O(MN J)$, with $J = O(\log_2 \min(M,N))$. Most similarity measures (inner products, cosine similarity, energy, etc.) reduce to $O(P)$ operations when precomputed coefficients are used. For large-scale datasets, dimensionality reduction by feature selection (e.g., QR pivoting) and parallel clustering enable rapid application to tens of thousands of images or signals [2002.10257, 1607.06140].

Edge effects are typically controlled by symmetric extension, and coefficient normalization (e.g., by $1/\sqrt{2}$ filter taps) maintains metric invariance [2512.14656].

## 5. Empirical Performance and Applications

Applications of frequency-decomposed similarity with Haar wavelet include:

- **Image dataset analysis**: Identification of redundancy and outliers; clustering; pre-training analysis of classification datasets without requiring trained models. For CIFAR-10, with $J=4$ levels ($\sim$3,072 coeffs/image), informative feature selection and clustering recover reported redundancies and enable efficient cluster pruning [2002.10257].

- **Climate and spatial field evaluation**: Scale-specific magnitude, displacement, and structure similarity scores provide interpretable diagnostics not possible with pointwise norms. For example, WaveSim quantifies physical scale errors, spatial displacements, and structural misalignments in Earth System Model outputs [2512.14656].

- **Perceptual image quality assessment**: HaarPSI achieves superior correlation with subjective human scores compared to SSIM, FSIM, VSI on LIVE, TID2008/2013, CSIQ datasets at a fraction of the computational cost [1607.06140].

- **Statistical signal dependence**: Wavelet correlograms diagnose which frequency bands carry signal relationships, critical in applications such as turbulence analysis, AR modeling, and economic time series [2511.02174].

## 6. Interpretability, Robustness, and Limitations

The scale-resolved nature of Haar-based similarity metrics provides interpretability—one can attribute matches/mismatches to specific frequency bands, spatial displacements, or structures. For high-dimensional data, this supports robust redundancy detection and model generalization insights (e.g., association between low similarity and test errors in CIFAR-100 classes) [2002.10257].

Pearson and Kendall correlations can both be used at each scale, offering trade-offs between linear and monotonic dependence sensitivity [2511.02174].

A limitation is that Haar, while fast and maximally localized, lacks frequency selectivity and directional richness compared to more complex wavelets (e.g., Daubechies, Symlets), which may be desirable in certain contexts. However, for speed and simplicity on large datasets or spatial fields, Haar-based decompositions remain preferred [2002.10257, 1607.06140].

## 7. Comparative Summary

| Approach               | Domain          | Key Features                               | Reference      |
|------------------------|-----------------|--------------------------------------------|---------------|
| Cosine/Haar aggregation| Image, Dataset  | Multi-level, cross-band similarity         | [2002.10257]  |
| WaveSim                | Climate/Fields  | Magnitude, displacement, structure components| [2512.14656]|
| Wavelet correlogram    | Signals/Series  | Scale-resolved Pearson/Kendall correlation | [2511.02174]  |
| HaarPSI                | Image Quality   | Local Haar similarity, saliency weighted   | [1607.06140]  |

All of these methods rely on the same foundational operations—Haar wavelet transform, coefficient similarity at each scale, and judicious aggregation—demonstrating the versatility and interpretability of frequency-decomposed similarity for analyzing structured data across a range of applications.

Source: https://www.emergentmind.com/topics/frequency-decomposed-similarity-with-haar-wavelet