Skip to content

Commit

Permalink
Small changes to Sandpit
Browse files Browse the repository at this point in the history
  • Loading branch information
towsey authored and atruskie committed Mar 25, 2019
1 parent c7c2a17 commit 8c4a0fb
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/AnalysisPrograms/Sandpit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public override Task<int> Execute(CommandLineApplication app)
//CodeToPlaceScoreTracksUnderLdfcSpectrograms();
//CodeToPlaceScoreTracksUnderSingleImage();

ConcatenateIndexFilesAndSpectrograms();
//ConcatenateIndexFilesAndSpectrograms();
//ConcatenateGreyScaleSpectrogramImages();
//ConcatenateMarineImages();
//ConcatenateImages();
Expand All @@ -80,6 +80,7 @@ public override Task<int> Execute(CommandLineApplication app)
//DrawLongDurationSpectrogram();
//DrawClusterSequence();
//DrawStandardSpectrograms();
Test_DrawFourSpectrograms();

//ExtractSpectralFeatures();
//HerveGlotinMethods();
Expand All @@ -106,7 +107,6 @@ public override Task<int> Execute(CommandLineApplication app)
//TestNoiseReduction();
//Oscillations2014.TESTMETHOD_DrawOscillationSpectrogram();
//Oscillations2014.TESTMETHOD_GetSpectralIndex_Osc();
//Test_DrawFourSpectrograms();

Console.WriteLine("# Finished Sandpit Task! Press any key to exit.");
return this.Ok();
Expand Down Expand Up @@ -514,8 +514,17 @@ public static void Audio2CsvOverOneFile()
AnalyseLongRecording.Execute(arguments);
}

public static void Test_DrawFourSpectrograms()
{
var sourceRecording = @"C:\SensorNetworks\SoftwareTests\TestRecordings\BAC2_20071008-085040.wav".ToFileInfo();
var output = @"C:\SensorNetworks\SoftwareTests\TestFourSonograms".ToDirectoryInfo();
var configFile = @"C:\Work\GitHub\audio-analysis\AudioAnalysis\AnalysisConfigFiles\Towsey.Sonogram.yml".ToFileInfo();
//Audio2Sonogram.TESTMETHOD_DrawFourSpectrograms(sourceRecording, output, configFile);
}

/// <summary>
/// Draws a standard spectrogram
/// Draws a standard spectrogram, w/wo noise removal & melscale/linear.
/// This worked Feb 2019.
/// </summary>
public static void DrawStandardSpectrograms()
{
Expand All @@ -527,18 +536,18 @@ public static void DrawStandardSpectrograms()
SourceFileName = "BAC2_20071008-085040",
WindowSize = 1024,
WindowOverlap = 0.0,
DoMelScale = false,
DoMelScale = true,
MelBinCount = 256,
NoiseReductionType = NoiseReductionType.Median,
NoiseReductionType = NoiseReductionType.None,
NoiseReductionParameter = 0.0,
};

//var amplSpectrogram = new AmplitudeSpectrogram(settings, recording);
//var dbSpectrogram = new DecibelSpectrogram(settings, recording);
//dbSpectrogram.DrawSpectrogram(@"C:\Ecoacoustics\WavFiles\TestRecordings\BAC\BAC2_20071008-085040_MelMedian.png");
var amplSpectrogram = new AmplitudeSpectrogram(settings, recording);
var dbSpectrogram = new DecibelSpectrogram(settings, recording);
dbSpectrogram.DrawSpectrogram(@"C:\Ecoacoustics\WavFiles\TestRecordings\BAC\2019Output\BAC2_20071008-085040_MelNoNoiseRemoval.png");

var energySpectro = new EnergySpectrogram(settings, recording);
energySpectro.DrawLogPsd(@"C:\Ecoacoustics\WavFiles\TestRecordings\BAC\BAC2_20071008-085040_LogPSD.png");
energySpectro.DrawLogPsd(@"C:\Ecoacoustics\WavFiles\TestRecordings\BAC\2019Output\BAC2_20071008-085040_MelLogPSD_NoNoiseRemoval.png");
}

public static void DrawLongDurationSpectrogram()
Expand Down Expand Up @@ -1417,11 +1426,6 @@ public static void TestsOfFrequencyScales()
FrequencyScale.TESTMETHOD_DrawFrequencyLinesOnImage();
}

public static void Test_DrawFourSpectrograms()
{
Audio2Sonogram.TESTMETHOD_DrawFourSpectrograms();
}

/// <summary>
/// Unit test of AnalyseLongRecording() using artificial signal
/// </summary>
Expand Down

0 comments on commit 8c4a0fb

Please sign in to comment.