Using interpolator.

This page details how to use interpolator, a tool developed by Ivan Perry during November 1999.

What does interpolator do?

Interpolator is a tool that allows the full analysis/resynthesis of any harmonic sound. It uses additive to extract harmonic information from the sound and then models the remaining 'noise' component using spectral envelope analysis with the Super VP. Thus interpolator is able to fully reprsent the sound in data formats that can be easily manipulated or simply re-synthesised. As the name suggests, interpolator is also able to interpolate between sounds. It does this by interpolation between the data files created in the analysis process of the two sound files to be interpolated between. It then re-synthesises from the resulting interpolated data files. Interpolator is available on the Unix platform at Ircam and is called from the command line using the options below:

Interpolator stages:

-0f f0 calculation and flatten to value set by -F.
This allows the fundamental frequency to be set to a single value for the duration of the file. the value is set via the -F flag for first pass and -f flag for second pass (see -T flag for details on first and second pass).

-0n normal f0 calculation.
Use of this flag selects normal fundamental frequency detection.

-A 'Additive' analysis.
Analyse the sound file using additive to produce a format file and then synthesise from it.

-Sa SVP analysis.
Use Super VP to extract and store the spectral envelope from the noise file left over fromm additive analysis.

-Sz SVP synthesis.
Use file created by the -Sa option to re-synthesise the noise component of the signal.

-Saz/za SVP analysis and resynthesis.
Perform both the analysis and synthesis steps of the spectral envelope modeling process (like having -Sa and -Sz).

-Ih Interpolate between Additive .format files.
Interpolate the harmonic material. This means interpolating the additive format files from the two sounds to be interpolated and then synthesising from the resulting format file.

-In Interpolate between SVP spectral envelopes.
Interpolate the noise components of two signals. This means interpolating between the spectral envelope files from the the two sounds to be interpolated between and then synthesising from the resulting spectral envelope file.

-m mix harmonic and noise.
Mix the synthesised harmonic and noise files. After simple analysis/re-synthesis or interpolation the two resulting sound files (harmonic component and noise component) must be mixed to create a single output file. The ratio of harmonic to noise content can be set using -G and -g flags (see below).

-ph after interp run additive synthesis with phase.
After interpolation the default synthesis method ignores the phase values for each partial as they have not been interpolated. Setting this flag means that phase values will be taken into account on re-synthesis. This sometimes produces a desirable effect.

-T Use two passes of Additive.
This flag specifies that additive be used twice on the input sound file before the residual (noise file) is passed to Super VP. This is useful if the file is complex and contains two different harmonic sounds of different fundamental frequency. The first pass will detect and extract the first of these two harmonic sounds and the second pass can then find and detect the second. This ensures that all harmonic information is extracted before 'noise' analysis is carried out. For example a file containg a dominant fundamental at 100Hz but also a less dominant but still important fundamental at 30Hz. The first pass will detect and extract all harmonics of the 100Hz fundamental allowing the second pass to detect and extract the 30Hz fundamental and harmonics. This information would otherwise be lost in a single pass process.

-n modify noise envelope.
Interpolator allows the simple modification of the spectral envelope file of any sound file by the multiplying it by a breakpoint function. To do this, set the -n flag and then create a breakpoint function file called 'breakpoint'(see Super VP literature for format) in the SFDIR.

Analysis parameters:

-D/d input sound file 1/2(All files must be present in SFDIR).
All files must be present in the SFDIR as interpolator does not handle absolute pathnames.

-N FFT width in samples (power of 2 >= analysis window).
Specifies the FFT width for the additive analysis. (default 2048)

-M analysis window width in sec (0.04 sec).
Specifies the analysis window size for additive analysis.

-I analysis step in sec (0.01).
Specifies the analysis stepsize for additive analysis. If two files are to be interpolated then the stepsize for the analysis of each must be equal.

-G/g gain for mixing harmoni/noise.
Specify the gain for mixing of the harmonic and noise components after synthesis. -G used to specify gain for harmonic component. -g used to specify gain for noise component. Good values to start with are 1 and 0.1 respectively (although values for -g as low as 0.001 can be expected to produce a good balance of harmonic to noise).

-F/f f0 for Additive analysis 1st Pass/2nd Pass.
Specify the value for fundamental for first and second pass if the -Of flag is selected.

-Q/q Number of Partilas to be considered 1st Pass/2nd Pass.
Specify the number of partials to be considered in the first and second pass of additive. Default values are 200 and 100 respectively.

