Skip to content

Commit

Permalink
Remove references to POW and AVG indices
Browse files Browse the repository at this point in the history
Also change POW to  PMN
More resharper inspired changes

Work done for #204
  • Loading branch information
towsey authored and atruskie committed Dec 19, 2018
1 parent 912e060 commit c10fcf8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/AudioAnalysisTools/Indices/IndexDistributions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IndexDistributions.cs" company="QutEcoacoustics">
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group).
// </copyright>
Expand Down
2 changes: 0 additions & 2 deletions src/AudioAnalysisTools/Indices/IndexProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ namespace AudioAnalysisTools.Indices
using System.IO;

using Acoustics.Shared.ConfigFile;

using AnalysisBase;
using Newtonsoft.Json;
using TowseyLibrary;
using YamlDotNet.Serialization;

using Zio;

public interface IIndexPropertyReferenceConfiguration
Expand Down
18 changes: 7 additions & 11 deletions src/AudioAnalysisTools/Indices/SpectralIndexValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ namespace AudioAnalysisTools.Indices

public class SpectralIndexValues : SpectralIndexBase
{
private static string[] keys = { "ACI", "BGN", "CVR", "ENT", "EVN", "PMN", "RHZ", "RNG", "RPS", "RVT", "R3D", "SPT" };

private static readonly Dictionary<string, Func<SpectralIndexBase, double[]>> CachedSelectorsInternal;
private static readonly Dictionary<string, Action<SpectralIndexValues, double[]>> CachedSettersInternal;

Expand Down Expand Up @@ -140,7 +142,6 @@ public static string[] GetKeys()

public static Image CreateImageOfSpectralIndices(SpectralIndexValues spectralIndices)
{
string[] keys = { "ACI", "BGN", "CVR", "ENT", "EVN", "PMN", "POW", "RHZ", "RNG", "RPS", "RVT", "R3D", "SPT" };
var images = new List<Image>();
foreach (var key in keys)
{
Expand All @@ -166,9 +167,6 @@ public static Image CreateImageOfSpectralIndices(SpectralIndexValues spectralInd
case "PMN":
normalisedIndex = DataTools.normalise(spectralIndices.PMN);
break;
case "POW":
normalisedIndex = DataTools.normalise(spectralIndices.POW);
break;
case "RHZ":
normalisedIndex = DataTools.normalise(spectralIndices.RHZ);
break;
Expand Down Expand Up @@ -221,17 +219,15 @@ public static Image CreateImageOfSpectralIndices(SpectralIndexValues spectralInd
public double[] EVN { get; set; }

/// <summary>
/// Gets or sets pMN = Power Minus Noise.
/// PMN is measured in decibels but should replace POW as the average decibel spectrogram.
/// PMN calculates the average decibel spectrogram correctly.
/// Gets or sets the oscillation spectral index index. Created October 2018.
/// </summary>
public double[] PMN { get; set; }
public double[] OSC { get; set; }

/// <summary>
/// Gets or sets the POW spectral index should eventually be depracated.
/// It is derived from an incorrect way of averaging decibel values
/// Gets or sets PMN = Power Minus Noise.
/// PMN is measured in decibels. It replaces the previous POW as the average decibel spectrogram.
/// </summary>
public double[] POW { get; set; }
public double[] PMN { get; set; }

// Spectral Ridges Horizontal
public double[] RHZ { get; set; }
Expand Down

0 comments on commit c10fcf8

Please sign in to comment.