From 66e0f462d379b1cb3f42e988eb8ccca614d967d5 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 23 Jun 2024 23:13:34 +0200 Subject: Add test data and working manchester decoder --- barcode3.ipynb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'barcode3.ipynb') diff --git a/barcode3.ipynb b/barcode3.ipynb index e0e5e77..6694a31 100755 --- a/barcode3.ipynb +++ b/barcode3.ipynb @@ -53,6 +53,12 @@ "\n", "downsampling = 500\n", "data = scipy.signal.decimate(data, downsampling, ftype='fir')\n", + "off = 6000#wf = rigol.Wfm.from_file('barcode_test_varspeed.wfm', 'DS1054Z')\n", + "wf = rigol.Wfm.from_file('barcode_test8.wfm', 'DS1054Z')\n", + "data = wf.channels[0].volts\n", + "\n", + "downsampling = 500\n", + "data = scipy.signal.decimate(data, downsampling, ftype='fir')\n", "off = 6000\n", "data = data[off:off+16384]\n", "td = wf.channels[0].seconds_per_point * downsampling\n", @@ -61,6 +67,14 @@ "fig, ax = plt.subplots(figsize=(28, 6))\n", "ax.plot(times, data)\n", "ax.set_xlim([times[0], times[-1]])\n", + "len(data)\n", + "data = data[off:off+16384]\n", + "td = wf.channels[0].seconds_per_point * downsampling\n", + "times = np.linspace(0, len(data)*td, len(data))\n", + "\n", + "fig, ax = plt.subplots(figsize=(28, 6))\n", + "ax.plot(times, data)\n", + "ax.set_xlim([times[0], times[-1]])\n", "len(data)" ] }, @@ -729,7 +743,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.5" + "version": "3.12.3" } }, "nbformat": 4, -- cgit