{'fraction_non_alphanumeric': 0.03552881896241452, 'fraction_numerical': 0.016658954187875982, 'mean_word_length': 4.8743581999395955, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Full-band General Audio Synthesis with Score-based Diffusion

Recent works have shown the capability of deep generative models to tackle general audio synthesis from a single label, producing a variety of impulsive, tonal, and environmental sounds. Such models operate on band-limited signals and, as a result of an autoregressive approach, they are typically conformed by pre-trained latent encoders and/or several cascaded modules. In this work, we propose a diffusion-based generative model for general audio synthesis, named DAG, which deals with full-band signals end-to-end in the waveform domain. Results show the superiority of DAG over existing label-conditioned generators in terms of both quality and diversity. More specifically, when compared to the state of the art, the band-limited and full-band versions of DAG achieve relative improvements that go up to 40 and 65%, respectively. We believe DAG is flexible enough to accommodate different conditioning schemas while providing good quality synthesis.


INTRODUCTION
Audio synthesis is the computerized generation of audio signals. This task has been primarily tackled under a source-specific paradigm, hence modeling a single type of audio per model. Examples of this paradigm are text-to-speech [1], music synthesis [2][3][4], or less commonly modeled sources like footsteps [5] or laughter [6], among others. Nonetheless, a few recent works propose a sourceagnostic paradigm, in which generative models can synthesize different types of audio with appropriate conditioning injected into a single neural network. We refer to this as general audio synthesis.
In this context, Kong et al. [7] propose to model environmental sounds with a class-conditioned SampleRNN. This is a deep autoregressive generative model that operates in the time-domain. On the other hand, Liu et al. [8] propose another autoregressive model exploiting a VQ-VAE-2 encoder-decoder strategy [9]. In this setup, a VQ-VAE is trained to create a codebook of audio features extracted from melspectrograms. Hence, the model incorporates a downsampling and upsampling of the original signal space into a discretized latent. Then, a class-conditioned PixelSNAIL autoregressive model [10] is built as a language model of these discrete latent token sequences. An advantage of this cascaded design is that the expensive autoregressive computation can be alleviated while working with a lower time-resolution in the latent, thanks to its autoencoding design. Since the VQ-VAE operates on melspectrograms, a HifiGAN [11] trained with general audio content is plugged on top of the auto-encoder reconstructions to convert them into waveforms.
Other works concurrent to ours tackle more specialized synthesis tasks within the source-agnostic paradigm, like text-to-audio synthesis (that is, generating audio that is representative of a given natural language description). This way, following the cascaded framework of Liu et al., Yang et al. [12] propose DiffSound, a textconditioned diffusion probabilistic model that replaces the autoregressive PixelSNAIL and improves generation quality and speed. In addition, Kreuk et al. [13] propose AudioGen, another cascaded model for text-to-audio in which a discrete latent is learned from raw waveforms and an attention-based autoregressive decoder generates the discrete latent stream. Note that these cascaded and/or autoregressive designs impose a limitation in the bandwidth of the generated signal. For instance, a component in the cascade can be a band-limited bottleneck. Alternatively, the latent discretization imposed by autoregressive modeling, or the autoregressive design in the raw signal space itself, can lead to sampling rate limitations. This happens to avoid a large quality loss in the compression for the former case, or a high computational inefficiency due to long sequence generations in the latter case.
Despite various advancements on general audio synthesis, we argue that state-of-the-art methods are limited due to (i) targeting audio content below 11 kHz bandwidth, (ii) reusing previous (and sometimes pre-trained for a different task) modules in a complex cascaded framework, and (iii) quantizing latents with potential quality loss. In this work, we propose the diffusion audio generator (DAG), a fullband end-to-end source-agnostic waveform synthesizer. While previous works are band-limited due to modeling constraints, DAG is built upon a lossless auto-encoder that can directly generate 48 kHz waveforms (24 kHz bandwidth). In addition, its end-to-end design makes it simpler to train and use, avoiding intermediate information bottlenecks or possible cumulative errors from one module to the next one. Furthermore, DAG is built upon a score-based diffusion generative paradigm [14,15], which has shown great performance in related fields like speech synthesis [16,17], universal speech enhancement [18], or source-specific audio synthesis [3]. Our results show that DAG is capable of generating higher quality content while being a simpler and more parameter-efficient approach. This is evidenced from relative improvements up to 40 and 65% with respect to the state of the art, depending on whether band-limited or full-band signals are generated. Besides the empirical results reported here, we also provide additional audio samples to showcase some of the possibilities that our solution offers and to highlight its potential.

DIFFUSION AUDIO GENERATOR
We propose a deep generative audio model based on score-matching with variance exploding diffusion [14,15]. The generator, which follows the denoising score matching strategy from the speech synthesis work [18], is trained to minimize where t ∼ U(0, 1), zt ∼ N (0, I), x0 ∼ pdata,S is the generated score, c is the conditioning signal, and σt values follow a geometric arXiv:2210.14661v1 [cs.SD] 26 Oct 2022 noise schedule [14]. We use σ0 = 10 −3 and σ1 = 1 in all experiments, which we find sufficient after informal listening. To obtain c, we project the discrete class labels through an embedding matrix E ∈ R v×10v , where v is the vocabulary size of the label set.
To sample audio, we follow noise-consistent Langevin dynamics [19], corresponding to the recursion over N uniformly discretized time steps tn ∈ [0, 1], starting with x1 = σ1z1. As in [18,20], we set η and β with the help of an hyperparameter α ∈ [1, ∞): where δ = σt n /σt n+1 is the ratio of the geometric progression of the noise. Differently from [18,20], we here experiment with classifierfree guidance [21], which trades-off quality for diversity and introduces another hyper-parameter γ ≥ 0 in the calculation of the score: where S is the output of the DAG network trained with 10% dropout for unconditional training [21]. This dropout happens by replacing an actual input label from the training vocabulary by a learnable null token, initialized with zeros, which states that the sample is unconditioned. Since we observed that γ > 0 could yield clipped or distorted results, we decided to rescale the empirically denoised sample [19] (full audio) between −1 and 1 at every iteration in case it falls outside that range. Note that this corresponds to a 100 th percentile dynamic thresholding strategy [22]. The DAG architecture is depicted in Figure 1. Inspired by the UNet auto-encoding frameworks of previous score-based diffusion works [3,17,18], the model features an encoder and a decoder. The encoder is built with downsampling convolutional feature encoders. These transform the input signal into a low-rate sequence of hidden feature embeddings through the application of subsequent convolutions with stride factors ∆ k , where k is the layer index. These factors are configured according the target sampling rate. Finally, these hidden features are processed through bidirectional gated recurrent units (GRUs), which aggregate temporal information to attain a much broader receptive field at the decoder input. A residual connection surrounding GRUs alleviates possible gradient flow issues due to their saturating activations, and we include a linear projection before the residual summation to adjust dimensionalities.
The decoder converts the encoder hidden features back to the input signal's resolution by upsampling with transposed convolutions, employing reversed factors with respect to the encoder. In this case, another stack of GBlocks is inserted. The only difference between these blocks and the ones from the encoder are the change of downsampling stages (linear downsampler in skip connection and strided convolution) by upsampling ones (linear upsampler in skip connection and transposed convolution). Also, each encoder level is connected to its corresponding decoder level through a skip connection. Note that all GBlocks feature 4 convolutional blocks, 4 non-linear activations (LeakyReLUs), and 4 FiLM conditioning layers. To obtain the FiLM conditioning signals, we first process the logarithm of σ with random Fourier feature embeddings [3] followed by a multilayer perceptron (MLP), which yields the embeddings g in Figure 1. Then, g is concatenated with c to drive the FiLM layers. Signals h and (c, g) correspond, respectively, to the input to each GBlock and its conditioning signal's label and σ projections.

Datasets
To evaluate the effectiveness of DAG to synthesize multiple types of sounds, we resort to two datasets that contain a mixture of impulsive and sustained sound events: UrbanSound8K [23] (US8K) and TUT Acoustic Scenes from DCASE 2016 Task 1 [24] (TUT). US8K contains almost 9 hours of audio, sub-divided into 10 classes that mix ambiance and impulsive sounds, like air conditioner or dog barks. For our experiments, we follow Liu et al. [8] by first partitioning US8K into 8 hours of training data and 50 minutes of test data. Then, we further divide the training split by taking 10% of the files for validation across all folds. TUT contains 13 hours of audio, subdivided into 15 classes, all of them being mainly ambiance sound. The dataset comes with a pre-made training split of almost 10 hours, with 3 hours of test data. As in US8K, we further divide the training partition by taking 10% of the files for validation.

Baselines and Configuration
We compare our approach with two state-of-the-art deep generative models for label-based general audio synthesis: the one of Kong et al. [7] (SampleRNN) and the one of Liu et al. [8] (PixelSNAIL). The former operates in the time-domain, hence performing as an endto-end solution. The latter operates on pre-trained VQ-VAE latent features. As introduced earlier, both are auto-regressive models and, due to their design constraints, they operate at 16 kHz and 22050 Hz, respectively. Here, we re-train both of them at 22050 Hz. SampleRNN -Following [7], we implement a two-tier conditional SampleRNN with the previously proposed configuration, using the code from the official repository 1 . The model is trained on our data partition using similar hyper-parameters as in the original publication until we observe convergence (300 k and 400 k iterations for US8K and TUT, respectively).
PixelSNAIL -This baseline is based on the three cascaded modules introduced in section 1, which are trained separately: (i) VQ-VAE, (ii) PixelSNAIL, and (iii) HifiGAN [8]. Experiments were conducted using the code from the official repository 2 . The VQ-VAE and PixelSNAIL modules are trained on our data partition with the default hyper-parameters until we observe convergence (100 k and 500 k iterations, respectively), and the HifiGAN module is pretrained on US8K from the repository. For the results on TUT, we also tried to train the HifiGAN module, but observed worse performance (see section 4.1).

Objective Metrics
Previous works evaluate their proposals objectively in terms of quality and diversity [7,8]. Their measures rely on auxiliary classifiers to determine how alike does generated data look with respect to real data, or acoustic features where statistics between sets are compared. More recently, Fréchet audio distance (FAD) was proposed as a metric to assess source separation quality and was shown to better correlate with human judgement when compared to existing metrics. [25]. FAD is built upon a VGGish classifier encoder pre-trained on a source-agnostic dataset. Then, the Fréchet distance between a reference set and an evaluated set is computed on top of the encoder embeddings. Since this metric is proven to be effective in detecting perceptual nuances in the audio [25], it has been recently used to assess audio generation quality [3,13]. Nevertheless, a potential limitation of using VGGish is in its input features: the model deals with 16 kHz signals, which may suffice for classification but is totally insufficient for full-band synthesis.
In this work, we propose to switch from VGGish to an openly available pre-trained audio encoder that operates upon 48 kHz signals. The motivation is to evaluate the full-band capability of current and future systems performing general audio synthesis. OpenL3 encoders [26] are open source front-ends that operate at 48 kHz (we use the env-mel256 front-end with 512-dimensional embeddings from the official repository 3 ). We simply name this metric Fréchet distance (FD), to differentiate it from the previously existing VG-Gish band-limited approach. Since Fréchet distance variants are known to evaluate both quality and diversity in the generated samples [27], we also consider a logit score (LS), which follows the Inception score formulation [28] and focuses the analysis on quality itself. This way, a simultaneously low FD and high LS shows a well functioning model in terms of both quality and diversity. LS is computed upon the logit activations of a pre-trained classifier. Departing from the FD feature extractor, we train an MLP per dataset while freezing the OpenL3 front-end. These MLPs are trained until convergence, and the best scoring iterations in validation are selected. They score 83.1 and 97.2% on US8K and TUT test sets, respectively. Table 1 shows the FD and LS scores obtained by all models on US8K and TUT. On the one hand, we observe that PixelSNAIL scores better than sampleRNN on US8K, as reported by Liu et al. [8]. On the other hand, we observe that retraining all the modules in the Pixel-SNAIL cascade for TUT (PixelSNAIL w/ TUT-HifiGAN) leads to an undereperforming model, mainly due to issues with HifiGAN. We hypothesize this may be related to the more environmental nature of TUT, and to the HifiGAN losses not being tuned for this scenario. Nonetheless, since HifiGAN operates as a melspectrogram-towaveform inverter, we can plug the pre-trained HifiGAN from US8K to do the task in TUT. This makes the model perform competitively again with respect to SampleRNN.

Comparison with Existing Approaches
DAG models systematically outperform the baselines and, since the evaluation front-end is pre-trained upon full-band signals, there is a substantial gap between 22050 Hz and 48 kHz models, both in terms of FD and LS. The relative gain of DAG48 upon PixelSNAIL in FD is 58.4% on US8K and 64.9% on TUT. In the band-limited scenario, note that only downsampling DAG48 yields 20.5% and 41% relative gains for FD and LS, respectively, compared to Pixel-SNAIL in US8K, which was specifically trained to model the bandlimited characteristics of the signal alone. In TUT, the FD improvement is 26.6%, and for LS it is 9.4%. However, the DAG22 variant shows that there is room for improving the model performance in band-limited scenarios when training it specifically at 22050 Hz, since the model can score equal or better in FD than DAG48 downsampled. This gap is especially notorious for the TUT dataset. The relative gains for DAG22 upon the baseline then become 24.1% for FD and 40.0% for LS on US8K. For TUT, the relative gains are 39.6% and 18.9% over PixelSNAIL. Figure 2 shows DAG48 performance when changing the classifierfree guidance weight γ (left), as well as the sampling hyperparameter α (right). Regarding γ, its increase translates into a quick improvement of the synthesis quality, especially with a low amount of steps in the Langevin sampling N . This means that a model with 50 steps can already get a competitive performance with γ = 2, which reduces substantially the computational cost when compared to N = 200. Note that when N is increased, a higher guidance weight degrades the quality, and that this degradation is faster with longer sampling processes. The fact that the LS curves saturate with γ = 4 but FD increases may indicate a loss in diversity at the expense of more realism, something intrinsic to the classifier-free guidance technique [21]. Regarding α, we observe a trend where the choice of a particular value seems to be less critical, especially if we can afford to sample with N = 200 steps. Nevertheless, a factor α = 2 works well overall, and is of importance when we want to reduce the sampling computational complexity with N < 200.  Table 1: Fréchet distance (FD) and logit score (LS) results on US8K and TUT data sets. DAG models were generated with sampling parameters α = 2, N = 100, γ = 2 for US8K, and γ = 0 for TUT. Metrics computed with OpenL3 at 48 kHz.

Additional Samples and Qualitative Analysis
It is observed that the TUT and US8K datasets contain mostly noisy ambiance with some target sound events happening in the background, which makes it difficult to identify if some low-quality synthesis samples are due to the training data or a model limitation. Therefore, we use additional clean foreground sounds as training data to further experiment with DAG's modeling capability and generation quality. This data is an in-house collection of carefullypicked high-quality samples from Freesound 4 , including wind, rain, river, waves, fire, footsteps, applause, horses, and piano music. This selection aims at covering a wider range of signal characteristics, from modulated noise and sinusoids to transients. The resulting synthesis samples are promising: the attacks of footsteps, fire crackling or piano sound crispy; the noisy wind, rain, or waves sound naturally smooth; the individual bubbling in river and the individual clapping in crowd applause can be heard clearly.
Some generated examples are available for listening on the project website 5 as a demonstration of DAG's great potential to synthesize general audio with quality and diversity. Moreover, we show some results of a simple audio style transfer approach enabled by DAG's modeling strategy. Here, we inject a normalized input signal y before the first sampling step, such that x1 = y + σ1z1 (see equation 1).

CONCLUSIONS
In this work, we propose the diffusion audio generator, a full-band general audio synthesis model based on score-based diffusion. With this, we tackle the source-agnostic audio synthesis problem with an end-to-end solution capable of outperforming the state of the art in a label-to-audio setup for two datasets that mix environmental and impulsive sounds. Moreover, we investigate the effectiveness of recent sampling techniques for diffusion models, like classifier-free guidance, showing that it can greatly benefit the performance of our model whilst reducing the amount of sampling steps needed to achieve a certain level of quality.

ACKNOWLEDGEMENTS
We would like to thank Giulio Cengarle for fruitful guidance on signal processing methods.