47
Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of Computing City University, London

Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Part 2Music Processing with MPEG-7

Low Level Audio Descriptors

Dr. Michael CaseyCentre for Computational Creativity

Department of ComputingCity University, London

Page 2: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

MPEG-7 Software Tools• ISO 15938-6 (Reference Software C++)

» http://www.lis.ei.tum.de/research/bv/topics/mmdb/e_mpeg7.html

• Audio Only Reference Software (Matlab)» http://ccc.soi.city.ac.uk/mpeg7 (City University Mirror)

Page 3: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Audio DescriptionsHeader

Page 4: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Audio Descriptions

Segments

Page 5: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Audio Descriptions

Descriptor

Page 6: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Containment Hierarchy for Audio Descriptors

SeriesOfScalarType

AudioSegmentType

AudioDSType

AudioLLDScalarType

AudioDType

SeriesOfVectorType

AudioLLDVectorType

ScalableSeriesType

Page 7: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Audio LLD DataTypes

Page 8: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Some Useful Descriptors for Music Processing

• AudioSpectrumEnvelopeD

• AudioSpectrumBasisD

• AudioSpectrumProjectionD

• SoundModelDS

• SoundModelStatePathD

• SoundModelStateHistogramD

Page 9: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Other Useful Descriptors for Music Processing

• AudioSpectrumFlatnessD

• AudioHarmonicityD

• AudioSpectrumCentroidD

Page 10: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumEnvelopeD

• Log frequency scale spectral power coefficients• Total power preserved across logarithmic bands

62.5 1K 16000

1 coeff 8 coeffs 1 coeff

total power

within-bandbelow-band above- band

Page 11: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumEnvelopeD

[AudioSpectrumEnvelope, attributegrp, map, XMLFile] = AudioSpectrumEnvelopeType(audioFile,hopSize,attributegrp,writeXML,XMLFile,map)

This function determines an AudioSpectrumEnvelopeand also returns the map from linear to log bands.

% EXAMPLE 1: AudioSpectrumEnvelopeD extractionag.octaveResolution='1/4';ag.loEdge=62.5;ag.hiEdge=8000;hopSize='PT10N1000F';fname='e:\Beatles\1\000100.wav';

[ASE,ag]=AudioSpectrumEnvelopeD(fname,hopSize,ag,1,'ase.xml');

Page 12: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumEnvelopeD

. . .

Page 13: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumEnvelopeD

Page 14: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumBasisD

SVD / ICABasis Rotation

AudioSpectrumProjectionD

AudioSpectrumBasisD

Page 15: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumBasisDAudioSpectrumBasisType -independent components of a spectrum matrix

[V,env]=AudioSpectrumBasis(X, k, DDL_FLAG)

Inputs:X - spectrum data matrix ( t x n, t=time points, n=spectral channels)k - number of components to extractDDL_FLAG - 1=write XML output. [0]

OutputsV - n x k matrix of basis functionsenv - L2-norm envelope of log Spectrogram data (required for MPEG7)

% EXAMPLE2: AudioSpectrumBasisD[ASB,env]=AudioSpectrumBasisD(ASE,10,'asb.xml');

Page 16: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumBasisD

Page 17: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumBasisD

Page 18: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumBasisD: Block Form

Page 19: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumProjectionDAudioSpectrumBasisD

SVD / ICABasis Rotation

AudioSpectrumProjectionD

Page 20: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumProjectionD

[P,maxenv] = AudioSpectrumProjectionD(X, V, XML)

InputsX = t x n matrix containing AudioSpectrumEnvelopeD values:

t=timepoints,n=frequency binsV = n x k matrix containing AudioSpectrumBasisD values

n=frequency bins, k=basis functions

DDL_FLAG XML file name [optional]

Output

P = t x (1 + k) matrix where each row contains 1 x L2-norm envelopecoefficient and k x spectral projection coefficients.

% EXAMPLE3: AudioSpectrumProjectionD extraction[ASP,maxEnv]=AudioSpectrumProjectionD(ASE,ASB,'asp.xml');

Page 21: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

AudioSpectrumProjectionD

Page 22: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

IndependentSpectrum Basis Features

Time Function

Reconstruction

1 Component

Spectral Feature

High Channel Spectrogram

Basis Reduction 4 Components

10 Components

Page 23: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Outer Product Spectrum ReconstructionIndividual Basis Component

Page 24: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

4 Component Reconstruction

Page 25: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

10 Component Reconstruction

Page 26: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Music Unmixing

• Linear basis projection using SVD and ICA• spectrum subspace separation • fast computation of subspace ICA• full-rate filterbank masking

• Blocked ICA functions• subspace reconstruction Y = XVV• cluster subspaces to identify “tracks”• sum masked filterbank output to create audio

+j j j

Page 27: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Music Unmixing Example 1

dB

Drum Mixture

Page 28: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Music Unmixing Example 1

Page 29: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Music Unmixing Example 1

Page 30: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Music Unmixing Example 1

Page 31: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Music Unmixing Example 2(Pink Floyd: stereo -> 9 subspace tracks)

Page 32: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelDS

Page 33: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Sound Model DSand related descriptors

1 3 3 2 2 3 4 4 4 4 .

1

2 34

ContinuousHiddenMarkovModelDS

AudioSpectrumBasisD

T(i,j)

x

AudioSpectrumEnvelopeD

AudioSpectrumProjectionD

SoundModelStatePathD

Page 34: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelDS - Bayesean inference of HMM parameters from training data

Y = SoundModelDS(TrainingDataListFile, nS, nB [,OPTIONAL ARGUMENTS...])

