timeseries.idealfilter
timeseries: ts = idealfilter (ts, intervals, type)
timeseries: ts = idealfilter (ts, intervals, type, ind)
Filter a series with an ideal filter.
ts = idealfilter (ts, intervals, type)
removes the mean of each column of the data, then keeps the frequencies
in intervals (type 'pass') or removes them
('notch') through the discrete Fourier transform. The mean is
not added back. intervals holds one frequency interval per row,
[lo, hi], in cycles per unit of
TimeInfo.Units; a frequency f is in it when
lo < f <= hi. NaN values are first
filled by the interpolation method of the series, so the data must not
begin or end with one. A series with irregular times is resampled
first, by its interpolation method, onto as many uniformly spaced times
from its first time to its last, which it keeps. Every other property
is kept.
ts = idealfilter (ts, intervals, type,
ind) filters only the columns ind of the data, or its rows
where IsTimeFirst is false.
The data must be double or single, of two dimensions.
MATLAB returns complex NaN throughout for data that begins or
ends with NaN, keeps the mean of a series of fewer than three
samples, and reads only the first and last columns of
intervals.
See also: timeseries.filter, timeseries.detrend
Source Code: timeseries
idealfilter keeps ('pass') or removes ('notch') the frequencies in the intervals given, in cycles per unit of time. The result is centred on zero.
t = (0:99)'; ts = timeseries (sin (2 * pi * 0.02 * t) + 0.5 * sin (2 * pi * 0.3 * t), t); s = idealfilter (ts, [0, 0.1], 'pass'); max (abs (s.Data - sin (2 * pi * 0.02 * t)))
ans = 3.3307e-15