Homework 2

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
 (1)

Suppose that the data vector consists of random noise: the data values are independent and identically distributed with a zero-mean Gaussian distribution: , , . Find the mathematical expectation of .

2. The matrix in equation (2) represents a convolution operator with zero boundary conditions.
 (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.

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 -transform notation as a ratio of two polynomials.