How do you make sense of the scale of "time" and "sampling" when using LowpassFilter
and SampleRate
?
Given the test data with components at 1Hz and 5Hz
data1 = Array[N[Sin[2 Pi #] + Sin[2 Pi 5 #]] &, 100, {-1, 1}];
I expect to apply a low-pass filter at 2Hz and 10Hz
data2 = N @ LowpassFilter[data1, 2, SampleRate -> 50];
data3 = N @ LowpassFilter[data1, 10, SampleRate -> 50];
And see that data3
contains a significant part of the 5Hz component.
What am I doing wrong here?
In Win7 64 and Mathematica 10.2 and 10.1 I get
ListPlot[
{
data1
, data2
, data3
}
, Joined -> True
, PlotRange -> {-2, 2}
, PlotStyle -> {Gray, Red, Blue}
]
while versions 9.0 and 10.0 behave differently.
Should I understand that these new versions have a bug?
Version10
tag then? $\endgroup$data2 = N@LowpassFilter[data1, Quantity[2, "Hertz"], SampleRate -> 50]; data3 = N@ LowpassFilter[data1, Quantity[10, "Hertz"], SampleRate -> 50];
and that looks to give the correct result. $\endgroup$