MATLAB: Does ‘lowpass’ give me an error

filterlowpass

I have this line of code
y = lowpass(A,10/fs,fs);
and I get this error
Undefined function 'lowpass' for input arguments of type 'double'.
A is an arrray of doubles that is 9191×1 and fs is a double. I've tied using single() on all three of the arguments but this doesn't help. Also on the page for this function it says nothing about not allowing doubles.
Does anyone know what I am doing wrong?

Best Answer

The lowpass function was introduced in R2018a.
You can easily design your own filter if you are using 2017b or earlier.
A Prototype Lowpass Filter —
Ts = 0.001; % Sampling Interval (s)
Fs = 1/Ts; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = 0.001; % Passband Frequency For Lowpass Filter (Hz)
Ws = 0.0012; % Stopband Frequency For Lowpass Filter (Hz)
Rp = 1; % Passband Ripple For Lowpass Filter (dB)
Rs = 50; % Stopband Ripple (Attenuation) For Lowpass Filter (dB)
[n,Wp] = ellipord(Wp,Ws,Rp,Rs); % Calculate Filter Order
[z,p,k] = ellip(n,Rp,Rs,Wp); % Calculate Filter
[sos,g] = zp2sos(z,p,k); % Second-Order-Section For Stability
% A_Filt = filtfilt(sos,g,A); % Filter Signal
figure
freqz(sos, 2^14, Fs) % Filter Bode Plot (Check Performance)
set(subplot(2,1,1), 'Xlim',[0 1])
set(subplot(2,1,2), 'Xlim',[0 1])
Make necessary changes to the filter design parameters to create your filter. You may not need ‘Ts’ although you will need all the rest.
Related Question