1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>J. Filtering of data in GMT</TITLE>
<META NAME="description" CONTENT="J. Filtering of data in GMT">
<META NAME="keywords" CONTENT="GMT_Docs">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="GMT_Docs.css">
<LINK REL="next" HREF="node132.html">
<LINK REL="previous" HREF="node130.html">
<LINK REL="up" HREF="GMT_Docs.html">
<LINK REL="next" HREF="node132.html">
</HEAD>
<BODY bgcolor="#ffffff">
<!--Navigation Panel-->
<A NAME="tex2html2886"
HREF="node132.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2880"
HREF="GMT_Docs.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2874"
HREF="node130.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2882"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2884"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2887"
HREF="node132.html">K. The GMT High-Resolution</A>
<B> Up:</B> <A NAME="tex2html2881"
HREF="GMT_Docs.html">The Generic Mapping Tools</A>
<B> Previous:</B> <A NAME="tex2html2875"
HREF="node130.html">I. Color Space </A>
  <B> <A NAME="tex2html2883"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2885"
HREF="node149.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION002500000000000000000">
J. Filtering of data in </A><A NAME="tex2html687"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A>
</H1>
<P>
The <A NAME="tex2html698"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> programs <A NAME="tex2html699"
HREF="../filter1d.html"><I><B>filter1d</B></I></A><A NAME="15417"></A> (for tables of data indexed
to one independent variable) and <A NAME="tex2html700"
HREF="../grdfilter.html"><I><B>grdfilter</B></I></A><A NAME="15426"></A> (for data
given as 2-dimensional grids) allow filtering of data by a
moving-window process. (To filter a grid by Fourier transform use
<A NAME="tex2html701"
HREF="../grdfft.html"><I><B>grdfft</B></I></A><A NAME="15435"></A>.) Both programs use an argument
<B>-F</B><IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img42.gif"
ALT="$<$"><I>type</I><IMG
WIDTH="29" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img189.gif"
ALT="$><$"><I>width</I><IMG
WIDTH="16" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img36.gif"
ALT="$>$"> to specify the type of
process and the window's width (in 1-d) or diameter (in 2-d).
(In <A NAME="tex2html702"
HREF="../filter1d.html"><I><B>filter1d</B></I></A><A NAME="15445"></A> the width is a length of the time or
space ordinate axis, while in <A NAME="tex2html703"
HREF="../grdfilter.html"><I><B>grdfilter</B></I></A><A NAME="15454"></A> it is the
diameter of a circular area whose distance unit is related to
the grid mesh via the <B>-D</B> option). If the process is a
median or mode estimator then the window
output cannot be written as a convolution and the filtering
operation is not a linear operator. If the process is a weighted
average, as in the boxcar, cosine, and gaussian filter types,
then linear operator theory applies to the filtering process.
These three filters can be described as convolutions with an
impulse response function, and their transfer functions
can be used to describe how they alter components in the input
as a function of wavelength.
<P>
Impulse responses are shown here for the boxcar, cosine, and
gaussian filters. Only the relative amplitudes of the filter
weights shown; the values in the center of the window have
been fixed equal to 1 for ease of plotting. In this way the
same graph can serve to illustrate both the 1-d and 2-d impulse
responses; in the 2-d case this plot is a diametrical
cross-section through the filter weights (Figure <A HREF="node131.html#fig:GMT_imp_res">J.1</A>).
<P>
<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_imp_res"></A><A NAME="15464"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure J.1:</STRONG>
Impulse responses for <A NAME="tex2html688"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> filters</CAPTION>
<TR><TD><IMG
WIDTH="538" HEIGHT="297" BORDER="0"
SRC="img190.gif"
ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_imp_res.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>
<P>
Although the impulse responses look the same in 1-d and 2-d,
this is not true of the transfer functions; in 1-d the transfer
function is the Fourier transform of the impulse response,
while in 2-d it is the Hankel transform of the impulse response.
These are shown in Figures <A HREF="node131.html#fig:GMT_x_tr_fns">J.2</A> and
<A HREF="node131.html#fig:GMT_r_tr_fns">J.3</A>, respectively. Note that in 1-d the boxcar transfer
function has its first zero crossing at <IMG
WIDTH="41" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img191.gif"
ALT="$f = 1$">, while in 2-d
it is around <IMG
WIDTH="53" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img192.gif"
ALT="$f \sim 1.2$">. The 1-d cosine transfer function
has its first zero crossing at <IMG
WIDTH="41" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img193.gif"
ALT="$f = 2$">; so a cosine filter needs
to be twice as wide as a boxcar filter in order to zero the same
lowest frequency. As a general rule, the cosine and gaussian
filters are ``better'' in the sense that they do not have the
``side lobes'' (large-amplitude oscillations in the transfer
function) that the boxcar filter has. However, they are
correspondingly ``worse'' in the sense that they require more
work (doubling the width to achieve the same cut-off wavelength).
<P>
<P>
<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_x_tr_fns"></A><A NAME="15472"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure J.2:</STRONG>
Transfer functions for 1-D <A NAME="tex2html691"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> filters</CAPTION>
<TR><TD><IMG
WIDTH="538" HEIGHT="298" BORDER="0"
SRC="img194.gif"
ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_x_tr_fns.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>
<P>
One of the nice things about the gaussian filter is that its
transfer functions are the same in 1-d and 2-d. Another nice
property is that it has no negative side lobes. There are many
definitions of the gaussian filter in the literature (see page
7 of Bracewell<A NAME="tex2html694"
HREF="footnode.html#foot15408"><SUP>J.1</SUP></A>). We
define <IMG
WIDTH="14" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img195.gif"
ALT="$\sigma$"> equal to 1/6 of the filter width, and the impulse
response proportional to <!-- MATH
$\exp[-0.5(t/\sigma)^2)$
-->
<IMG
WIDTH="112" HEIGHT="35" ALIGN="MIDDLE" BORDER="0"
SRC="img196.gif"
ALT="$\exp[-0.5(t/\sigma)^2)$">. With this
definition, the transfer function is <!-- MATH
$\exp[-2(\pi\sigma f)^2]$
-->
<IMG
WIDTH="103" HEIGHT="35" ALIGN="MIDDLE" BORDER="0"
SRC="img197.gif"
ALT="$\exp[-2(\pi\sigma f)^2]$">
and the wavelength at which the transfer function equals 0.5 is
about 5.34 <IMG
WIDTH="14" HEIGHT="29" ALIGN="MIDDLE" BORDER="0"
SRC="img195.gif"
ALT="$\sigma$">, or about 0.89 of the filter width.
<P>
<P></P>
<DIV ALIGN="CENTER"><A NAME="fig:GMT_r_tr_fns"></A><A NAME="15480"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure J.3:</STRONG>
Transfer functions for 2-D (radial) <A NAME="tex2html695"
HREF="http://www.soest.hawaii.edu/gmt"><B>GMT</B></A> filters</CAPTION>
<TR><TD><IMG
WIDTH="538" HEIGHT="298" BORDER="0"
SRC="img198.gif"
ALT="\begin{figure}\centering\epsfig{figure=eps/GMT_r_tr_fns.eps}\end{figure}"></TD></TR>
</TABLE>
</DIV><P></P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html2886"
HREF="node132.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.gif"></A>
<A NAME="tex2html2880"
HREF="GMT_Docs.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.gif"></A>
<A NAME="tex2html2874"
HREF="node130.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.gif"></A>
<A NAME="tex2html2882"
HREF="node1.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.gif"></A>
<A NAME="tex2html2884"
HREF="node149.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.gif"></A>
<BR>
<B> Next:</B> <A NAME="tex2html2887"
HREF="node132.html">K. The GMT High-Resolution</A>
<B> Up:</B> <A NAME="tex2html2881"
HREF="GMT_Docs.html">The Generic Mapping Tools</A>
<B> Previous:</B> <A NAME="tex2html2875"
HREF="node130.html">I. Color Space </A>
  <B> <A NAME="tex2html2883"
HREF="node1.html">Contents</A></B>
  <B> <A NAME="tex2html2885"
HREF="node149.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Paul Wessel
2001-04-18
</ADDRESS>
</BODY>
</HTML>
|