Skip to content

Commit

Permalink
added energy spectrogram class
Browse files Browse the repository at this point in the history
  • Loading branch information
mkholghi authored and atruskie committed Feb 4, 2019
1 parent 0c84f1b commit 36e234e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/AudioAnalysisTools/StandardSpectrograms/EnergySpectrogram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AudioAnalysisTools.StandardSpectrograms
{
using Acoustics.Tools.Wav;
using TowseyLibrary;

public class EnergySpectrogram : BaseSonogram
{
public EnergySpectrogram(SonogramConfig config, double[,] amplitudeSpectrogram)
: base(config, amplitudeSpectrogram)
{
this.Configuration = config;
this.FrameCount = amplitudeSpectrogram.GetLength(0);
this.Data = amplitudeSpectrogram;
this.Make(this.Data);
}

public EnergySpectrogram(AmplitudeSonogram sg)
: base(sg.Configuration)
{
this.Data = MatrixTools.SquareValues(sg.Data);
}

public override void Make(double[,] amplitudeM)
{
this.Data = MatrixTools.SquareValues(amplitudeM);
}
}
}

0 comments on commit 36e234e

Please sign in to comment.