Skip to content

Commit

Permalink
cleaning the code
Browse files Browse the repository at this point in the history
  • Loading branch information
mkholghi authored and atruskie committed Feb 4, 2019
1 parent b5f8125 commit 0c84f1b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public class SpectralPeakTrackingConfig : Config
public const int DefaultFrameWidth = 1024;
public const double DefaultFrameOverlap = 0.2;


/// <summary>
/// Initializes a new instance of the <see cref="SpectralPeakTrackingConfig"/> class.
/// CONSTRUCTOR
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// <copyright file="SpectralPeakTrackingEntry.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>

namespace AnalysisPrograms.SpectralPeakTracking
{
using System;
using System.IO;
using System.Threading.Tasks;
using Acoustics.Shared.ConfigFile;
using AudioAnalysisTools;
using AudioAnalysisTools.DSP;
using AudioAnalysisTools.StandardSpectrograms;
using AudioAnalysisTools.WavTools;
using Production.Arguments;
using Production.Validation;
using McMaster.Extensions.CommandLineUtils;
using Production.Arguments;

public static class SpectralPeakTrackingEntry
{
Expand Down
8 changes: 1 addition & 7 deletions src/AudioAnalysisTools/SpectralPeakTracking2018.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ namespace AudioAnalysisTools
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Acoustics.Shared.ConfigFile;
using StandardSpectrograms;
using TowseyLibrary;

Expand All @@ -32,7 +28,7 @@ public static void SpectralPeakTracking(double[,] dbSpectrogram, SpectralPeakTra
int[][] localPeaks = FindLocalSpectralPeaks(dbSpectrogram, peakBinsIndex, settings.WidthMidFreqBand, settings.TopBuffer, settings.BottomBuffer, settings.DbThreshold);

// Do Spectral Peak Tracking

// SpectralTrack.GetSpectralPeakTracks()
}

/// <summary>
Expand Down Expand Up @@ -146,8 +142,6 @@ public static double CalculateAverageEnergy(double[] spectrum, int minInd, int m

return outputMatrix;
}


}

public class SpectralPeakTrackingSettings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

namespace Acoustics.Test.AudioAnalysisTools
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Acoustics.Shared;
using Acoustics.Shared.Csv;
using global::AudioAnalysisTools;
Expand All @@ -26,7 +21,7 @@ public void GetPeakBinsIndexTest()
int minFreqBin = 7;
int maxFreqBin = 15;

int[] expectedPeakBinsIndex = new int[]
int[] expectedPeakBinsIndex =
{
7, 11, 12, 14, 14, 14, 14, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 9, 10, 10, 12, 14,
14, 14, 14, 14, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 12, 12, 14, 14, 14, 14, 14, 14, 14, 6, 6, 6, 6, 6
Expand All @@ -38,7 +33,6 @@ public void GetPeakBinsIndexTest()
{
Assert.AreEqual(expectedPeakBinsIndex[i], actualPeakBinsIndex[i]);
}

}

[TestMethod]
Expand All @@ -47,7 +41,7 @@ public void FindLocalSpectralPeaksTest()
var inputMatrix = PathHelper.ResolveAsset("SpectralPeakTracking", "matrix2.csv");
var matrix = Csv.ReadMatrixFromCsv<double>(inputMatrix, TwoDimensionalArray.None);

int[][] expectedLocalPeaksIndex = new int[][] { new int[] { 0, 7 }, new int[] { 1, 11 } };
int[][] expectedLocalPeaksIndex = { new[] { 0, 7 }, new[] { 1, 11 } };

int[] peakBinsIndex = new int[] { 7, 11, 6, 6, 6, 6, 6, 6, 6, 6 };

Expand Down

0 comments on commit 0c84f1b

Please sign in to comment.