uk.co.simphoney.audio.constantq
Class ConstantQSpectrogramDataBuilder

java.lang.Object
  extended by uk.co.simphoney.audio.DataBuilder
      extended by uk.co.simphoney.audio.constantq.ConstantQSpectrogramDataBuilder
All Implemented Interfaces:
SpectrumDataBuilder

public class ConstantQSpectrogramDataBuilder
extends DataBuilder
implements SpectrumDataBuilder

Creates a spectrogram from a DoubleDataSource Observers are notified when data changes (during build) SizeObserver are notify when the number of frequency bins is changed.

Author:
pjl

Field Summary
 
Fields inherited from class uk.co.simphoney.audio.DataBuilder
sizeObservers
 
Constructor Summary
ConstantQSpectrogramDataBuilder()
           
 
Method Summary
 void addSizeObserver(SpectrogramDataListener o)
           
 long chunkStartInSamples(long chunkPtr)
           
protected  void doWork()
          Does the building.
 int getBinCount()
           
 int getChunkAtFrame(long framePtr)
           
 int getChunkRenderedCount()
           
 rasmus.interpreter.sampled.util.FFT getFFT()
           
 float[] getFreqArray()
           
 long getLengthInFrames()
           
 float[][] getMagnitude()
           
 float[] getMagnitudeAt(long chunkPtr)
           
 float[] getPhaseAt(long chunkPtr)
           
 float[] getPhaseFreqAt(long chunkPtr)
           
 int getSizeInChunks()
           
 float[][] getSMagnitude()
           
 float[] getSMagnitudeAt(long chunkPtr)
           
 StaticSpectrogramSynth getSynth()
           
 void setParameters(LimitedAudioReader reader, double minF, double maxF, int binsPerOctave, double thresh, double spread, double dt)
           
 boolean validAt(long chunkPtr2)
           
 
Methods inherited from class uk.co.simphoney.audio.DataBuilder
abortConstruction, dispose, isConstructing, startConstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.co.simphoney.audio.SpectrumDataBuilder
dispose
 

Constructor Detail

ConstantQSpectrogramDataBuilder

public ConstantQSpectrogramDataBuilder()
Method Detail

setParameters

public void setParameters(LimitedAudioReader reader,
                          double minF,
                          double maxF,
                          int binsPerOctave,
                          double thresh,
                          double spread,
                          double dt)

addSizeObserver

public void addSizeObserver(SpectrogramDataListener o)
Specified by:
addSizeObserver in interface SpectrumDataBuilder

getSizeInChunks

public int getSizeInChunks()
Specified by:
getSizeInChunks in interface SpectrumDataBuilder

getChunkRenderedCount

public int getChunkRenderedCount()
Specified by:
getChunkRenderedCount in interface SpectrumDataBuilder

getBinCount

public int getBinCount()
Specified by:
getBinCount in interface SpectrumDataBuilder

getMagnitude

public float[][] getMagnitude()
Specified by:
getMagnitude in interface SpectrumDataBuilder

doWork

protected void doWork()
Description copied from class: DataBuilder
Does the building. Should test Thread.interrupted() and return ASAP if true.

Specified by:
doWork in class DataBuilder

getFreqArray

public float[] getFreqArray()
Specified by:
getFreqArray in interface SpectrumDataBuilder

getMagnitudeAt

public float[] getMagnitudeAt(long chunkPtr)
Specified by:
getMagnitudeAt in interface SpectrumDataBuilder

getPhaseAt

public float[] getPhaseAt(long chunkPtr)

getPhaseFreqAt

public float[] getPhaseFreqAt(long chunkPtr)
Specified by:
getPhaseFreqAt in interface SpectrumDataBuilder

getLengthInFrames

public long getLengthInFrames()

chunkStartInSamples

public long chunkStartInSamples(long chunkPtr)

getChunkAtFrame

public int getChunkAtFrame(long framePtr)

validAt

public boolean validAt(long chunkPtr2)
Specified by:
validAt in interface SpectrumDataBuilder

getSynth

public StaticSpectrogramSynth getSynth()
Specified by:
getSynth in interface SpectrumDataBuilder

getFFT

public rasmus.interpreter.sampled.util.FFT getFFT()
Specified by:
getFFT in interface SpectrumDataBuilder

getSMagnitudeAt

public float[] getSMagnitudeAt(long chunkPtr)
Specified by:
getSMagnitudeAt in interface SpectrumDataBuilder

getSMagnitude

public float[][] getSMagnitude()
Specified by:
getSMagnitude in interface SpectrumDataBuilder