{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "%matplotlib inline\n", "import numpy as np\n", "import time\n", "import scipy\n", "from scipy import signal\n", "import matplotlib.pyplot as plt\n", "import matplotlib.colors as mpcol\n", "import src.dab_util as du" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "import src.signal_gen as sg\n", "reload(sg)\n", "reload(du)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "from grc.parallel_measurement import parallel_measurement\n", "#from grc.parallel_measurement_mer import parallel_measurement_mer\n", "#from grc.parallel_measurement_two_tone import parallel_measurement_two_tone" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "top = parallel_measurement()\n", "#top = parallel_measurement_mer()\n", "#top = parallel_measurement_two_tone()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "top.start()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "import src.ReceiveDictTcp as rdt" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "receiver = rdt.ReceiveDictTcp('127.0.0.1', 1112)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "receiver.start()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "top.dpd_memless_poly_0.set_a1(1)\n", "top.dpd_memless_poly_0.set_a2(0.0)\n", "top.dpd_memless_poly_0.set_a3(0.0)\n", "top.dpd_memless_poly_0.set_a4(0.0)\n", "top.dpd_memless_poly_0.set_a5(0.0)\n", "top.dpd_memless_poly_0.set_a6(0.0)\n", "top.dpd_memless_poly_0.set_a7(0.0)\n", "top.dpd_memless_poly_0.set_a8(0.0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "while True:\n", " d = receiver.queue.get()\n", " time.sleep(0.01)\n", " \n", " print(d)\n", " k = d.keys()[0]\n", " if k == \"a1\":\n", " print(d)\n", " top.dpd_memless_poly_0.set_a1(d[k])\n", " if k == \"a2\":\n", " top.dpd_memless_poly_0.set_a2(d[k])\n", " if k == \"a3\":\n", " top.dpd_memless_poly_0.set_a3(d[k])\n", " if k == \"a4\":\n", " top.dpd_memless_poly_0.set_a4(d[k])\n", " if k == \"a5\":\n", " top.dpd_memless_poly_0.set_a5(d[k])\n", " if k == \"a6\":\n", " top.dpd_memless_poly_0.set_a6(d[k])\n", " if k == \"a7\":\n", " top.dpd_memless_poly_0.set_a7(d[k])\n", " if k == \"a8\":\n", " top.dpd_memless_poly_0.set_a8(d[k])\n", " if k == \"txgain\":\n", " top.uhd_usrp_sink_0_0.set_gain(d[k])\n", " if k == \"rxgain\":\n", " top.uhd_usrp_source_0.set_gain(d[k])\n", " if k == \"input_path\":\n", " top.blocks_file_source_0.open(str(d[k]), True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "#top.stop()\n", "#top.wait()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "a = np.fromfile(\"../test_dat/dab_5s_8000000.iq\", dtype=np.complex64)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "a = a/np.abs(a).max()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [ "a.tofile(\"/home/andreas/dab/dab_5s_8000000_max_1.iq\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": { "deletable": true, "editable": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2" } }, "nbformat": 4, "nbformat_minor": 1 }