# Why do I get this error message from LowpassFilter?

I have a list of numbers data of length 10^7. I have values

rate = 100000.;
cutoff = 2000.;


I try to low pass filter with

LowpassFilter[data
, Quantity[cutoff, "Hz"]
, SampleRate -> Quantity[rate, "Hz"]]


I get the error message:

LowpassFilter::srate: The value of sample rate should be a positive machine-sized integer number or a Quantity representing frequency instead of \$Failed.


But if I replace rate with its value, it works fine.

LowpassFilter[data, Quantity[cutoff, "Hz"],
SampleRate -> Quantity[100000., "Hz"]]


Why is that, and is there a workaround?

• The help file says the rate needs to be an integer. Your rate 100000. is a real number. Use an integer 100000 – bill s Jun 21 at 19:47
• Your first version works for me on Mathematica 12.3. Are you on an earlier version? – mikado Jun 21 at 20:40
• What help file is that? The error message says "The value of sample rate should be a positive machine-sized integer number or a Quantity representing frequency" Mine is the latter. Note also that LowpassFilter does not complain when you use a real number in the quantity. See my second example. – abwatson Jun 21 at 20:42
• I am on 12.3 for Mac OS. – abwatson Jun 21 at 20:43
• The first version works for me on 12.2 on Windows 10. – Derek H Jul 23 at 13:35

LowpassFilter[data, Quantity[cutoff, "Hz"],