IPython Notebook

I had a nice discussion with Tom Ronadeau last weekend when he was in DC
for an SDR conference. I mentioned a project some of you may be aware
of
called the IPython
notebookhttp://ipython.org/ipython-doc/dev/interactive/htmlnotebook.html.
If you are familiar with IPython - the enhanced python shell, the
IPython
HTML Notebook is a locally-hosted web interface to an IPython kernel.
That
web interface looks and feels a lot like Mathematica. But whereas I
never
enjoyed Mathematica, I really like the IPython Notebook. It allows you
to
cellularize your code (Matlab has a similar feature) and so iteratively
modify and run code in a non-linear fashion that makes hacking (the
constructive kind) and debugging really refreshing. And you have all
the
introspective sugar and magic (functions) that come with IPython.

In the spirit of
TICSMTChttp://www.google.com/imgres?hl=en&safe=off&sa=X&tbo=d&biw=1855&bih=968&tbm=isch&tbnid=DDeEZuCf2s-zAM:&imgrefurl=http://cheezburger.com/6451017216&docid=6cRxF5dZAlwM1M&imgurl=https://i.chzbgr.com/maxW500/6451017216/h91121072/&w=500&h=375&ei=Ot_0UJr4FLOL0QGD2oHAAw&zoom=1&iact=rc&dur=362&sig=111954162843452102494&page=1&tbnh=142&tbnw=189&start=0&ndsp=68&ved=1t:429,r:18,s:0,i:139&tx=106&ty=56,
I have attached a very simple IPython Notebook example that is basically
a
copy-n-paste of the BER AWGN simulation
examplehttp://gnuradio.org/redmine/projects/gnuradio/repository/entry/gr-digital/examples/berawgn.py
from
gr.org.

This notebook doesn’t show off any of the fancier features of the
notebook,
but it’s a dirt-simple GR example and hopefully illustrates the tool.

To install the latest stable release of the IPython Notebook on Ubuntu,
pip
is your friend:
sudo pip install ipython

or for a slightly more out-of-date version if you are running at least
12.0:
sudo apt-get install ipython-notebook

Open a terminal and start the notebook server by running:
ipython notebook --pylab inline

A new tab should open in your browser and you can import the example
notebook. Note that the notebook server currently isn’t very filesystem
saavy, so it will save all your notebooks in whatever directory you
started
the notebook server from.

A few more links:

A gallery of publicly available notebooks http://nbviewer.ipython.org/

For great (but mostly long) videos about the notebook, search YouTube
for
“NextDayVideo” and ipython notebook. Anything by Fernando
Perezhttp://www.youtube.com/watch?v=2G5YTlheCbw is
perfect. Also Wes McKinney http://www.youtube.com/watch?v=w26x-z-BdWQ
and
his equally awesome pandas http://pandas.pydata.org/ project for
Python
data analysis.

TL ; DR

The IPython Notebook was developed for scientific computing. It
actually
has some really cool parallel processing stuff built right into it, like
the ability to start and control a local or remote cluster. But it’s
real
value is in the concept of reproducible research. The idea is that with
one file or project, any individual should be able to reproduce every
graph
in a scientific research paper or textbook. Some people are even
writing
their textbooks in the IPyNB.

There is support for LaTex and symbolic rendering. You can run shell
commands pythonically (just like in the IPython shell). You can even
run
other interpreters like R using magic functions.

I can imagine some neat SDR tutorials laid out in the IPyNB - e.g.
building
a filter, then plotting the filter. Generating a signal, then plotting
it.
Generating noise and adding that, then filtering and showing the final
result. The end product is easy to distribute as a single file and
allows
some stress-free non-linear tinkering.

Happy hacking.