summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2020-02-09 22:40:52 +0100
committerAndré Nusser <andre.nusser@googlemail.com>2020-02-09 22:41:20 +0100
commit7f8a99795f81eb8659e347764295887232d0dc4b (patch)
treed14c2e46a3f4c60305bad4b439c36a9c455cd737
parent7e78ab7b9abb11610e7cac4e211aee5341893c9b (diff)
Add power level distribution plot of the Crocell kit snare.
-rw-r--r--sampling_alg_lac2020/LAC-20.tex38
-rw-r--r--sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.pdfbin0 -> 11058 bytes
-rw-r--r--sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.txt98
-rwxr-xr-xsampling_alg_lac2020/figures/power_level_distribution/plot_histogram.py35
4 files changed, 153 insertions, 18 deletions
diff --git a/sampling_alg_lac2020/LAC-20.tex b/sampling_alg_lac2020/LAC-20.tex
index 77976b8..3b55bc8 100644
--- a/sampling_alg_lac2020/LAC-20.tex
+++ b/sampling_alg_lac2020/LAC-20.tex
@@ -546,26 +546,28 @@ As a base-line for comparison, we use the previous sample selection algorithm of
We want to evaluate how the sample selection algorithm performs in practice, therefore we use the drum kits of DrumGizmo. In particular, we use the power value distribution of the samples of those kits.
We do experiments on three different drum kits.
As normally the snare drum is the instrument with the highest number of samples, we choose this drum for our experiments.
-See Table \ref{tab:drumkit_data} for some information about the samples of the drum kits and see Figure \ref{fig:power_level_distribution} for a visualization of the power level distribution of the kits.
-
-\begin{table}
-\caption{Drum kit data.}
-\label{tab:drumkit_data}
-\centering
-\begin{tabular}{|l||rr|}
-\hline
-name & number of snare samples & \\
-\hline
-DRS kit & 234 & \\
-other kit & 234 & \\
-and other kit & 234 & \\
-\hline
-\end{tabular}
-\end{table}
+% See Table \ref{tab:drumkit_data} for some information about the samples of the drum kits and see Figure \ref{fig:power_level_distribution} for a visualization of the power level distribution of the kits.
+For our experiments, we use the Crocell kit, which has 98 snare samples. See Figure \ref{fig:power_level_distribution} for a visualization of the power level distribution of the Crocell kit.
+
+% \begin{table}
+% \caption{Drum kit data.}
+% \label{tab:drumkit_data}
+% \centering
+% \begin{tabular}{|l||rr|}
+% \hline
+% name & number of snare samples & \\
+% \hline
+% Crocell Kit & 98 & \\
+% other kit & 234 & \\
+% and other kit & 234 & \\
+% \hline
+% \end{tabular}
+% \end{table}
\begin{figure}
- \includegraphics[width=.8\linewidth]{figures/power_level_distribution.pdf}
- \caption{This shows the power value distribution of the different drum kits.}
+ \centering
+ \includegraphics[width=.8\linewidth]{figures/power_level_distribution/crocell_sample_powers.pdf}
+ \caption{This shows the power value distribution of the Crocell kit.}
\label{fig:power_level_distribution}
\end{figure}
diff --git a/sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.pdf b/sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.pdf
new file mode 100644
index 0000000..9334282
--- /dev/null
+++ b/sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.pdf
Binary files differ
diff --git a/sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.txt b/sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.txt
new file mode 100644
index 0000000..bf0b380
--- /dev/null
+++ b/sampling_alg_lac2020/figures/power_level_distribution/crocell_sample_powers.txt
@@ -0,0 +1,98 @@
+0.00985718
+0.0124808
+0.0157321
+0.0164673
+0.0186221
+0.0206627
+0.0314267
+0.0482537
+0.0803186
+0.0834334
+0.0899345
+0.122976
+0.203364
+0.22282
+0.236576
+0.279692
+0.315727
+0.322313
+0.332614
+0.342139
+0.355954
+0.379897
+0.389399
+0.434295
+0.435408
+0.509356
+0.516196
+0.529965
+0.531982
+0.599802
+0.618736
+0.645616
+0.647419
+0.648811
+0.66006
+0.687897
+0.70297
+0.719662
+0.821344
+0.837138
+0.891673
+0.940148
+0.96253
+0.967574
+0.995048
+1.00559
+1.03336
+1.07069
+1.07782
+1.08073
+1.08607
+1.11941
+1.12584
+1.12853
+1.1363
+1.13778
+1.14384
+1.15901
+1.24029
+1.26058
+1.31165
+1.40778
+1.41931
+1.48559
+1.5078
+1.5295
+1.53489
+1.57273
+1.57376
+1.66366
+1.87674
+1.89395
+1.90179
+1.94146
+1.97564
+2.02044
+2.02492
+2.0548
+2.06189
+2.06474
+2.10502
+2.10815
+2.12824
+2.20962
+2.25177
+2.351
+2.48718
+2.50744
+2.56676
+2.5932
+2.63316
+2.74751
+2.79034
+2.94348
+3.03418
+3.16128
+3.2465
+3.29455
diff --git a/sampling_alg_lac2020/figures/power_level_distribution/plot_histogram.py b/sampling_alg_lac2020/figures/power_level_distribution/plot_histogram.py
new file mode 100755
index 0000000..f1989f2
--- /dev/null
+++ b/sampling_alg_lac2020/figures/power_level_distribution/plot_histogram.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+import numpy as np
+import matplotlib.mlab as mlab
+import matplotlib.pyplot as plt
+import sys
+
+if len(sys.argv) != 3:
+ print("Wrong number of arguments.")
+ print("USAGE: ./plot_histogram.py <input_file> <output_file>")
+ quit()
+
+input_file = sys.argv[1]
+output_file = sys.argv[2]
+
+f = open(input_file)
+X = [float(i) for i in f.readlines()]
+X.sort()
+
+# the histogram of the data
+n, bins, patches = plt.hist(X, facecolor='red')
+
+# add a 'best fit' line
+# y = mlab.normpdf( bins, mu, sigma)
+# l = plt.plot(bins, y, 'r--', linewidth=1)
+
+plt.xlabel('Power Level')
+plt.ylabel('Number of Samples')
+# plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
+# plt.axis([40, 160, 0, 0.03])
+
+# TODO: adapt for different drum kits!
+# plt.xlim(0,97)
+plt.grid(True)
+
+plt.savefig(output_file)