0
$\begingroup$

How can I highpass/lowpass a set of data, where the sample rate is not fixed, but is the first column of data, ie when data = {{t1,x1},{t2,x2},...{tN,xN}}?

$\endgroup$
  • $\begingroup$ There are many ways you might do this e.g. interpolate to obtain evenly spaced data first. However, one would need to know more about you data before recommending a way forward. $\endgroup$ – mikado Sep 9 '19 at 21:09
1
$\begingroup$

One can do it by using a TimeSeries object:

t = Accumulate[RandomReal[{0, 1}, 100]]; (* generate random times *)
y = RandomReal[{-5, 5}, Length[t]];   (* generate random values *)
ts = TimeSeries[y, {t}];     (* generate timeseries object *)
ts2 = LowpassFilter[ts, 0.6];    (* perform a lowpass filter *)
ListPlot[{ts, ts2}, Joined -> True]   (* show both series *)

giving:

timeseries comparison

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.