public class EnergyNormaliser extends Object implements AudioProcessor
Modifier and Type | Field and Description |
---|---|
protected double |
amplitudeFactor |
protected double |
referencePower |
Constructor and Description |
---|
EnergyNormaliser(AudioInputStream reference)
Adapt the amplitudes of a signal such that the average power is the same as the one in the reference.
|
EnergyNormaliser(double energyFactor)
Adapt the amplitudes of a signal such that the energy changes by the given factor.
|
EnergyNormaliser(DoubleDataSource reference)
Adapt the amplitudes of a signal such that the average power is the same as the one in the reference.
|
Modifier and Type | Method and Description |
---|---|
AudioInputStream |
apply(AudioInputStream ais)
Apply this processor inline on the given audio input stream.
|
DoubleDataSource |
apply(DoubleDataSource signal) |
static double |
determineAveragePower(AudioInputStream ais)
For a given audio input stream, determine the average power.
|
static double |
determineAveragePower(double[] signal)
For a given audio signal and sampling rate, determine the average power.
|
static double |
determineAveragePower(DoubleDataSource signal)
For a given audio signal, determine the average power.
|
double |
getAmplitudeFactor() |
double |
getReferencePower() |
static void |
main(String[] args) |
protected double amplitudeFactor
protected double referencePower
public EnergyNormaliser(double energyFactor)
energyFactor
- energy factorpublic EnergyNormaliser(AudioInputStream reference)
reference
- an audio input stream with the reference power.public EnergyNormaliser(DoubleDataSource reference)
reference
- an audio signal with the reference power.public double getAmplitudeFactor()
public double getReferencePower()
public static double determineAveragePower(AudioInputStream ais)
ais
- audio input stream for which to determine the average powerpublic static double determineAveragePower(DoubleDataSource signal)
signal
- a double data source for which to determine the average powerpublic static double determineAveragePower(double[] signal)
signal
- audio signal for which to determine the average powerpublic AudioInputStream apply(AudioInputStream ais)
AudioProcessor
apply
in interface AudioProcessor
ais
- aispublic DoubleDataSource apply(DoubleDataSource signal)
Copyright © 2000–2016 DFKI GmbH. All rights reserved.