nmrglue.process.proc_lp.lp2d

nmrglue.process.proc_lp.lp2d(data, pred, P, M, mirror='0', fix_points=True, method='svd')[source]

Perform a forward 2D linear prediction extrapolation on data.

Use the 2D linear prediction algorithm presented in: G. Zhu and A. Bax, Journal of Magnetic Resonance, 1992, 98, 192-199. to extend the last (1) axis by pred points. A PxM prediction matrix, C, is formed by solving the modified linear prediction equation given by:

data[n,m] = /sigma_{l=0}^{P-1} /sigma_{k=1}^M C_{l,k}*data[n-l,m-k]

For all valid points in data. This prediction matrix together with the data matrix with a mirror image appended is used to extend the last (1) axis by pred points resulting in a new array of size [N_0, N_1+pred] where N_0 and N_1 are the sizes of the original data. To linear predict both dimensions this function should be used twice with a transpose between the uses.

Backward linear prediction using this method is not possible as the method depends on being able to mirror the data before the first collected point. In backwards mode this would correspond to being able to correctly determind points after the last point which cannot be determinded using the mirror method. A backward prediction matrix can be calculated but would not prove useful.

The forward-backward averaging of the linear prediction coefficients is not possible as there is no characteristic polynomial to root and reflect. Therefore the backward prediction matrix cannot be reversed.

Parameters :

data : ndarray

2D NMR data (time domain for last axes).

pred : int

Number of points to predict along the last (1) axes.

P : int

Prediction matrix length along the non-predicted (0) axis.

M : int

Prediction matrix length along the predicted (1) axis.

mirror : {‘0’ or ‘180’}

Method to use for forming the mirror image of the non-predicted axis. ‘0’ indicated no initial delay, ‘180’ for a half-point delay.

fix_points : bool

True to reduce predicted points with magnitude larger than the largest data point. False leaved predicted points unaltered.

method : {‘svd’, ‘qr’, ‘cholesky’, ‘tls’}

Method used to calculate the LP prediction matrix. See lp() for a description of theses methods.

Returns :

ndata : ndarray

2D NMR data with pred points appended to the last (1) axes.

Notes

The axes in this function are reversed as compared to the JMR paper.

Previous topic

nmrglue.process.proc_lp.lp_tls

Next topic

nmrglue.process.proc_lp.cadzow

This Page