view multires.h @ 12:4b35f8ac5113

Fix: do not synthesize sinusoids above Nyqvist freq.
author wenx <xue.wen@eecs.qmul.ac.uk>
date Fri, 12 Aug 2011 18:10:46 +0100
parents 977f541d6683
children
line wrap: on
line source
/*
    Harmonic sinusoidal modelling and tools

    C++ code package for harmonic sinusoidal modelling and relevant signal processing.
    Centre for Digital Music, Queen Mary, University of London.
    This file copyright 2011 Wen Xue.

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
    published by the Free Software Foundation; either version 2 of the
    License, or (at your option) any later version.
*/
#ifndef multiresH
#define multiresH

/**
  \file multires.h - 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.
*/

//--memory re-indexing routines for internal use-----------------------------
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);

//--composite spectrogram algorithms-----------------------------------------
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);
#endif