{ "metadata": { "name": "Compressive Sampling" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Compressive sampling Overview" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In our previous discussion, we saw that imposing bandlimited-ness on our class of signals permits point-wise sampling of our signal and then later perfect reconstruction. It turns out that by imposing *sparsity* we can also obtain perfect reconstruction irrespective of whether or not we have satsified the sampling rate limits imposed by Shannon's sampling theorem. This has extremely important in practice because many signals are naturally sparse so that collecting samples at high rates only to dump most of them as the signal is compressed is expensive and wasteful. " ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "What Are Sparse Signals?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's carefully discuss what we mean by *sparse* in this context. A signal $f$ is sparse if it can be expressed in very few nonzero components ($\\mathbf{s}$) with respect to a given basis ($\\mathbf{\\Psi}$ ). In other words, in matrix-vector language:\n", "\n", "$\\mathbf{f} = \\mathbf{\\Psi} \\mathbf{s}$\n", "\n", "where $|| \\mathbf{s} ||_0 \\leq N$ where $N$ is the length of the vector and $|| \\cdot||_0$ counts the number of nonzero elements in $\\mathbf{s}$. Furthermore, we don't actually collect $N$ samples point-wise as we did in the Shannon sampling case. Rather, we measure $\\mathbf{f}$ indirectly as $\\mathbf{y}$ with another matrix as in:\n", "\n", "$\\mathbf{y} = \\mathbf{\\Phi f} = \\mathbf{\\Phi} \\mathbf{\\Psi} \\mathbf{s} = \\mathbf{\\Theta s}$\n", "\n", "where $\\mathbf{\\Theta}$ is an $M \\times N$ matrix and $M < N$ is the number of measurements. This setup means we have two problems to solve. First, how to design a *stable* measurement matrix $\\mathbf{\\Phi}$ and then, second, how to reconstruct $\\mathbf{f}$ from $\\mathbf{y}$. \n", "\n", "This may look like a standard linear algebra problem but since $\\mathbf{\\Theta}$ has fewer rows than columns, the solution is necessarily ill-posed. This is where we inject the sparsity concept! Suppose that $f$ is $K$-sparse ( $||f||_0=K$ ), then if we somehow knew *which* $K$ columns of $\\mathbf{\\Theta}$ matched the $K$ non-zero entries in $\\mathbf{s}$, then $\\mathbf{\\Theta}$ would be $M \\times K$ where we could make $M > K$ and then have a stable inverse.\n", "\n", "This bit of reasoning is encapsulated in the following statement for any vector $\\mathbf{v}$ sharing the same $K$ non-zero entries as $\\mathbf{s}$, we have \n", "\n", "$$1-\\epsilon \\leq \\frac{|| \\mathbf{\\Theta v} ||_2}{|| \\mathbf{v} ||_2} \\leq 1+\\epsilon$$ \n", "\n", "which is another way of saying that $\\mathbf{\\Theta}$ preserves the lengths of $K$-sparse vectors. Of course we don't know ahead of time which $K$ components to use, but it turns out that this condition is sufficient for a stable inverse of $\\mathbf{\\Theta}$ if it holds for any $3K$-sparse vector $\\mathbf{v}$. This is the *Restricted Isometry Property* (RIP). Unfortunately, in order to use this sufficient condition, we would have to propose a $\\mathbf{\\Theta}$ and then check all possible combinations of nonzero entries in the $N$-length vector $\\mathbf{v}$. As you may guess, this is prohibitive.\n", "\n", "Alternatively, we can approach stability by defining *incoherence* between the measurement matrix $\\mathbf{\\Phi}$ and the sparse basis $\\mathbf{\\Psi}$ as when any of the columns of one cannot be expressed as a small subset of the columns of the other. For example, if we have delta-spikes for $\\mathbf{\\Phi}$ as the row-truncated identity matrix\n", "\n", "$$\\mathbf{\\Phi} = \\mathbf{I}_{M \\times N}$$\n", "\n", "and the discrete Fourier transform matrix for $\\mathbf{\\Psi}$ as\n", "\n", "$\\mathbf{\\Psi} = \\begin{bmatrix}\\\\\\\\\n", "e^{-j 2\\pi k n/N}\\\\\\\\\n", "\\end{bmatrix}_{N \\times N}$\n", "\n", "Then we could not write any of the columns of $\\mathbf{\\Phi}$ using just a few of the columns of $\\mathbf{\\Psi}$.\n", "\n", "It turns out that picking the measuring $M \\times N$ matrix randomly according to a Gaussian zero-mean, $1/N$ variance distribution and using the identity matrix as $\\mathbf{\\Phi}$, that the resulting $\\mathbf{\\Theta}$ matrix can be shown to satisfy RIP with a high probability. This means that we can recover $N$-length $K$-sparse signals with a high probability from just $M \\ge c K \\log (N/K)$ samples where $c$ is a small constant. Furthermore, it also turns out that we can use any orthonormal basis for $\\mathbf{\\Phi}$, not just the identity matrix, and these relations will all still hold." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Reconstructing Sparse Signals" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we have a way, by using random matrices, to satisfy the RIP, we are ready to consider the reconstruction problem. The first impulse is to compute the least-squares solution to this problem as\n", "\n", "$$\\mathbf{s}^* = \\mathbf{\\Theta}^T (\\mathbf{\\Theta}\\mathbf{\\Theta}^T)^{-1}\\mathbf{y}$$ \n", "\n", "But a moment's thought may convince you that since $\\mathbf{\\Theta}$ is a random matrix, most likely with lots of non-zero entries, it is highly unlikely that $\\mathbf{s}^*$ will turn out to be sparse. There is actually a deeper geometric intuition as to why this happens, but let's first consider another way of solving this so that the $\\mathbf{s}^*$ is $K$-sparse. Suppose instead we shuffle through combinations of $K$ nonzero entries in $\\mathbf{s}$ until we satisfy the measurements $\\mathbf{y}$. Stated mathematically, this means\n", "\n", "$$\\mathbf{s}^* = argmin || \\mathbf{s}^* ||_0$$\n", "\n", "where\n", "\n", "$$\\mathbf{\\Theta} \\mathbf{s}^* = \\mathbf{y}$$\n", "\n", "It can be shown that with $M=K+1$ iid Gaussian measurements, this optimization will recover a $K$-sparse signal exactly with high probability. Unfortunately, this is numerically unstable in addition to being an NP-complete problem.\n", "\n", "Thus, we need another tractable way to approach this problem. It turns out that when a signal is sparse, it usually means that the nonzero terms are highly asymmetric meaning that if there are $K$ terms, then most likely there is one term that is dominant (i.e. of much larger magnitude) and that dwarfs the other nonzero terms. Geometrically, this means that in $N$-dimensional space, the sparse signal is very close to one (or, maybe just a few) of the axes. \n", "\n", "It turns out that one can bypass this combinatorial problem using $L_1$ minimization. To examine this, let's digress and look at the main difference between $L_2$ and $L_1$ minimization problems." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "reference:\n", "http://users.ece.gatech.edu/\u0018justin/ssp2007" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "$L_2$ vs. $L_1$ Optimization" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The classic constrained least squares problem is the following:\n", "\n", "min $||\\mathbf{x}||_2^2$\n", "\n", "where $x_1 + 2 x_2 = 1$\n", "\n", "with corresponding solution illustrated below.\n" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from __future__ import division\n", "from matplotlib.patches import Circle\n", "x1 = linspace(-1,1,10)\n", "fig=figure()\n", "ax=fig.add_subplot(111)\n", "ax.plot(x1,(1-x1)/2)\n", "ax.add_patch(Circle((0,0),1/sqrt(5),alpha=0.3))\n", "ax.plot(1/5,2/5,'rs')\n", "ax.axis('equal')\n", "ax.set_xlabel('$x_1$',fontsize=24)\n", "ax.set_ylabel('$x_2$',fontsize=24)\n", "ax.grid()" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAZMAAAEVCAYAAAAl9QikAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XtQVPfZB/DvLiwsyE1QLgJmjcZgFAQ0Qi40G1NzoZFo\nm7Y275vR2LFxOv0jr51Ik0zT2iTGzHQ6sTp9YzJJNJ03eW1MjdTbm2oF0ySIdxLBu8h9XcDlIrDX\n8/5hIKLclr2c8zvn+5nJ1IUDPE/PgWd/z3MuOkmSJBAREflAL3cAREQkPhYTIiLyGYsJERH5jMWE\niIh8xmJCREQ+YzEhIiKfhcodgFx0Op3cIRARCWeoq0k0vTKRJEmI/373u9/JHgPzZt7Mm3kPR9PF\nRBQ1NTVyhyAL5q0tzFtsLCZEROQzFhMBLFu2TO4QZMG8tYV5i00njdQIUymdTjdiD5CIiL4z3N9N\nrkwEUFpaKncIsmDe2sK8xcZiQkREPmObi4iIRoVtLiIiCigWEwGopafqLeatLcxbbCwmRETkM85M\niIhoVDgzISKigGIx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xmM/Ly8vo/9qMf/QglJSVobW1FTEwMent70dzcDJPJJF+gRGPAYkIU\nJJIkDbi1uCRJSEpKgslkQkVFhYyREfmObS6iILn5GRWVlZVoaWnBgw8+OOzXud1u7N69G1OmTAlk\neEQ+4fNMiGSyf/9+ABi2mHz44Yc4dOgQWlpacPny5WCFRuQ1rkyIgqSrqwu1tbX9r/fv3w+dTod7\n7723/2N2ux2FhYX9r5966imsX78eCxYsCGqsRN7iyoQoCHp7e3HHHXfAYDCgtrYWdXV12LdvH5KT\nkxETE9O/3Z///GfMnz9fxkiJxoYrE6IgqK2thdVqxcqVK+HxeLBmzRr84Q9/gNVq7X9k67/+9S+U\nlZVh1apVMkdL5D2uTIiCYPr06XjppZfwySef4OjRo3jmmWfw+OOPY/z48fjpT38Ko9GIWbNmYdu2\nbdDr+R6PxMNTg4kEsHnzZixfvhwej0fuUIgGxbdARETkMxYTIiLyGYsJERH5jMWESABOpxMA4HK5\nZI6EaHAsJkQKtnPnTjz++ON4/vnnodPpkJWVhSeffBIdHR1yh0Y0AM/mIiIin3FlQkREPmMxISIi\nn7GYEBGRz1hMiIjIZywmRETkMxYTIiLyGYsJERH5jMWEiIh8xmJCREQ+YzEhIiKf/T/vDVaJTOlb\nngAAAABJRU5ErkJggg==\n" } ], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that the line is the constraint so that any solution to this problem must be on this line (i.e. satisfy the constraint). The $L_2$ solution is the one that just touches the perimeter of the circle. This is because, in $L_2$, the unit-ball has the shape of a circle and represents all solutions of a fixed $L_2$ length. Thus, the one of smallest length that intersects the line is the one that satisfies the stated minimization problem. Intuitively, this means that we *inflate* a ball at the origin and stop when it touches the contraint. The point of contact is our $L_2$ minimization solution.\n", "\n", "Now, let's do same problem in $L_1$ norm\n", "\n", "min $||\\mathbf{x}||_1=|x_1|+|x_2|$\n", "\n", "where $x_1 + 2 x_2 = 1$\n", "\n", "In this case the constant-norm unit-ball contour in the $L_1$ norm is a diamond-shape instead of a circle. Comparing the graph below to the last shows that the solutions found are different. Geometrically, this is because the line tilts over in such a way that the inflating circular $L_2$ ball hits a point of tangency that is different from the $L_1$ ball because the $L_1$ ball creeps out mainly along the principal axes and is less influenced by the tilt of the line. This effect is much more pronounced in higher $N$-dimensional spaces where $L_1$-balls get more *spikey*. \n", "\n", "The fact that the $L_1$ problem is less sensitive to the tilt of the line is crucial since that tilt (i.e. orientation) is random due the choice of random measurement matrices. So, for this problem to be well-posed, we need to *not* be influenced by the orientation of any particular choice of random matrix and this is what casting this as a $L_1$ minimization provides. " ] }, { "cell_type": "code", "collapsed": false, "input": [ "from matplotlib.patches import Rectangle\n", "import matplotlib.patches\n", "import matplotlib.transforms\n", "\n", "r=matplotlib.patches.RegularPolygon((0,0),4,1/2,pi/2,alpha=0.5)\n", "\n", "fig=figure()\n", "ax=fig.add_subplot(111)\n", "ax.plot(x1,(1-x1)/2)\n", "ax.plot(0,1/2,'rs')\n", "ax.add_patch(r)\n", "ax.grid()\n", "ax.set_xlabel('$x_1$',fontsize=24)\n", "ax.set_ylabel('$x_2$',fontsize=24)\n", "ax.axis('equal')\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "pyout", "prompt_number": 2, "text": [ "(-1.0, 1.0, -0.60000000000000009, 1.2)" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAZMAAAEVCAYAAAAl9QikAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHqBJREFUeJzt3X1QVOfZBvBriRgSP4IwAzKCbiJxoCqKtS6ThmZ1apJS\nIZg6KW3GgnSIttPM69hRYjNJ42fNO52+frVRO4li23T8SBQi6lRNFtokhFFjTIJNMMkqYqBKpOKk\nfKjn/cPuCssu7Nlz9pzzPOf6zWTCYQ/kuXN2ubife3dxKIqigIiISIMYsxdARETiY5gQEZFmDBMi\nItKMYUJERJoxTIiISDOGCRERaTbE7AWYxeFwmL0EIiLhhHo1ia07E0VRhPjn17/+tel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fL/7kf/OAHqKqqQltbG0aOHInOzk60tLTA6XSat1CiCDBMiAyiKEqf\ntxZXFAXJyclwOp2or683cWVE2nGbi8gggX+j4vTp07h8+TJmzpw54NfduHEDBw8exL333hvN5RFp\nwr9nQmSSY8eOAcCAYfLqq6/ivffew+XLl3Hu3DmjlkakGjsTIoNcu3YN58+f9x8fO3YMDocDDzzw\ngP9zXV1dyMvL8x//+Mc/xoYNGzB79mxD10qkFjsTIgN0dnbi/vvvR2xsLM6fP4+mpiYcPXoUo0eP\nxsiRI/3nbdy4EbNmzTJxpUSRYWdCZIDz58/j0qVLWLRoEW7evIkVK1Zg5cqVuHTpkv9Ptr755puo\nqanBkiVLTF4tkXrsTIgMMGHCBDz77LN47bXXcOLECSxYsABz5szBqFGj8MMf/hBxcXGYNGkS9u7d\ni5gY/o5H4uFTg4kEsGPHDpSWluLmzZtmL4UoKP4KREREmjFMiIhIM4YJERFpxjAhEkBPTw8A4Pr1\n6yavhCg4hgmRhR04cABz5szB0qVL4XA4kJWVhXnz5uHq1atmL42oDz6bi4iINGNnQkREmjFMiIhI\nM4YJERFpxjAhIiLNGCZERKQZw4SIiDRjmBARkWYMEyIi0oxhQkREmjFMiIhIs/8Hhw/ZFHG+nqsA\nAAAASUVORK5CYII=\n" } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "To explore this a bit, let's consider using the cvxopt package (Python ver 2.6 used here). This can be cast as a linear programming problem as follows:\n", "\n", "min $||\\mathbf{t}||_1 = |t_1| + |t_2|$\n", "\n", "subject to:\n", "\n", "$-t_1 < x_1 < t_1$\n", "\n", "$-t_2 < x_2 < t_2$\n", "\n", "$x_1 + 2 x_2 = 1$\n", "\n", "$t_1 > 0$\n", "\n", "$t_2 > 0$\n", "\n", "where the last two constraints are already implied by the first two and are written out just for clarity. This can be implemented and solved in cvxopt as the following:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from cvxopt import matrix as matrx # don't overrite numpy matrix class\n", "from cvxopt import solvers\n", "\n", "#t1,x1,t2,x2\n", "c = matrx([1,0,1,0],(4,1),'d') \n", "G = matrx([ [-1, -1, 0, 0], #column-0\n", " [ 1, -1, 0, 0], #column-1\n", " [ 0, 0, -1,-1], #column-2\n", " [ 0, 0, 1,-1], #column-3\n", " ],(4,4),'d')\n", "\n", "h = matrx([0,0,0,0],(4,1),'d') # (4,1) is 4-rows,1-column, 'd' is float type spec\n", "A = matrx([0,1,0,2],(1,4),'d')\n", "b = matrx([1],(1,1),'d')\n", "sol = solvers.lp(c, G, h,A,b)\n", "x1=sol['x'][1]\n", "x2=sol['x'][3]\n", "print 'x=%3.2f'% x1\n", "print 'y=%3.2f'% x2" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " pcost dcost gap pres dres k/t\n", " 0: 0.0000e+00 -0.0000e+00 3e+00 3e+00 1e-16 1e+00\n", " 1: 2.3609e-01 2.3386e-01 5e-01 5e-01 1e-16 2e-01\n", " 2: 4.9833e-01 4.9734e-01 5e-02 4e-02 5e-15 1e-02\n", " 3: 4.9998e-01 4.9997e-01 5e-04 5e-04 2e-15 2e-04\n", " 4: 5.0000e-01 5.0000e-01 5e-06 5e-06 6e-16 2e-06\n", " 5: 5.0000e-01 5.0000e-01 5e-08 5e-08 9e-16 2e-08\n", "Optimal solution found.\n", "x=0.00\n", "y=0.50\n" ] } ], "prompt_number": 3 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example Gaussian Random matrices" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's try out our earlier result about random Gaussian matrices and see if we can reconstruct an unknown $\\mathbf{s}$ vector using $L_1$ minimization." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import scipy.linalg\n", "\n", "def rearrange_G( x ): \n", " 'setup to put inequalities matrix with last 1/2 of elements as main variables'\n", " n=x.shape[0]\n", " return hstack([x[:,arange(0,n,2)+1], x[:,arange(0,n,2)]])\n", "\n", "K=2 # components\n", "Nf=128 # number of samples\n", "M = 12 # > K log2(Nf/K); num of measurements\n", "s=zeros((Nf,1)) # sparse vector we want to find\n", "s[0]=1 # set the K nonzero entries\n", "s[1]=0.5\n", "np.random.seed(5489) # set random seed for reproducibility\n", "Phi = matrix(randn(M,Nf)*sqrt(1/Nf)) # random Gaussian matrix\n", "y=Phi*s # measurements\n", "\n", "#-- setup L1 minimization problem -- \n", "\n", "# inequalities matrix with \n", "G=matrx(rearrange_G(scipy.linalg.block_diag(*[matrix([[-1,-1],[1,-1.0]]),]*Nf) ))\n", "# objective function row-matrix\n", "c=matrx(hstack([ones(Nf),zeros(Nf)]))\n", "# RHS for inequalities\n", "h = matrx([0.0,]*(Nf*2),(Nf*2,1),'d') \n", "# equality constraint matrix\n", "A = matrx(hstack([Phi*0,Phi]))\n", "# RHS for equality constraints \n", "b=matrx(y)\n", "\n", "sol = solvers.lp(c, G, h,A,b)\n", "\n", "#nonzero entries\n", "nze= array(sol['x']).flatten()[:Nf].round(2).nonzero()\n", "print array(sol['x'])[nze]" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " pcost dcost gap pres dres k/t\n", " 0: 0.0000e+00 -0.0000e+00 1e+02 2e+01 1e-16 1e+00\n", " 1: 1.6712e-01 1.6700e-01 1e+01 1e+00 2e-16 7e-02\n", " 2: 1.2947e+00 1.2929e+00 4e+00 5e-01 3e-16 3e-02\n", " 3: 1.3785e+00 1.3745e+00 2e+00 2e-01 6e-16 8e-03" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", " 4: 1.4705e+00 1.4690e+00 5e-01 7e-02 4e-16 2e-03\n", " 5: 1.4976e+00 1.4972e+00 2e-01 2e-02 6e-16 7e-04\n", " 6: 1.4979e+00 1.4978e+00 6e-02 7e-03 3e-14 2e-04\n", " 7: 1.4998e+00 1.4998e+00 6e-03 8e-04 2e-14 2e-05" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", " 8: 1.5000e+00 1.5000e+00 6e-05 8e-06 3e-14 3e-07\n", " 9: 1.5000e+00 1.5000e+00 6e-07 8e-08 2e-14 3e-09\n", "Optimal solution found.\n", "[[ 0.99999789]\n", " [ 0.49999879]]\n" ] } ], "prompt_number": 56 }, { "cell_type": "markdown", "metadata": {}, "source": [ "That worked out! However, if you play around with this example enough with different random matrices (unset the seed statement above), you will find that it does not *always* find the correct answer. This is because the guarantees about reconstruction are all stated probabalistically (i.e. \"high-probability\"). This is another major difference between this and Shannon sampling.\n", "\n", "Let's encapulate the above $L_1$ minimization code so we can use it later." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from cStringIO import StringIO\n", "import sys\n", "\n", "def L1_min(Phi,y,K):\n", " # inequalities matrix with \n", " M,Nf = Phi.shape\n", " G=matrx(rearrange_G(scipy.linalg.block_diag(*[matrix([[-1,-1],[1,-1.0]]),]*Nf) ))\n", " # objective function row-matrix\n", " c=matrx(hstack([ones(Nf),zeros(Nf)]))\n", " # RHS for inequalities\n", " h = matrx([0.0,]*(Nf*2),(Nf*2,1),'d') \n", " # equality constraint matrix\n", " A = matrx(hstack([Phi*0,Phi]))\n", " # RHS for equality constraints \n", " b=matrx(y)\n", " # suppress standard output\n", " old_stdout = sys.stdout\n", " sys.stdout = mystdout = StringIO()\n", " sol = solvers.lp(c, G, h,A,b)\n", " # restore standard output\n", " sys.stdout = old_stdout\n", " sln = array(sol['x']).flatten()[:Nf].round(4)\n", " return sln\n", "\n" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Example: Sparse Fourier Transform" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As an additional example, let us consider the Fourier transform and see if we can recover the sparse Fourier transform from a small set of measurements. For simplicity, we will assume that the time domain signal is real which automatically means that the Fourier transform is symmetric." ] }, { "cell_type": "code", "collapsed": false, "input": [ "def dftmatrix(N=8): \n", " 'compute inverse DFT matrices'\n", " n = arange(N)\n", " U=matrix( exp(1j*2*pi/N*n*n[:,None] ))/sqrt(N)\n", " return matrix(U)\n", "\n", "Nf=128\n", "K=3 # components\n", "M = 8 # > K log2(Nf/K); num of measurements\n", "s=zeros((Nf,1)) # sparse vector we want to find\n", "s[0]=1 # set the K nonzero entries\n", "s[1]=0.5\n", "s[-1] = 0.5 # symmetric to keep inverse Fourier transform real\n", "Phi = dftmatrix(Nf)[:M,:] # take M-rows\n", "y=Phi*s # measurements\n", "# have to assert the type here on my hardware\n", "\n", "sol=L1_min(Phi.real,y.real.astype(np.float64),K)\n", "\n", "print np.allclose(s.flatten(),sol)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "True\n" ] } ], "prompt_number": 141 }, { "cell_type": "code", "collapsed": false, "input": [ "plot(sol)\n", "plot(y.real)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "pyout", "prompt_number": 140, "text": [ "[]" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAD9CAYAAAC2l2x5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFjFJREFUeJzt3X9sVfX9x/HXxVuUH5vooK3e262OJtKN/lwRjCI3wkRU\nLnRoUtwUqHaVfyb7Rr/GZIl0yZDFLRvrkqUutIOJSlxYyhywDeflkiCUAYHN6qizxdsrMqH2K13F\n23v5fP8g3Fnbe9t7C/eec3g+EgL33g/n8wLl3Vc+vT9cxhgjAIDjjMt2AADA5cGABwCHYsADgEMx\n4AHAoRjwAOBQDHgAcKikA762tlZ5eXkqKSlJuObpp59WaWmp5syZo7fffvuSBwQApCfpgF+1apV2\n7dqV8PEdO3bo6NGjOnbsmDZs2KCVK1de6nwAgDQlHfBz587Vddddl/Dx7du3a8WKFZKk2bNnq7e3\nV6dOnbq0CQEAaRnTGXw4HFZBQUH8ttfrVXd395hDAQDGzj3WC3z+nQ5cLtew6xLdDwBILt13lBlT\ng/d4PAqFQvHb3d3d8ng8CdcbY2z745lnnsl6his1v52zkz/7P+yefy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w88oL1799rm7/+iRHlH+5oXK/jNb36jHTt26LXXXovfZ4f8\n//rXv9TV1aWysjJJFzJ+4xvf0IEDB9LKf1kb/GieR281xhg98sgj+vrXv641a9bE7/f7/dq0aZMk\nadOmTVq6dGm2Iia0bt06hUIhdXZ26uWXX9add96p3/72t7bILkn5+fkqKirSgQMHdP78ef3xj3/U\n/PnztXjxYlvknzt3rv72t7+pp6dHn376qXbu3Km77rrLNn//FyXK6/f79fLLLysSiaizs1MdHR26\n5ZZbshl1WLt27dJzzz2n7du365prronfb4f8JSUlOnXqlDo7O9XZ2Smv16vDhw8rLy8vvfyX+PsF\nQwQCAVNeXm5mzpxpNmzYcLm3G7O9e/cal8tlysrKTHl5uSkvLzc7d+609FPdhhMIBOLPorFT9n/+\n859m9uzZZvr06Wbp0qWmr6/PVvlbWlrMHXfcYaqqqswPfvADE4vFLJ2/pqbG3HDDDWb8+PHG6/Wa\n5ubmpHl//vOfm5kzZ5ry8nITDAazmPyCi/lzcnKM1+s1GzduNEVFRebLX/5y/N/v6tWr4+utmv+z\nf/+fddNNNw16mmSq+V3G8B4CAOBEWftEJwDA5cWABwCHYsADgEMx4AHAoRjwAOBQDHgAcKj/B+Sx\nwNIXyAr5AAAAAElFTkSuQmCC\n" } ], "prompt_number": 140 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Uniform Uncertainty Principle" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$\\Phi$ obeys a UUP for sets of size $K$ if\n", "\n", "
\n", "$$0.8 \\frac{M}{N} ||f||_2^2 \\leq || \\Phi f||_2^2 \\leq 1.2 \\frac{M}{N} ||f||_2^2$$\n", "
\n", "\n", "Measurements that satisfy this are defined as *incoherent*. Given that $f$ is $K$-sparse and we measure\n", "$y=\\Phi f$, then we search for the sparsest vector that explains the $y$ measurements and thus find $f$ as follows:\n", " \n", "
\n", " $min_f \\\\#\\lbrace t: f(t) \\ne 0 \\rbrace$ where $\\Phi f = y$\n", "
\n", " Note that the hash mark is the size (i.e. cardinality) of the set. This means that we are looking for the fewest individual points for $f$ that satisfy the constraints. Unfortunately, this is not practically possible, so we must use the $\\mathbb{L}_1$ norm as a proxy for sparsity.\n", " \n", "Suppose $f$ is $K$-sparse and that $\\Phi$ obeys UUP for sets of size $4K$. Then we measure $y=\\Phi f$ and then solve\n", " \n", "
\n", " $min_f ||f||_1$ where $\\Phi f = y$\n", "
\n", "to recover $f$ exactly and we can use $M > K \\log N$ measurements, where the number of measurements is approximately equal to the number of active components. Let's consider a concrete example of how this works." ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Example: Sampling Sinusoids" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here, we sample in the time-domain, given that we know the signal is sparse in the frequency domain. \n", "\n", "
\n", "$$\\hat{f}(\\omega) = \\sum_{i=1}^K \\alpha_i \\delta(\\omega_i-\\omega)$$\n", "
\n", "\n", "which means that it consists of $K$-sparse nonzero elements. Therefore, the time domain signal is\n", "\n", "
\n", "$$f(t) = \\sum_{i=1}^K \\alpha_i e^{i \\omega_i t}$$\n", "
\n", "\n", "where the $\\alpha_i$ and $\\omega_i$ are unknown. We want solve for these unknowns by taking $M \\gt K \\log N$ samples of $f$." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The problem we want to solve is \n", "\n", "$min_g || \\hat{g} ||_{L_1}$\n", "\n", "subject to\n", "\n", "$g(t_m)=f(t_m)$\n", "\n", "The trick here is that are minimizing in the frequency-domain while the constraints are in the time-domain. To make things easier, we will restrict our attention to real time-domain signals $f$ and we will only reconstruct the even-indexed time-samples from the signal. This means we need a way of expressing the inverse Fourier Transform as a matrix of equality constraints. The assumption of real-valued time-domain signals implies the following symmetry in the frequency-domain:\n", "\n", "$F(k) = F(N-k)^*$\n", "\n", "where $F$ is the Fourier transform of $f$ and the asterisk denotes complex conjugation and $k\\in \\lbrace 0,1,..N-1\\rbrace$ and $N$ is the Fourier Transform length. To make things even more tractable we will assume the time-domain signal is even, which means real-valued Fourier transform values.\n", "\n", "Suppose that $\\mathbf{U}_N$ is the $N$-point DFT-matrix. Note that we always assume $N$ is even. Since we are dealing with only real-valued signals, the transform is symmetric, so we only need half of the spectrum computed. It turns out that the even-indexed time-domain samples can be constructed as follows:\n", "\n", "$\\mathbf{f_{even}} = \\mathbf{U}_{N/2} \\begin{bmatrix}\\\\\\\\\n", "F(0)+F(N/2)^* \\\\\\\\\n", "F(1)+F(N/2-1)^* \\\\\\\\\n", "F(2)+F(N/2-2)^* \\\\\\\\\n", "\\dots \\\\\\\\\n", "F(N/2-1)+F(1)^* \n", "\\end{bmatrix}$\n", "\n", "We can further simplify this by breaking this into real (superscript $R$) and imaginary (superscript $I$) parts and keeping only the real part\n", "\n", "$$\\mathbf{f_{even}} = \\mathbf{U}_{N/2}^R\n", "\\begin{bmatrix}\\\\\\\\\n", "F(0)^R+F(N/2)^R \\\\\\\\\n", "F(1)^R+F(N/2-1)^R \\\\\\\\\n", "F(2)^R+F(N/2-2)^R \\\\\\\\\n", "\\dots \\\\\\\\\n", "F(N/2-1)^R+F(1)^R \n", "\\end{bmatrix}\n", "+\n", "\\mathbf{U}^I_N\n", "\\begin{bmatrix} \\\\\\\\\n", "-F(0)^I+F(N/2)^I \\\\\\\\\n", "-F(1)^I+F(N/2-1)^I \\\\\\\\\n", "-F(2)^I+F(N/2-2)^I \\\\\\\\\n", "\\dots \\\\\\\\\n", "-F(N/2-1)^I+F(1)^I \n", "\\end{bmatrix}$$\n", "\n", "But we are going to force all the $F(k)^I$ to be zero in our example. Note that the second term should have a $\\mathbf{U}_{N/2}$ in it instead $\\mathbf{U}_N$ but there is something wrong with the javascript parser for that bit of TeX.\n", "\n", "Now, let's see if we can walk through to step-by-step to make sure our optimization can actually work. Note that we don't need the second term on the right with the $F^I$ terms because by our construction, $F$ is real." ] }, { "cell_type": "code", "collapsed": false, "input": [ "def dftmatrix(N=8): \n", " 'compute inverse DFT matrices'\n", " n = arange(N)\n", " U=matrix( exp(1j*2*pi/N*n*n[:,None] ))/sqrt(N)\n", " return matrix(U)\n", "\n", "def Q_rmatrix(Nf=8):\n", " 'implements the reordering, adding, and stacking of the matrices above'\n", " Q_r=matrix(hstack([eye(Nf/2),eye(Nf/2)*0])\n", " +hstack([zeros((Nf/2,1)),fliplr(eye(Nf/2)),zeros((Nf/2,Nf/2-1))]))\n", " return Q_r\n", "\n", "Nf=8\n", "F=zeros((Nf,1)) # 8-point DFT\n", "F[0]= 1 # DC-term, constant signal\n", "n = arange(Nf/2)\n", "\n", "ft = dftmatrix(Nf).H*F # this gives the constant signal\n", "\n", "Q_r=Q_rmatrix(Nf)\n", "U=dftmatrix(Nf/2) #half inverse DFT matrix\n", "feven= U.real*Q_r*F # half the size\n", "print np.allclose(feven,ft[::2]) # retrieved even-numbered samples\n", "\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "False\n" ] } ], "prompt_number": 358 }, { "cell_type": "code", "collapsed": false, "input": [ "# let's try this with another sparse frequency-domain signal\n", "F=zeros((Nf,1)) \n", "F[1]=1\n", "F[Nf-1]=1 # symmetric part\n", "ft = dftmatrix(Nf).H*F # this gives the constant signal\n", "feven= U.real*Q_r*F # half the size\n", "print np.allclose(feven,ft[::2]) # retrieved even-numbered samples\n", "\n", "plot(arange(Nf),ft.real,arange(Nf)[::2],feven,'o')\n", "xlabel('$t$',fontsize=22)\n", "ylabel('$f(t)$',fontsize=22)\n", "title('even-numbered samples')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "False\n" ] }, { "output_type": "pyout", "prompt_number": 359, "text": [ "" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAZoAAAEgCAYAAACNV7VwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XlcVPX+P/DXsLimgIKIgEJoSSKbGv70qkippUkutyt4\nExXjWubaLdPKxK9r3vx600r9mpCWmmG54p4OkOaSmhtY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XJXu5syZg+zsbFy4cAHfffcdwsLCsGrVKqXL0tn9+/dx9+5dAMC1a9ew\nbds2s9r/zZs3R+vWrXHo0CGUlZUhMTERL774otJl6W3t2rWIjIysfkMjBRNMllqtFoGBgcLPz098\n9tlnSpejl4iICOHm5ibq1KkjPDw8RFxcnNIl6SUlJUWoVCoREBAgAgMDRWBgoNi+fbvSZenk5MmT\nIigoSPj7+4vevXuLr776SumSakytVptd6iwjI0MEBASIgIAAERYWJpYuXap0SXr7/fffRUhIiPDx\n8REDBgwQ+fn5Spekl/z8fNG0aVNx586dare1+vNoiIhIXlY9dEZERPJjoyEiIlmx0RARkazYaIiI\nSFZsNEREJCs2GiIikhUbDZGJO3DggFktr0L0ODYaIhM3aNAgfPXVV0qXQVRjbDREJiwtLQ1Xr15F\n165dlS6FqMbYaIhM2M8//wxAuvYQkblioyEyYSkpKWjSpAl8fX2VLoWoxthoiEzMtm3b0KlTJ3Tq\n1AmrV6+Gra2t5nZqaqrS5RHpjYtqEpmo7OxstGrVCv/9738xfvx4pcshqjEe0RCZqH379gEAunfv\nrnAlRLXDRkNkotRqNRwcHBAYGKh0KUS1wkZDZKLUajVjzWQR2GiITFBWVhYyMzMZayaLwEZDZILU\najWAivMzCxcuVKgaotphoyEyQUeOHNHEmgHgl19+gb29vcJVEdWMndIFENGTAgMD4ejoCDs7O9y5\ncwfLli1DXFyc0mUR1QjPoyEyQQ8ePMDbb78NlUoFe3t7fPzxx2jRooXSZRHVCBsNERHJinM0REQk\nKzYaIiKSFRsNERHJio2GiIhkxUZDRESyYqMhIiJZsdEQEZGs2GiIiEhW/x9Kt7j6wTqyuQAAAABJ\nRU5ErkJggg==\n" } ], "prompt_number": 359 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use the above cell to create more complicated real signals. You can experiment with the cell below. Just remember to impose the symmetry condition!" ] }, { "cell_type": "code", "collapsed": false, "input": [ "Nf=32 # must be even\n", "F=zeros((Nf,1)) \n", "\n", "# set values and corresponding symmetry conditions\n", "\n", "F[7]=1 \n", "F[12]=0.5\n", "F[9]=-0.25\n", "F[Nf-9]=-0.25\n", "F[Nf-12] = 0.5\n", "F[Nf-7]=1 # symmetric part\n", "\n", "Q_r=Q_rmatrix(Nf)\n", "U=dftmatrix(Nf/2) #half inverse DFT matrix\n", "ft = dftmatrix(Nf).H*F # this gives the constant signal\n", "feven= U.real*Q_r*F # half the size\n", "print np.allclose(feven,ft[::2]) # retrieved even-numbered samples\n", "\n", "plot(arange(Nf),ft.real,arange(Nf)[::2],feven,'o')\n", "xlabel('$t$',fontsize=22)\n", "ylabel('$f(t)$',fontsize=22)\n", "title('even-numbered samples')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "False\n" ] }, { "output_type": "pyout", "prompt_number": 360, "text": [ "" ] }, { "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAZ0AAAEgCAYAAABvi64JAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXlc1WX2xz+XTVwBFUFZRKEFFQTDNDMhN0xG1PpNoaWo\nRe5LpS1OpuaSZeUIWeOMWpo62TbqhHsj4uSamrhNKoIgi4G4IQICz++Px+/1Avdyt+8K5/16+ZJ7\n73O/9/C9X57P95znnPPoGGMMBEEQBCEDDkobQBAEQTQcSHQIgiAI2SDRIQiCIGSDRIcgCIKQDRId\ngiAIQjZIdAiCIAjZINEhCBlxcHDApUuXFPnsMWPGYM6cOYp8tiVkZmbCwcEBVVVVSptCSAiJDkE0\nEHQ6HXQ6ndJmEA0cEh2C0CAVFRU2vY9qwQmlIdEhFCM3NxfPPfccPD090aFDByQlJemfb9KkCa5f\nv64fe+LECXh6eqKyshIAsGbNGgQHB8Pd3R2DBg1CVlaWfqyDgwM2bNiAsLAwtGzZElOmTKnTjrrG\nz5s3D6NGjdI/rhkCioqKwgcffIABAwbA09MT8fHxKC8vx4QJE+Dl5YXHH38c2dnZ1T4vNTUVYWFh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EIRskOgQBEEQskGiQxAEQcgGiQ5BEAQhGyQ6BEEQhGz8\nP+VYaAsqXCuqAAAAAElFTkSuQmCC\n" } ], "prompt_number": 360 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we have gone through all that trouble to create the even-samples matrix, we can finally put it into the framework of the $L_1$ minimization problem:\n", "\n", "$min_F || \\mathbf{F} ||_{L_1}$\n", "\n", "subject to\n", "\n", "$\\mathbf{U}_{N/2}^R \\mathbf{Q}_r \\mathbf{F}= \\mathbf{f}$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def rearrange_G( x ): \n", " 'setup to put inequalities matrix with first 1/2 of elements as main variables'\n", " n=x.shape[0]\n", " return hstack([x[:,arange(0,n,2)+1], x[:,arange(0,n,2)]])\n", "\n", "K=2 # components\n", "Nf=128 # number of samples\n", "M = 18 # > K log(N); num of measurements\n", "\n", "# setup signal DFT as F\n", "F=zeros((Nf,1)) \n", "F[1]=1\n", "F[2]=0.5\n", "F[Nf-1]=1 # symmetric parts\n", "F[Nf-2]=0.5\n", "ftime = dftmatrix(Nf).H*F # this gives the time-domain signal\n", "ftime = ftime.real # it's real anyway\n", "time_samples=[0, 2, 4, 12, 14, 16, 18, 24, 34, 36, 38, 40, 44, 46, 52, 56, 54,62]\n", "half_indexed_time_samples = (array(time_samples)/2).astype(int)\n", "Phi = dftmatrix(Nf/2).real*Q_rmatrix(Nf)\n", "Phi_i = Phi[half_indexed_time_samples,:]\n", "\n", "# inequalities matrix with \n", "G=matrx(rearrange_G(scipy.linalg.block_diag(*[matrix([[-1,-1],[1,-1.0]]),]*Nf) ))\n", "# objective function row-matrix\n", "c=matrx(hstack([zeros(Nf),ones(Nf)]))\n", "# RHS for inequalities\n", "h = matrx([0.0,]*(Nf*2),(Nf*2,1),'d') \n", "# equality constraint matrix\n", "A = matrx(hstack([Phi_i,Phi_i*0]))\n", "# RHS for equality constraints \n", "b=matrx(ftime[time_samples])\n", "\n", "sol = solvers.lp(c, G, h,A,b)\n" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ " pcost dcost gap pres dres k/t\n", " 0: 0.0000e+00 -0.0000e+00 4e+02 2e+01 3e+00 1e+00\n", " 1: -1.5648e+01 -1.2218e+01 2e+03 2e+01 3e+00 4e+00\n", " 2: -2.3184e+03 -1.7022e+03 1e+06 8e+01 1e+01 6e+02\n", " 3: -2.2814e+05 -1.6566e+05 1e+08 8e+01 1e+01 6e+04" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", " 4: -2.2818e+07 -1.6568e+07 1e+10 8e+01 1e+01 6e+06\n", " 5: -2.2818e+09 -1.6568e+09 1e+12 8e+01 1e+01 6e+08" ] }, { "output_type": "stream", "stream": "stdout", "text": [ "\n", "Certificate of dual infeasibility found.\n" ] } ], "prompt_number": 361 }, { "cell_type": "code", "collapsed": false, "input": [ "import itertools as it\n", "\n", "def dftmatrix(N=8): \n", " 'compute inverse DFT matrices'\n", " n = arange(N)\n", " U=matrix( exp(1j*2*pi/N*n*n[:,None] ))/sqrt(N)\n", " return matrix(U)\n", "\n", "M = 3\n", "\n", "np.random.seed(5489) # set random seed for reproducibility\n", "Psi= dftmatrix(128)\n", "Phi= randn(M,128)\n", "s=zeros((128,1))\n", "s[0]=1\n", "s[10]=1\n", "\n", "Theta = Phi*Psi\n", "y = Theta*s\n", "\n", "for i in it.combinations(range(128),2):\n", " sstar=zeros((128,1))\n", " sstar[array(i)]=1\n", " if np.allclose(Theta*sstar,y):\n", " break\n", "else:\n", " print 'no solution'\n" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 12 }, { "cell_type": "code", "collapsed": false, "input": [ "%qtconsole" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 9 }, { "cell_type": "code", "collapsed": false, "input": [ "\n" ], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }