Click or drag to resize
Accord.NET (logo)

SignalGetEnergy Method

Computes the signal energy.

Namespace:  Accord.Audio
Assembly:  Accord.Audio (in Accord.Audio.dll) Version: 3.8.0
public double GetEnergy()
Request Example View Source

Return Value

Type: Double
// Let's say we would like to compute the energy of an audio signal. For this,
// we will take an example signal from the Free Spoken Digits Dataset (FSDD):
FreeSpokenDigitsDataset fsdd = new FreeSpokenDigitsDataset(basePath);
Signal signal = fsdd.GetSignal(digit: 3, speaker: "jackson", index: 0);

// The energy is defined as the sum of squared values in all 
// channels of the audio signal. In this case, it should be:
double energy = signal.GetEnergy(); // 19.448728048242629
See Also