Class AudioSpectrumFunctions.LogFrequencySpectrumToPitchDownsampling
- java.lang.Object
-
- com.tagtraum.audiokern.audioprocessor.AudioSpectrumFunctions.LogFrequencySpectrumToPitchDownsampling
-
- All Implemented Interfaces:
MapFunction<LogFrequencySpectrum>
- Enclosing class:
- AudioSpectrumFunctions
public static class AudioSpectrumFunctions.LogFrequencySpectrumToPitchDownsampling extends Object implements MapFunction<LogFrequencySpectrum>
Effectively down-samples the bin resolution of a
LogFrequencySpectrum
to one bin per semitone by picking one of multiple bins and discarding the others.The
LogFrequencySpectrum.getBinsPerSemitone()
of the source spectrum should contain an integer for this to work.
-
-
Constructor Summary
Constructors Constructor Description LogFrequencySpectrumToPitchDownsampling()
Picks the first bin ofLogFrequencySpectrum.getBinsPerSemitone()
.LogFrequencySpectrumToPitchDownsampling(int offset)
Picks the nth bin ofLogFrequencySpectrum.getBinsPerSemitone()
for the resulting spectrum.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
LogFrequencySpectrum
map(LogFrequencySpectrum data)
String
toString()
-
-
-
Constructor Detail
-
LogFrequencySpectrumToPitchDownsampling
public LogFrequencySpectrumToPitchDownsampling()
Picks the first bin ofLogFrequencySpectrum.getBinsPerSemitone()
.
-
LogFrequencySpectrumToPitchDownsampling
public LogFrequencySpectrumToPitchDownsampling(int offset)
Picks the nth bin ofLogFrequencySpectrum.getBinsPerSemitone()
for the resulting spectrum.- Parameters:
offset
- offset number of the bins to pick
-
-
Method Detail
-
map
public LogFrequencySpectrum map(LogFrequencySpectrum data)
- Specified by:
map
in interfaceMapFunction<LogFrequencySpectrum>
-
-