15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2 Polynomials and Interpolation<br />

interpolation methods, see the section “Comparing Interpolation Methods” on<br />

page 2-13.<br />

FFT-Based Interpolation<br />

The function interpft performs one-dimensional interpolation using an<br />

FFT-based method. This method calculates the Fourier transform <strong>of</strong> a vector<br />

that contains the values <strong>of</strong> a periodic function. It then calculates the inverse<br />

Fourier transform using more points. Its form is<br />

y = interpft(x,n)<br />

x is a vector containing the values <strong>of</strong> a periodic function, sampled at equally<br />

spaced points. n is the number <strong>of</strong> equally spaced points to return.<br />

Two-Dimensional Interpolation<br />

The function interp2 performs two-dimensional interpolation, an important<br />

operation for image processing and data visualization. Its most general form is<br />

ZI = interp2(X,Y,Z,XI,YI,method)<br />

Z is a rectangular array containing the values <strong>of</strong> a two-dimensional function,<br />

and X and Y are arrays <strong>of</strong> the same size containing the points for which the<br />

values in Z are given. XI and YI are matrices containing the points at which to<br />

interpolate the data. method is an optional string specifying an interpolation<br />

method.<br />

There are three different interpolation methods for two-dimensional data:<br />

• Nearest neighbor interpolation (method = 'nearest'). This method fits a<br />

piecewise constant surface through the data values. The value <strong>of</strong> an<br />

interpolated point is the value <strong>of</strong> the nearest point.<br />

• Bilinear interpolation (method = 'linear'). This method fits a bilinear<br />

surface through existing data points. The value <strong>of</strong> an interpolated point is a<br />

combination <strong>of</strong> the values <strong>of</strong> the four closest points. This method is piecewise<br />

bilinear, and is faster and less memory-intensive than bicubic interpolation.<br />

• Bicubic interpolation (method = 'cubic'). This method fits a bicubic surface<br />

through existing data points. The value <strong>of</strong> an interpolated point is a<br />

combination <strong>of</strong> the values <strong>of</strong> the sixteen closest points. This method is<br />

piecewise bicubic, and produces a much smoother surface than bilinear<br />

interpolation. This can be a key advantage for applications like image<br />

2-12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!