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 9191x1 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?

댓글 수: 3

Stephan
Stephan 2019년 2월 10일
What is the value of fs?
TStudentTe
TStudentTe 2019년 2월 10일
fs = 1.014066727576877e+02
Abdul Manan Dar
Abdul Manan Dar 2021년 5월 25일
Check for NaN entries.
S = sparse(x);

댓글을 달려면 로그인하십시오.

 채택된 답변

Star Strider
Star Strider 2019년 2월 10일

1 개 추천

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.

추가 답변 (0개)

카테고리

태그

질문:

2019년 2월 10일

댓글:

2021년 5월 25일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by