r.resamp.filter.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <h2>DESCRIPTION</h2>
  2. <em>r.resamp.filter</em> resamples an input raster, filtering the
  3. input with an analytic kernel. Each output cell is typically calculated
  4. based upon a small subset of the input cells, not the entire input.
  5. <em>r.resamp.filter</em> performs convolution (i.e. a weighted sum is
  6. calculated for every raster cell).
  7. <p>
  8. The module maps the input range to the width of the window function, so
  9. wider windows will be "sharper" (have a higher cut-off frequency), e.g.
  10. lanczos3 will be sharper than lanczos2.
  11. <p>
  12. r.resamp.filter implements FIR (finite impulse response) filtering. All
  13. of the functions are low-pass filters, as they are symmetric. See
  14. <a href="http://en.wikipedia.org/wiki/Window_function">Wikipedia: Window function</a>
  15. for examples of common window functions and their frequency responses.
  16. <p>
  17. A piecewise-continuous function defined by sampled data can be considered
  18. a mixture (sum) of the underlying signal and quantisation noise. The
  19. intent of a low pass filter is to discard the quantisation noise while
  20. retaining the signal.
  21. The cut-off frequency is normally chosen according to the sampling
  22. frequency, as the quantisation noise is dominated by the sampling
  23. frequency and its harmonics. In general, the cut-off frequency is
  24. inversely proportional to the width of the central "lobe" of the window
  25. function.
  26. <p>
  27. When using <em>r.resamp.filter</em> with a specific radius, a specific
  28. cut-off frequency regardless of the method is chosen. So while lanczos3
  29. uses 3 times as large a window as lanczos1, the cut-off frequency remains
  30. the same. Effectively, the radius is "normalised".
  31. <p>
  32. All of the kernels specified by the <b>filter</b> parameter are
  33. multiplied together. Typical usage will use either a single kernel or an
  34. infinite kernel along with a finite window.
  35. <h2>NOTES</h2>
  36. Resampling modules (<em>r.resample, r.resamp.stats, r.resamp.interp,
  37. r.resamp.rst, r.resamp.filter</em>) resample the map to match the
  38. current region settings.
  39. <p>
  40. When using a kernel which can have negative values (sinc, Lanczos),
  41. the <em>-n</em> flag should be used. Otherwise, extreme values can
  42. arise due to the total weight being close (or even equal) to zero.
  43. <p>
  44. Kernels with infinite extent (Gauss, normal, sinc, Hann, Hamming,
  45. Blackman) must be used in conjunction with a finite windowing function
  46. (box, Bartlett, Hermite, Lanczos).
  47. <p>
  48. The way that Lanczos filters are defined, the number of samples is
  49. supposed to be proportional to the order ("a" parameter), so lanczos3
  50. should use 3 times as many samples (at the same sampling frequency, i.e.
  51. cover 3 times as large a time interval) as lanczos1 in order to get a
  52. similar frequency response (higher-order filters will fall off faster, but
  53. the frequency at which the fall-off starts should be the same). See
  54. <a href="http://en.wikipedia.org/wiki/File:Lanczos-kernel.svg">Wikipedia: Lanczos-kernel.svg</a>
  55. for an illustration. If both graphs were drawn on the same axes, they
  56. would have roughly the same shape, but the a=3 window would have a longer
  57. tail. By scaling the axes to the same width, the a=3 window has a narrower
  58. central lobe.
  59. <p>
  60. For longitude-latitude locations, the interpolation algorithm is based on
  61. degree fractions, not on the absolute distances between cell centers. Any
  62. attempt to implement the latter would violate the integrity of the
  63. interpolation method.
  64. <h2>SEE ALSO</h2>
  65. <em>
  66. <a href="g.region.html">g.region</a>,
  67. <a href="r.mfilter.html">r.mfilter</a>,
  68. <a href="r.resample.html">r.resample</a>,
  69. <a href="r.resamp.interp.html">r.resamp.interp</a>,
  70. <a href="r.resamp.rst.html">r.resamp.rst</a>,
  71. <a href="r.resamp.stats.html">r.resamp.stats</a>
  72. </em>
  73. <p>
  74. Overview: <a href="https://grasswiki.osgeo.org/wiki/Interpolation">Interpolation and Resampling</a> in GRASS GIS
  75. <h2>AUTHOR</h2>
  76. Glynn Clements
  77. <p><i>Last changed: $Date$</i>