WORLD.jl

WORLDModule.

A lightweitht julia wrapper for WORLD - a high-quality speech analysis, manipulation and synthesis system. WORLD provides a way to decompose a speech signal into:

  • Fundamental frequency (F0)

  • spectral envelope

  • aperiodicity

and re-synthesize a speech signal from these paramters. Please see the project page for more details on the WORLD.

Note

WORLD.jl is based on a modified version of WORLD (r9y9/WORLD).

https://github.com/r9y9/WORLD.jl

Usage

In the following examples, suppose x::Vector{Float64} is a input monoral speech signal like:

F0 estimation and refinement

DIO

opt = DioOption(f0floor=71.0, f0ceil=800.0, channels_in_octave=2.0,
        period=period, speed=1)
f0, timeaxis = dio(x, fs, opt)

StoneMask

f0 = stonemask(x, fs, timeaxis, f0)

Spectral envelope estimation by CheapTrick

spectrogram = cheaptrick(x, fs, timeaxis, f0)

Aperiodicity ratio estimation by D4C

aperiodicity = d4c(x, fs, timeaxis, f0)

Synthesis

y = synthesis(f0, spectrogram, aperiodicity, period, fs, length(x))

Compact speech parameterization

Raw spectrum envelope and aperiodicity spectrum are relatively high dimentional (offen more than 513 or 1025) so one might want to get more compact representation. To do so, mel-cepstrum could be a good choice. As far as I know, this would be useful in statistical speech synthesis and statistical voice conversion.

spectrum envelope to mel-cepstrum

mc = sp2mc(spectrogram, order, α) # e.g. order=40, α=0.41

where order is the order of mel-cepstrum (except for 0th) and α is a frequency warping parameter.

mel-cepstrum to spectrum envelope

approximate_spectrogram = mc2sp(mc, α, get_fftsize_for_cheaptrick(fs))

aperiodicity spectrum to aperiodicity mel-cesptrum

ap_mc = sp2mc(aperiodicity, order, α) # e.g. order=40, α=0.41

Note

HTS v2.3 beta seems to parameterize aperiodicity spectrum in this way (but does this really make sense?).

aperiodicity mel-cepstrum to aperiodicity spectrum

approximate_aperiodicity = mc2sp(ap_mc, α, get_fftsize_for_cheaptrick(fs))

For the complete code of visualizations shown above, please check the IJulia notebook.

Exports

source

Index

Reference

WORLD.cheaptrickMethod.
cheaptrick(x, fs, timeaxis, f0; opt)

CheapTrick calculates the spectrogram that consists of spectral envelopes estimated by CheapTrick.

Parameters

  • x : Input signal

  • fs : Sampling frequency

  • time_axis : Time axis

  • f0 : F0 contour

  • opt : CheapTrick option

Returns

  • spectrogram : Spectrogram estimated by CheapTrick.

source
WORLD.d4cMethod.
d4c(x, fs, timeaxis, f0; opt)

D4C calculates the aperiodicity estimated by D4C.

Parameters

  • x : Input signal

  • fs : Sampling frequency

  • time_axis : Time axis

  • f0 : F0 contour

Returns

  • aperiodicity : Aperiodicity estimated by D4C.

source
WORLD.dioFunction.
dio(x, fs, opt)
dio(x, fs)

Dio estimates F0 trajectory given a monoral input signal.

Paremters

  • x : Input signal

  • fs : Sampling frequency

  • opt : DioOption

Returns

  • time_axis : Temporal positions.

  • f0 : F0 contour.

source
get_fftsize_for_cheaptrick(fs)

GetFFTSizeForCheapTrick calculates the FFT size based on the sampling frequency and the lower limit of f0 (It is defined in world.h).

Parameters

  • fs: Sampling frequency

Returns

  • fftsize : FFT size

source
WORLD.interp1!Method.
interp1!(x, y, xi, yi)

inplace version of interp1

Parameters

  • x : Input vector (Time axis)

  • y : Values at x[n]

  • xi: Required vector

  • yi : Interpolated vector

source
WORLD.interp1Method.
interp1(x, y, xi)

interp1 interpolates to find yi, the values of the underlying function Y at the points in the vector or array xi. x must be a vector. http://www.mathworks.co.jp/help/techdoc/ref/interp1.html

Parameters

  • x : Input vector (Time axis)

  • y : Values at x[n]

  • xi: Required vector

Returns

  • yi : Interpolated vector

source
WORLD.mc2spMethod.
mc2sp(mc, α, fftlen)

mc2sp converts mel-cepstrum to power spectrum envelope.

$c_{\alpha}(m) -> |X(\omega)|^{2}$

equivalent: exp(2real(MelGeneralizedCepstrums.mgc2sp(mc, α, 0.0, fftlen))) Note that MelGeneralizedCepstrums.mgc2sp returns log magnitude spectrum.

source
WORLD.sp2mcMethod.
sp2mc(powerspec, order, α; fftlen)

sp2mc converts power spectrum envelope to mel-cepstrum

$|X(\omega)|^{2} -> c_{\alpha}(m)$

source
WORLD.stonemaskMethod.
stonemask(x, fs, timeaxis, f0)

StoneMask refines the estimated F0 by Dio,

Parameters

  • x : Input signal

  • fs : Sampling frequency

  • time_axis : Temporal information

  • f0 : f0 contour

Returns

  • refined_f0 : Refined F0

source
WORLD.synthesisMethod.
synthesis(f0, spectrogram, aperiodicity, period, fs, len)

Synthesis synthesize the voice based on f0, spectrogram and aperiodicity (not excitation signal.

Parameters

  • f0 : f0 contour

  • spectrogram : Spectrogram estimated by CheapTrick

  • aperiodicity : Aperiodicity spectrogram based on D4C

  • period : Temporal period used for the analysis

  • fs : Sampling frequency

  • len : Length of the output signal

Returns

  • y : Calculated speech

source

CheapTrick options

Fields

  • q1

source
WORLD.D4COptionType.

D4C options (nothing for now, but for future changes)

Fields

  • dummy

source
WORLD.DioOptionType.

DioOption represents a set of options that is used in DIO, a fundamental frequency analysis.

Fields

  • f0floor

  • f0ceil

  • channels_in_octave

  • period

    frame period in ms

  • speed

  • allowed_range

    added in v0.2.1-2 (WORLD 0.2.0_2)

source