Constant-Q Library
Public Member Functions
ConstantQ Class Reference

#include <ConstantQ.h>

Inheritance diagram for ConstantQ:
CQBase

List of all members.

Public Member Functions

 ConstantQ (CQParameters params)
virtual ~ConstantQ ()
virtual bool isValid () const
virtual double getSampleRate () const
virtual int getBinsPerOctave () const
virtual int getOctaves () const
virtual int getTotalBins () const
virtual int getColumnHop () const
virtual int getLatency () const
virtual double getMaxFrequency () const
virtual double getMinFrequency () const
virtual double getBinFrequency (double bin) const
ComplexBlock process (const RealSequence &)
ComplexBlock getRemainingOutput ()

Detailed Description

Calculate a complex sparse constant-Q representation from time-domain input. The input of each process call is a single frame of time-domain samples; the output is a series of columns of varying height. See process for details.

For a real (magnitude-only) interpolated dense representation, see CQSpectrogram.


Constructor & Destructor Documentation

Construct a complex Constant-Q transform object using the given transform parameters.

ConstantQ::~ConstantQ ( ) [virtual]

Member Function Documentation

double ConstantQ::getBinFrequency ( double  bin) const [virtual]

Return the frequency of a given bin in the Constant-Q output. This actually maps a continuous "bin scale" value to frequency: the bin parameter does not have to be an integer.

Implements CQBase.

virtual int ConstantQ::getBinsPerOctave ( ) const [inline, virtual]

Return the number of bins per octave specified when constructing the Constant-Q implementation.

Implements CQBase.

virtual int ConstantQ::getColumnHop ( ) const [inline, virtual]

Return the spacing, in samples at the sample rate returned from getSampleRate(), between one column and the next.

Implements CQBase.

virtual int ConstantQ::getLatency ( ) const [inline, virtual]

Return the latency of Constant-Q calculation, in samples at the sample rate returned from getSampleRate().

Implements CQBase.

virtual double ConstantQ::getMaxFrequency ( ) const [inline, virtual]

Return the maximum frequency of the Constant-Q output, i.e. the frequency of the highest bin in the output. This will normally be the same as the maximum frequency passed to the constructor of the specific Constant-Q implementation.

Implements CQBase.

double ConstantQ::getMinFrequency ( ) const [virtual]

Return the minimum frequency of the Constant-Q output, i.e. the frequency of the lowest bin in the output. This is derived from the maximum frequency and octave count, and is not necessarily the same as any minimum frequency requested when constructing the Constant-Q implementation.

Implements CQBase.

virtual int ConstantQ::getOctaves ( ) const [inline, virtual]

Return the number of octaves spanned by the Constant-Q transform.

Implements CQBase.

Return the remaining constant-Q columns following the end of processing. Any buffered input is padded so as to ensure that all input provided to process() will have been returned.

virtual double ConstantQ::getSampleRate ( ) const [inline, virtual]

Return the sample rate used when constructing the specific Constant-Q implementation.

Implements CQBase.

virtual int ConstantQ::getTotalBins ( ) const [inline, virtual]

Return the total number of bins in each Constant-Q column (i.e. bins-per-octave times number of octaves).

Implements CQBase.

virtual bool ConstantQ::isValid ( ) const [inline, virtual]

Return true if the Constant-Q implementation was successfully constructed, with a valid set of initialisation parameters.

Implements CQBase.

Given a series of time-domain samples, return a series of constant-Q columns. Any samples left over (that did not fit into a constant-Q processing block) are saved for the next call to process or getRemainingBlocks.

The input is assumed to be a single frame of time-domain sample values, such that consecutive calls to process receive contiguous frames from the source signal. Each frame may be of any length in samples.

Each output column contains a series of constant-Q bin values ordered from highest to lowest frequency.

Output columns are of varying height: each will contain at least getBinsPerOctave() values, because the highest-frequency octave is always present, but a second octave (if requested) will appear only in alternate columns, a third octave only in every fourth column, and so on.

If you need a format in which all columns are of equal height and every bin contains a value, use CQSpectrogram instead of ConstantQ.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator