next up previous [pdf]

Next: Sorting algorithms Up: Homework 2 Previous: Prerequisites

Data attributes and digital convolution

You can either write your answers to theoretical questions on paper or edit them in the file hw2/paper.tex. Please show all the mathematical derivations that you perform.

  1. The varimax attribute is defined as
    \begin{displaymath}
\phi[\mathbf{a}] = \frac{\displaystyle N\,\sum\limits_{n=1...
...n^4}{\displaystyle \left(\sum\limits_{n=1}^{N} a_n^2\right)^2}
\end{displaymath} (1)

    Suppose that the data vector $\mathbf{a}$ consists of random noise: the data values $a_n$ are independent and identically distributed with a zero-mean Gaussian distribution: $E[a_n]=0$, $E[a_n^2]=\sigma^2$, $E[a_n^4]=3\,\sigma^4$. Find the mathematical expectation of $\phi[\mathbf{a}]$.

  2. The matrix in equation (2) represents a convolution operator with zero boundary conditions.
    \begin{displaymath}
\mathbf{F} = \left[\begin{array}{llllll}
f_1 & f_0 & 0 & 0 &...
... f_0 \\
0 & 0 & 0 & f_3 & f_2 & f_1 \\
\end{array}\right]\;.
\end{displaymath} (2)

    The operator is implemented in the C function hw2/conv.c.

    void conv_lop (bool adj, bool add, 
    		int nx, int ny, float* xx, float* yy) 
    /*< linear operator >*/
    {
        int f, x, y, x0, x1;
    
        assert (ny == nx);
        sf_adjnull (adj, add, nx, ny, xx, yy);
        
        for (f=0; f < nf; f++) {
    	x0 = SF_MAX(0,1-f);
    	x1 = SF_MIN(nx,nx+1-f);
    	for (x = x0; x < x1; x++) {
    	    if( adj) {
    		/* add code */
    	    } else {
    		yy[x+f-1] += xx[x] * ff[f];
    	    }
    	}
        }
    }
    

    1. Modify the matrix and the program to implement periodic boundary conditions.
    2. Add the code for the adjoint (matrix transpose) operator.

  3. The C code in hw2/filter.c implements a recursive filtering operator.

    void filter_lop (bool adj, bool add, 
    		int nx, int ny, float* xx, float* yy) 
    /*< linear operator >*/
    {
        int i;
        float t;
    
        assert (ny == nx);
        sf_adjnull (adj, add, nx, ny, xx, yy);
        
        if (adj) {
    	/* add code */
        } else {
    	t = a*xx[0];
    	yy[0] += t;
    	for (i = 1; i < nx; i++) {
    	    t = a*xx[i] + b*xx[i-1] + c*t;
    	    yy[i] += t;
    	}
        }
    }
    

    1. Express this filter in the $Z$-transform notation as a ratio of two polynomials.
    2. Add code for the adjoint operator.


next up previous [pdf]

Next: Sorting algorithms Up: Homework 2 Previous: Prerequisites

2014-09-18