Efficient Transformer-based Speech Enhancement Using Long Frames and STFT Magnitudes

Danilo de Oliveira, Tal Peer, Timo Gerkmann

Abstract

Recent state-of-the-art speech enhancement models utilize Transformer architectures with learned encoders. While effective, these models typically require very short frames (approx. 2ms), resulting in long sequences that impose heavy computational and memory burdens due to the quadratic complexity of self-attention. This work investigates replacing learned encoders with traditional Short-Time Fourier Transform (STFT) magnitudes using longer 32ms frames. Our results show that this shift reduces computational operations by nearly 8x and slashes memory usage without compromising speech quality or intelligibility, making high-performance Transformers more viable for resource-constrained environments.

Introduction

The field of speech enhancement has recently shifted toward "learned-domain" approaches. Models like Conv-TasNet and SepFormer replace fixed mathematical transforms with convolutional layers that learn optimal audio representations. To achieve high performance, these models often operate on extremely short frames (around 2ms).

However, the $O(L^2)$ complexity of Transformers relative to sequence length $L$ makes these models computationally expensive. A high number of short frames leads to excessive latency and memory consumption, hindering deployment on edge devices. This paper explores whether the efficiency of traditional, longer audio frames can be combined with the modeling power of SepFormer-style architectures.

Proposed Architecture

The researchers adapted the SepFormer architecture—a dual-path Transformer—for speech enhancement. They compared a standard learned encoder setup (1D convolutions, 2ms frames) against a magnitude-based STFT encoder (32ms frames).

Comparison of the general learned-domain architecture (a) and the proposed STFT-based magnitude architecture (b).

In the STFT version, the model processes only the magnitudes to generate an enhancement mask. This mask is applied to the noisy magnitudes, which are then recombined with the original noisy phase for reconstruction via inverse STFT (iSTFT). This design leverages the fact that at 32ms, spectral resolution is high enough that magnitude carries the bulk of the signal's intelligibility, allowing the model to ignore phase during processing.

The core of the model is the dual-path scheme, which handles long sequences by breaking them into overlapping chunks:

  • Intra-Transformer: Models local relationships within individual chunks.
  • Inter-Transformer: Models long-term dependencies across different chunks.
Detailed view of the mask generation process, the dual-path SepFormer architecture, and the internal Transformer block structure.

Experimental Setup

The models were trained on 100 hours of noisy mixtures from the DNS-Challenge dataset (16kHz). Evaluation utilized a subset of the WSJ0 (Wall Street Journal) corpus for clean speech, mixed with noise from the CHiME3 Challenge dataset. Testing spanned Signal-to-Noise Ratios (SNRs) from -10dB to 15dB.

Results and Analysis

The STFT-based model achieved parity with the learned-encoder version while being significantly more efficient.

Efficiency Gains

The most notable improvement was in computational load. By moving to 32ms frames, the sequence length $L$ decreased by a factor of 16. This resulted in:

  • Operations: A reduction from 45.75 to 5.93 GMACs (a 7.7x reduction).
  • Memory: While the learned-encoder version's memory usage exceeded 4GB for a 60-second clip, the STFT version remained under 2GB even for clips up to 150 seconds.
  • Speed: Execution time for a 10-second input was reduced by approximately 6x on both CPU and GPU.

Speech Quality

Despite the simpler magnitude-only processing, the STFT version (32ms frames, 75% overlap) achieved a POLQA score of 3.01 (vs. 2.98 for the learned encoder) and an ESTOI of 0.78 (vs. 0.79). Informal listening tests also suggested that the STFT version avoided certain "buzzing" artifacts present in the learned-encoder output.

Conclusion

This study demonstrates that revisiting traditional signal processing techniques like the STFT can yield massive efficiency gains for modern Transformer-based models. By using longer frames and focusing on magnitudes, the computational bottleneck of self-attention is significantly mitigated.

Future work includes addressing the higher algorithmic latency inherent in 32ms frames and exploring "phase-aware" processing to further enhance quality in extreme noise conditions. Implementing these optimizations on embedded hardware remains a key next step for real-time applications.

Summary updated

BibTeX
@inproceedings{oliveira2022efficient,
  author = {Danilo de Oliveira and Tal Peer and Timo Gerkmann},
  title = {{Efficient Transformer-based Speech Enhancement Using Long Frames and STFT Magnitudes}},
  booktitle = {Interspeech},
  year = {2022},
  url = {https://openreview.net/forum?id=gaIDZabSAZ},
}
Figure