diff --git a/docs/3d-envelopes.png b/docs/3d-envelopes.png index 0f6cc07..1ec9cdc 100644 Binary files a/docs/3d-envelopes.png and b/docs/3d-envelopes.png differ diff --git a/experiments/piano_heterodyne.ipynb b/experiments/piano_heterodyne.ipynb index b89ffb3..4a12c89 100644 --- a/experiments/piano_heterodyne.ipynb +++ b/experiments/piano_heterodyne.ipynb @@ -1422,10 +1422,14 @@ "source": [ "def time_mapper(t, boundary=0.25, magnification=8.0):\n", " \"\"\"Convert time in secs to a nonlinear projection.\"\"\"\n", - " #return np.log10(0.01 + t)\n", - " t = np.asarray(t)\n", - " magnified = (t < boundary)\n", - " return magnified * t + (1 - magnified) * (boundary + (t - boundary) / magnification)\n", + " return np.log10(0.01 + t)\n", + " #t = np.asarray(t)\n", + " #magnified = (t < boundary)\n", + " #return magnified * t + (1 - magnified) * (boundary + (t - boundary) / magnification)\n", + "\n", + "def inv_time_mapper(mapped_t, boundary=0.25, magnification=8.0):\n", + " magnified = mapped_t < boundary\n", + " return magnified * mapped_t + (1 - magnified) * (boundary + magnification * (mapped_t - boundary))\n", "\n", "from matplotlib.collections import PolyCollection\n", "\n", @@ -1458,6 +1462,10 @@ " \n", " plt.title(filename)\n", " plt.xlabel('time / s')\n", + " #tick_times = np.array([0, 0.1, 0.2, 1.0, 2.0, 3.0, 4.0])\n", + " tick_times = np.array([0, 0.02, 0.05, 0.1, 0.2, 0.5, 1.0, 2.0, 5.0])\n", + " plt.xticks(time_mapper(tick_times), tick_times)\n", + " #plt.xlim([-0.05, 0.8])\n", " plt.ylabel('harm #')\n", " plt.yticks(np.arange(2, 22, 2), np.arange(19, -1, -2))\n", " #plt.zlabel('level / dB')\n",