Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 3.65 KB

documentation.md

File metadata and controls

45 lines (33 loc) · 3.65 KB

Documentation for 'Real-time Virtual Bass Enhancement'

Here are described the modules of the Virtual Bass Enhancement system. For an in-depth overview on the algorithms consult the paper available in the repository.

Audio I/O

The input and output are handled by the MATLAB Audio Toolbox for real-time applications.

  • The audio stream is generated and processed in the Test Bench environment. Running the 'tb.m' script opens the Test Bench. Here the user can choose what type of drivers to use, the type of input (file reader, oscillators, sound card input), the type of output (file writer, sound card output). The audio stream is processed with the alforithm in a frame-by-frame fashion.

  • A ready-to-play script 'tb_play.m' is also provided in the code folder for faster algorithm testing. Input and output devices are set to default, the user has to select an input audio file (wav, mp3, m4a, mp4 are supported), and will be provided with the same parameters of the test bench environment. The audio stream cannot be interrupted through the GUI, but this is intended for quick audio tests only.

Modules Structure

Each module and sub-module is implemented as a class of AudioPlugin.

Main

The main module is 'VBE_main'. It handles the implementation of the GUI and the main processing of the algorithm. The STFT processing frame is implemented here as the concatenation of four input buffers. The frame is shifted by one buffer at every iteration, so that 75% overlap is guaranteed. Filtering operations are also implemented in the main class. In particular, there is first the crossover filter with tunable crossover frequency, then the band-pass filtering of the enhanced bass signal is implemented using a 24dB/octave hi-pass filter and a 48dB/octave low-pass filter with tunable cut-off frequency. The output corresponds to the 1-to-BufferLength samples in the processing frame and is reconstructed from the high-pass signal and the enhanced low-pass signal.

Harmonics generation

The sub-modules that implement harmonics generation receive as input the low-passed mono version of the input signal and return an enhanced mono signal.

  • 'VBE_NLD' generates the enhanced signal using a full-wave rectifier ('Rectifier_full.m') followed by a simple gain stage.
  • 'VBE_PV' implements the overlap-and-add structure for harmonic generation using the phase vocoder ('PhaseVocoder.m') approach.
  • 'VBE_Hybrid' switches between the NLD and PV harmonics generation by means of a flag generated by an onset detector ('OnSetDetector.m'). The structure is the same as in VBE_PV, with the addition of the support to the onset detector and a switch case for the flag output.

Utilities

  • 'Rectifier_Full' is a fast and inexpensive implementation of a full wave rectifier.
  • 'PhaseVocoder' is the core of the frequency domain harmonics generation. First, it handles the downsampling and the transformation of the signal to the frequency domain. Then, it estimates the bark-scale envelope and fundamental frequency of the signal. Those are used to create and weight new harmonics in the spectrum. The phase locking scheme is also implemented here to maintain the phase coherence. Last, it transforms back the signal into time domain and resamples it to the original sampling frequency and length.
  • 'OnSetDetector' is used in the VBE_Hybrid module to discriminate transients from steady-state signals. It works by comparing the frequency peaks in the current processing frame with the peaks in previous one. For each iteration, an ODF value and a flag value is returned. The vector with the ODF values is then updated in the VBE_Hybrid module and used as input for further iterations to compute the threshold.