INPUTS:TrainingDataList - filename of training data list: WAV file names (one per line).

nS - number of states in hidden Markov model [10]nB - number of basis components to extract [10]

The following variables are optional, and are specified using['parameter', value pairs] on the command line.

'hopSize' 'PT10N1000F' - AudioSpectrumEnvelopeD hopSize'loEdge' 62.5, - AudioSpectrumEnvelopeD low Hz'hiEdge' 16000, - AudioSpectrumEnvelopeD high Hz'octaveResolution' '1/8' - AudioSpectrumEnvelopeD resolution'sequenceHopSize' '', - HMM data window hop [whole file]'sequenceFrameLength' '' - HMM data window length [whole file]'outputFile' '' - Filename for Model output [stem+mp7.xml]'soundName' '' - Model identifier name

OUTPUTS:

outputFile.dat = matlab struct Y.{T,S,M,C,X,maxenv,V,p}

T - state transition matrixS - initial state probability vectorM - stacked means matrix (1 vector per row)C - stacked inverse covariancesV - AudioSpectrumBasis vectors

maxenv- scaling parameter for model decodingp - training cycle likelihoods

outputFile.mp7 = XML file containing MPEG-7 SoundModel description scheme

Page 35: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelDS - Bayesean inference of HMM parameters from training data

Y = SoundModelDS(TrainingDataListFile, nS, nB [,OPTIONAL ARGUMENTS...])

INPUTS:TrainingDataList - filename of training data list: WAV file names (one per line).

nS - number of states in hidden Markov model [10]nB - number of basis components to extract [10]

The following variables are optional, and are specified using['parameter', value pairs] on the command line.

'hopSize' 'PT10N1000F' - AudioSpectrumEnvelopeD hopSize'loEdge' 62.5, - AudioSpectrumEnvelopeD low Hz'hiEdge' 16000, - AudioSpectrumEnvelopeD high Hz'octaveResolution' '1/8' - AudioSpectrumEnvelopeD resolution'sequenceHopSize' '', - HMM data window hop [whole file]'sequenceFrameLength' '' - HMM data window length [whole file]'outputFile' '' - Filename for Model output [stem+mp7.xml]'soundName' '' - Model identifier name

OUTPUTS:

outputFile.dat = matlab struct Y.{T,S,M,C,X,maxenv,V,p}

T - state transition matrixS - initial state probability vectorM - stacked means matrix (1 vector per row)C - stacked inverse covariancesV - AudioSpectrumBasis vectors

maxenv- scaling parameter for model decodingp - training cycle likelihoods

outputFile.mp7 = XML file containing MPEG-7 SoundModel description scheme

Process Small Chunks= Local Dynamics Model

Page 36: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelDS

Page 37: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelDS

Page 38: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelStatePathDA simplified representation of spectral dynamics

State Path

Page 39: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelStatePathD[Path,loglike]=SoundModelStatePathD(soundfilename, arg2 [,OPTIONAL ARGS])

Compute HMM State Path and log likelihood of sequence data

Inputs:soundfilename - filename of input sound (.wav or .au)arg2 - SoundModelDS structure or filename of binary SoundModelDS instance

(.mat)

The following variables are optional, and are specified using'parameter' value pairs on the command line.

'hopSize' 'PT10N1000F''loEdge' 62.5, 'hiEdge' 16000, 'octaveResolution' '1/8''sequenceHopSize' '','sequenceFrameLength' ''

% EXAMPLE 5: SoundModelStatePathD extraction[Path,ll]=SoundModelStatePathD(fname,Y,'octaveResolution','1/4','hiEdge',8000);

Page 40: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelStatePathD

Page 41: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelStatePathD

seconds

0.01s Frames

state index

state index

BEATLES: A Hard Day’s Night

Page 42: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelStateHistogramDSoundModelStateHistogramD(Path, Nstates, [segSkip], [segLen])

Extract normalized segmental state-path histograms

Inputs:Path - SondModelStatePathD outputNstates - Number of states in SoundModel[segSkip] - hop size in samples[segLen] - histogram length in samples

Outputs:H - t x n matrix containing segmented state occupancy histograms

t=time points, n=states

% EXAMPLE 6: SoundModelStateHistogramD extractionH=SoundModelStateHistogramD(Path,10,100,1000);

Page 43: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

SoundModelStateHistogramD

seconds

state index

state index

0.01s Frames

Page 44: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

S-Matrix

• Similarity Function• Segmented Histograms are Unit Norm• Outer Product Computes Similarity Matrix

>>size(H)

ans =

137 10

>>S = H * H’ ; % Similarity Matrix>>imagesc(S);>>D = real(acos(S)); % Dissimilarity Matrix

Page 45: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

S-Matrix

Page 46: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Sound Replacement and Audio Mosaics

• Find segments similar to target segment• Similarity Scores Computed between Histograms.• Cluster with k-means or pair-wise clustering.

• Replace with similar (but different) material• Segmentation boundaries (beat alignment)

• EXAMPLES

Page 47: Music Processing with MPEG-7 Low Level Audio …Part 2 Music Processing with MPEG-7 Low Level Audio Descriptors Dr. Michael Casey Centre for Computational Creativity Department of

Acknowledgements• International Standards Organisation

• ISO/IEC JTC 1 SC29 WG11 (MPEG)

• Mitsubishi Electric Research Labs• Massachusetts Institute of Technology

• Music Mind Machine Group (formerly Machine Listening Group)

• Paris Smaragdis, Youngmoo Kim, Brian Whitman• Iroro Orife, John Hershey, Alex Westner, Kevin Wilson

• City University • Deparment of Computing• Centre for Computational Creativity