LinearFilter derived class for Lanczos filtering
For notation and mathematical details, see Duchon, 1979, Journal of Applied
Meteorology, Lanczos filtering in one and two dimensions, volume 18,
pages 1016-1022.
|
Methods
|
|
__init__
getcoefs
prettyprintcoefs
|
|
|
__init__
|
__init__ (
self,
filtertype='bp',
fc1=0.0,
fc2=0.5,
n=None,
)
Constructor for the class LanczosFilter
Initialize the variables to hold the needed data
The filter works as follows, first, it gets the
coefficients to be used to weight each record performing a
recursive filtering on the impulse response function
Next, filter the records by means of a running buffer which is
weighted using the weights... and that's all
Optional Arguments:
-
filtertype
- String identifying the filter type.
lp for
low-pass filter, hp for high-pass filter and
bp for band-pass filter.
-
fc1
- First cutoff frequency (in inverse time steps).
Defaults to 0.0
-
fc2
- Second cutoff frequency (in inverse time steps).
Defaults to 0.5
-
n
- Number of points for the filter. This number of points will
be missed at the beginning and at the end of the raw record.
Defaults to a number a 30% higher than that recomended for
secure band-pass filtering by Duchon (1979).
NOTE: With the default arguments the filter does NOT filter at all.
It performs a band-pass filtering for all frequencies.
NOTE 2: If the first and second cutoff frequencies are different
band-pass filtering is assumed even though lp or hp filtertype were
selected.
|
|
|
getcoefs
|
getcoefs ( self )
Filter coefficients
|
|
|
prettyprintcoefs
|
prettyprintcoefs ( self )
Pretty-print the coefficients
|
|