Inpainting of Long Audio Segments With Similarity Graphs

Nathanaël Perraudin, Nicki Holighaus, Piotr Majdak, Péter Balázs · DOI

Abstract

We present a novel method for the compensation of long duration data loss in audio signals, in particular music. The concealment of such signal defects is based on a graph that encodes signal structure in terms of time-persistent spectral similarity. A suitable candidate segment for the substitution of the lost content is proposed by an intuitive optimization scheme and smoothly inserted into the gap, i.e. the lost or distorted signal region. Extensive listening tests show that the proposed algorithm provides highly promising results when applied to a variety of real-world music signals.

Introduction

Most audio restoration techniques, often referred to as "audio inpainting," are designed to handle "micro-gaps"—short-lived artifacts like clicks, pops, or packet loss lasting less than 100 milliseconds. These traditional methods rely on local information, assuming the signal is stationary or predictable from its immediate surroundings.

However, when a gap lasts for several seconds—due to physical damage to a record, magnetic tape degradation, or a total drop in a digital broadcast—local information becomes useless. One cannot "guess" several seconds of a melody based on the preceding few milliseconds. To solve this, we propose a method that looks at the global structure of the music. Since most musical genres rely on repetition and variation (choruses, riffs, rhythmic loops), the information needed to fill a gap often exists elsewhere in the same recording.

Methodology

The proposed system treats audio inpainting as a graph-based optimization problem, following a multi-step pipeline:

1. Feature Extraction

The system computes two primary features from a Short-Time Fourier Transform (STFT): Loudness, represented by a log-spectrogram, and the Phase Derivative. While many Music Information Retrieval (MIR) tasks ignore phase, this method uses the partial derivative of the phase to capture harmonic stability, which is vital for ensuring the "patch" sounds like it belongs to the same instrument or voice.

2. Similarity Graph and Time-Persistence

Every time point in the song becomes a node in a graph, with edges drawn between nodes that have similar feature vectors. However, simply finding similar frames is not enough; the algorithm must find similar phrases. To ensure this, the similarity matrix is convolved with a diagonal kernel. This highlights "paths" in the graph where the music follows a similar trajectory over time, filtering out accidental similarities that do not represent actual musical repetition.

Evolution of the weight matrix from initial similarity to a sparse, time-persistent representation using diagonal convolution.

3. Optimization and Insertion

The algorithm searches for a candidate segment that minimizes a specific objective function. This function balances three critical needs: transition quality (matching the audio surrounding the gap), length consistency, and similarity strength. Once a candidate is identified, it is inserted using a time-frequency domain cross-fading technique to prevent audible clicks or phase jumps.

Conceptual overview of the inpainting process: identifying a candidate segment $D_2$ to fill the gap $D_1$.

Results and Key Insights

The researchers evaluated the method using a perceptual test set of 24 songs across Pop, Rock, Jazz, and Classical genres.

  • The "Fooling" Rate: In psychoacoustic listening tests, subjects were only able to detect the inpainting in 40% of cases. This means the algorithm successfully "fooled" listeners 60% of the time.
  • Severity of Artifacts: Even when listeners detected an alteration, they rated the severity as "not disturbing" (averaging 0.6 on a scale of 0 to 3). In contrast, a simple "click" artifact was rated as significantly more disturbing (2.0).
  • Computational Efficiency: By using a "reduced graph" (only looking at edges near the gap), the system achieved linear time complexity, processing one minute of audio in about 2.5 seconds on a standard laptop.

Conclusion

This research demonstrates that music's repetitive nature can act as a built-in error-correction code. While the method's success is tied to the presence of repetition within a track—making it less effective for through-composed or highly experimental genres—it offers a powerful new tool for restoring long-duration audio damage. Future work will focus on automated gap detection and incorporating more advanced psychoacoustic models to further refine similarity measures.

Summary updated

BibTeX
@article{perraudin2018inpainting,
  author = {Nathanaël Perraudin and Nicki Holighaus and Piotr Majdak and Péter Balázs},
  title = {{Inpainting of Long Audio Segments With Similarity Graphs}},
  journal = {IEEE ACM Trans. Audio Speech Lang. Process.},
  year = {2018},
  doi = {10.1109/taslp.2018.2809864},
}
Figure