{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Experiment 2 - Comparing IQwav vs IQwavAlt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Refs [1]: https://stackoverflow.com/questions/5622976/how-do-you-calculate-program-run-time-in-python" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Two implementations to read IQ.wav files was written in source.py, one using np.memmap and the other using scipy's wavread function. The benefit of using scipy's wavread is that it allows us to read in the sampling frequency easily unlike the np.memmap. Hence a comparison was required to compare both. IQwav object is the scipy version where as IQwavAlt is the np.memmap version.\n", "\n", "In order to compare the two methods, a simple timer was used to calculate the time taken by both methods to decode a chunk of NOAA signal. The only difference between both will be the method in reading of wav file\n", "\n", "The following code was used" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import timeit\n", "\n", "start = timeit.default_timer()\n", "\n", "# noaa_cli.py\n", "\n", "stop = timeit.default_timer()\n", "\n", "print stop - start " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Time difference was measured three times, The results were:" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "For scipy version i.e. IQwav: 8.716557201862317, 8.429290608808675, 8.515829894656997 (seconds)\n", "For np version i.e. IQwavAlt: 8.460588917355224, 8.538985997064698, 8.479534460178845 (seconds)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Conclusions\n", "We conclude that the time taken is almost similar, hence we use scipy's version because it gives us the sampling frequency aswell as the ease to use." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }