be.hogent.tarsos.util.histogram
Class CrossCorrelation

java.lang.Object
  extended by be.hogent.tarsos.util.histogram.CrossCorrelation
All Implemented Interfaces:
HistogramCorrelation

public final class CrossCorrelation
extends java.lang.Object
implements HistogramCorrelation

Crosscorrelation as used in Baris Bozkurt's 'An automatic pitch analysis method for Turkish maquam music'. The measure is defined for modulo type histograms!

Author:
Joren Six

Constructor Summary
CrossCorrelation()
           
 
Method Summary
 double correlation(Histogram thisHistogam, int displacement, Histogram otherHistogram)
          The implementation of a histogram correlation or distance measure.
 void plotCorrelation(Histogram thisHistogram, int displacement, Histogram otherHistogram, java.lang.String fileName, java.lang.String title)
          Plots two histograms and the intersection between the two.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CrossCorrelation

public CrossCorrelation()
Method Detail

correlation

public double correlation(Histogram thisHistogam,
                          int displacement,
                          Histogram otherHistogram)
Description copied from interface: HistogramCorrelation
The implementation of a histogram correlation or distance measure.

Specified by:
correlation in interface HistogramCorrelation
Parameters:
thisHistogam - the first histogram
displacement - the value to displace the otherHistogram (e.g. for optimal correlation, minimum distance between the two)
otherHistogram - the second (not displaced) histogram
Returns:
the correlation between a histogram and a displaced histogram

plotCorrelation

public void plotCorrelation(Histogram thisHistogram,
                            int displacement,
                            Histogram otherHistogram,
                            java.lang.String fileName,
                            java.lang.String title)
Description copied from interface: HistogramCorrelation
Plots two histograms and the intersection between the two.

Specified by:
plotCorrelation in interface HistogramCorrelation
Parameters:
thisHistogram - the first histogram
displacement - the value to displace the otherHistogram (e.g. for optimal correlation between the two)
otherHistogram - the second (not displaced) histogram
fileName - Where to save the plot.
title - The title of the plot.