multires.h File Reference

Go to the source code of this file.

Functions

void HSplitSpec (int X, int Y, double **Spec, double **&lSpec, double **&uSpec)
 
void HSplitSpecs (int N, double ***Specs, double ***&lSpecs, double ***&uSpecs)
 
void VSplitSpec (int X, int Y, double **Spec, double **&lSpec, double **&rSpec)
 
void VSplitSpecs (int N, double ***Specs, double ***&lSpecs, double ***&rSpecs)
 
double MixSpectrogram (double **Spec, double ***Specs, int Fr, int WID, int wid, bool norm=true, bool normmix=true, int ***cuts=0)
 
double MixSpectrogram (int **spl, double **Spec, double ***Specs, int Fr, int WID, int wid, bool norm=true, bool normmix=true)
 

Detailed Description

  • composite spectrogram routines

This unit deals with basis selection from multiresolution Fourier bases set.

A tiling of an area of the T-F plane is represented as a sequence of 0's and 1's, each 0 represents a horizontal split-in-half, each 1 represents a vertical split-in-half. The sequence is made up of three pieces: 1) the first entry giving the direction of primary split; 2) the tiling of the upper or left half after the primary split; and 3) the tiling of the lower or right half.

A composite spectrogram is represented as a tiling and a vector of amplitude (or square amplitude) values, each representing the energy within a tile. If the primary split is horizontal, then the first/second half of the amplitude or power vector represents the the upper/lower half of the composite spectrogram; if the primary splits is vertical, then the first/second half of the amplitude or power vector represents the left/right half of the composite spectrogram.

Further reading: Wen X. and M. Sandler, "Composite spectrogram using multiple fourier transforms," IET Signal Processing, 3(1):51-63, 2009.

Function Documentation

void HSplitSpec ( int  X,
int  Y,
double **  Spec,
double **&  lSpec,
double **&  uSpec 
)

function HSplitSpec: split a spectrogram horizontally into lower and upper halves.

In: Spec[X][Y]: spectrogram to split Out: lSpec[X][Y/2], uSpec[X][Y/2]: the two half spectrograms

No return value. Both lSpec and uSpec are allocated anew. The caller is responsible to free these buffers.

void HSplitSpecs ( int  N,
double ***  Specs,
double ***&  lSpecs,
double ***&  uSpecs 
)

function HSplitSpecs: split a multiresolution spectrogram horizontally into lower and upper halves

A full spectrogram array is given in log2(N)+1 spectrograms, with the base spec of 1*N, 1st octave of 2*(N/2), ..., last octave of N*1. When this array is split into two spectrogram arrays horizontally, the last spec (with the highest time resolution). Each of the two new arrays is given in log2(N) spectrograms.

In: Specs[nRes+1][][]: multiresolution spectrogram Out: lSpecs[nRes][][], uSpecs[nRes][][], the two half multiresolution spectrograms

This function allocates two 2nd order arrays of double*, which the caller is responsible to free.

double MixSpectrogram ( double **  Spec,
double ***  Specs,
int  Fr,
int  WID,
int  wid,
bool  norm,
bool  normmix,
int ***  cuts 
)

function MixSpectrogram: obtain composite spectrogram from multiresolutin spectrogram as pixel grid

This method deals with Fr (base) frames of WID samples. Each base frame may be divided into 2 1st- octave frames, 4 2nd-octave frames, ..., etc. The spectrogram calculated on base frame is given in Specs[0] (Fr frames); that of 1st octave is given in Specs[1] (2*Fr frames); etc. The method resamples the spectrograms of different frame width into a single spectrogram so that the entropy is maximized globally.

The output Spec is a spectrogram of apparent resolution WID at hop size wid. It is a redundant representation, with equal values occupying blocks of size WID/wid.

In: Specs[0][Fr][WID], Specs[1][Fr*2][WID/2], ..., Specs[Res-1] [Fr*(WID/wid)][wid], multiresolution spectrogram Out: Spec[Fr*(WID/wid)][WID], composite spectrogram as pixel grid cuts[Fr][wid][N=Wid/wid], tilings of small square blocks Returns 0.

double MixSpectrogram ( int **  spl,
double **  Spec,
double ***  Specs,
int  Fr,
int  WID,
int  wid,
bool  norm,
bool  normmix 
)

function MixSpectrogram: obtain composite spectrogram from multiresolutin spectrogram as vectors

In: Specs[0][Fr][WID], Specs[1][Fr*2][WID/2], ..., Specs[Res-1] [Fr*(WID/wid)][wid], multiresolution spectrogram Out: spl[Fr][WID], Spec[Fr][WID], composite spectrogram as tiling and value vectors by frame.

Returns 0.

void VSplitSpec ( int  X,
int  Y,
double **  Spec,
double **&  lSpec,
double **&  rSpec 
)

function VSplitSpec: split a spectrogram vertically into left and right halves.

In: Spec[X][Y]: spectrogram to split Out: lSpec[X][Y/2], rSpec[X][Y/2]: the two half spectrograms

No return value. Both lSpec and rSpec are allocated anew. The caller is responsible to free these buffers.

void VSplitSpecs ( int  N,
double ***  Specs,
double ***&  lSpecs,
double ***&  rSpecs 
)

function VSplitSpecs: split a multiresolution spectrogram vertically into left and right halves

A full spectrogram array is given in log2(N)+1 spectrograms, with the base spec of 1*N, 1st octave of 2*(N/2), ..., last octave of N*1. When this array is split into two spectrogram arrays horizontally, the last spec (with the highest time resolution). Each of the two new arrays is given in log2(N) spectrograms.

In: Specs[nRes+1][][]: multiresolution spectrogram Out: lSpecs[nRes][][], rSpecs[nRes][][], the two half multiresolution spectrograms

This function allocates two 2nd order arrays of double*, which the caller is responsible to free.