-alpha (between 0 and 1) co-efficient for amplitude interpolation of Additive .format data.
Specifies the interpolation coefficient for the amplitude of partials in the additive format files.

-beta (between 0 and 1) co-efficient for frequency interpolation of Additive .format data.
Specifies the interpolation coefficient for the frequency of partials in the additive format files.

-gamma (between 0 and 1) co-efficient for interpolation of spectral envelopes.
Specifies the interpolation coefficient for the spectral envelope files. In all interpolation coefficient cases a value of 1 creates a file whose parameters are the same as infile1 (-D) and a value of 0 creates a file whose parameters are the same as infile2 (-d).

Examples of use:

Simple analysis/re-synthesis.
To simply analyse a sound and then resynthesise from the analysis files then the command line is called as below:

interpolator -A -Of -Saz -T -m -g 0.1 -Q 220 -q 6 -F 100 -f 30 -D Piano.sf

This example analyses the sound Piano.sf using additive taking partials up to the 100th harmonic in the first pass with a specified fundamental of 220Hz. It then performs a second pass considering six partials of fundamental 30Hz. The residual is then analysed and a spectral envelope file created. The two files (harmonic sound from additive data and noise from spectral envelope iformation) are then re-synthesised. The -m flag specifies that we want to mix theses sound files to create a single output (called mixedPiano) with a gain of 0.1 for the noise file.

Interpolation between two sounds.
In this example we will interpolate between two sounds Piano.sf and Guitar.sf. The process invloves three separate calls to interpolator. The command lines are shown below:

interpolator -A -On -Sa -T -D Piano.sf

interpolator -A -On -Sa -T -D Guitar.sf

These two lines simply provide the relevant analysis files for the next step. Here I have specified the -T flag, though for analysis of truly harmonic sounds this would not actually be necassary and should be ommitted.

interpolator -In -Ih -T -m -g 0.1 -ph -alpha 0.8 -beta 0.2 -gamma 0.5 -D Piano.sf -d Guitar.sf

This line then interpolates the two sets of analysis files and synthesises and mixes the resulting harmonic and noise files. The -T flag has to be specified because the analysis files were created with a -T flag. I have also specified the -ph flag so as to include phase information in the synthesis process. In the case of most harmonic sounds these flags would not actually be used. Their main purpose is to add flexibilty to the program when working with partly harmonic sounds. Mixing is specified with a gain of 0.1 for the noise file and the interpolation coefficients are set up to provide an interesting hybrid sound. The alpha parameter set at 0.8 means that the amplitude information in the output interpolated format file will be close to that of the format file for Piano.sf while the frequency information, set by -beta 0.2, will be close to that of the format file of Guitar.sf. This means that, upon re-synthesis, the resulting harmonic sound will have similar spectral amplitude characteristics to Piano.sf (partial to partial) while it's frequency content will be more similar to Guitar.sf. Setting gamma to 0.5 means that the synthesised noise file should be an interpolation exactly between the residual file of Piano.sf and Guitar.sf.

Examples of output:

Below are some examples of interpolated soundfiles created with interpolator. Firstly there is the list of original soundfiles and then there are the soundfiles which were the interpolations of the originals.













Flute and Trombone.

Flute and Trumpet.

Flute and Clarinet.

Clarinet and Saxophone.

Clarinet and Violin.

Saxophone and Trumpet.

Saxophone and Trombone.

Trombone and Violin.

Trombone and Cello.

Guitar and Clarinet.

Guitar and Flute

Guitar and Cello.

Bassoon and Trumpet.

How these files were created.

These soundfiles were all made using the most generic command lines. These are shown below:

interpolator -A -On -Sa -D Soundfile1

interpolator -A -On -Sa -D Soundfile2

interpolator -In -Ih -m -g 0.001 -alpha 0.5 -beta 0.5 -gamma 0.5 -D Soundfile1 -d Soundfile2

Different Interpolation co-effecients.

By using a slightly different third line with -alpha, -beta and -gamma set to an alternative value (in the next two examples 0.8 and 0.2) it is possible to create sounds closer to one or other of the input soundfiles:

Flute and Trombone combined with 80% Flute (-alpha, -beta, -gamma set at 0.8).

Flute and Trombone combined with 20% Flute (-alpha, -beta, -gamma set at 0.2).

Important.For interpolator to synthesise the noise compnent of any signal it is essential that there exists, in the directory specified by Unix environmental variable SFDIR, an .aiff file of white noise at least as long as the sound to be synthesised.

Ivan Perry 1/12/99