I am getting this error despite having signal processing tool downloaded. very limited coding / matlab knowledge so any guidance appreciated!!
6 次查看(过去 30 天)
显示 更早的评论
Error using butter
Expected Wn to be finite.
Error in butter>butterImpl (line 81)
validateattributes(Wn,{'numeric'},{'vector','real','finite','nonempty'},'butter','Wn');
Error in butter (line 59)
[varargout{1:nargout}] = butterImpl(n,Wn,varargin{:});
Error in Kinetisense_Validation_2 (line 344)
[D1 D2] = butter(order_D, fc_D/(Fs/2), 'low'); %Low pass filter for D with 1st order
回答(1 个)
Zuber
2023-4-12
Hi,
I understand that you are getting an error,
Error using butter.
Expected Wn to be finite.
As per the error message, the input argument 'Wn' of the butter function needs to be finite while it is not. Specifically, there is an error in the code line where ‘butter’ function with arguments (order_D, fc_D/(Fs/2), 'low') is called.
The general syntax of ‘butter’ function is as follows:
[b,a] = butter(n,Wn,ftype)
where
- n: Filter Order,
- Wn: Cutoff Frequency
- ftype : Filter Type.
It is used to design a lowpass, highpass, bandpass, or bandstop Butterworth filter, depending on the value of ‘ftype’.
There are certain checks you can do to rectify the issue:-
- Ensure that ‘order_D’, ‘fc_D’ and ‘Fs’ are well defined. 'order_D’ should be a positive integer while ‘fc_D’ and ‘Fs’ need to be positive real numbers.
- Check that the value of fc_D/(Fs/2) is finite. If Fs/2 is zero or fc_D is not specified properly, the resulting value may be NaN or Inf which could cause the ‘butter’ function to throw an error.
For any further information on ‘butter’ function, please refer to the documentation www.mathworks.com/help/signal/ref/butter.html
I hope it helps.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Robust Control Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!