"butter" filter: Undefined function

조회 수: 15 (최근 30일)
Emanuele Giartosio
Emanuele Giartosio 2017년 5월 5일
댓글: Emanuele Giartosio 2017년 5월 9일
Hi everyone,
I'm having some problems in creating a lowpass butter filter. I am using the function below:
fc = forceplatesInfo.frequency; % forceplates
[b,a] = butter(4,15/(fc/2),'low');
Where:
- fc is the frequency of the force plates (in this case it is 2000Hz)
It is a simple code but I keep getting this error: "Undefined function 'butter' for input arguments of type 'double'".
I used the matlab tutorial and i still can't figure this out.
Any ideas? Thanks Emanuele

채택된 답변

Jan
Jan 2017년 5월 5일
편집: Jan 2017년 5월 8일
The error message means, that you do not have the Signal Processing Toolbox, which is required for the butter command. But you can calculate the parameters for a lowpass Butterworth filter by your own:
function [B, A] = ButterLow(n, W)
V = tan(W * 1.5707963267948966);
Q = exp((1.5707963267948966i / n) * ((2 + n - 1):2:(3 * n - 1)));
Sp = V * Q;
% Bilinear transform:
P = (1 + Sp) ./ (1 - Sp);
Z = repmat(-1, size(P));
G = real(V ^ length(Q) / prod(1 - Sp));
% From Zeros, Poles and Gain to B (numerator) and A (denominator):
B = G * real(poly(Z'));
A = real(poly(P));
  댓글 수: 1
Emanuele Giartosio
Emanuele Giartosio 2017년 5월 9일
Thanks! The Signal Processing Toolbox trial was expired 2 day ago and I didn't notice it.

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

추가 답변 (1개)

Honglei Chen
Honglei Chen 2017년 5월 5일
Do you have Signal Processing Toolbox installed? You can find out by typing
>> ver
in the command window.
HTH
  댓글 수: 1
Emanuele Giartosio
Emanuele Giartosio 2017년 5월 9일
Thanks! The Signal Processing Toolbox trial was expired 2 day ago and I didn't notice it.

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

카테고리

Help CenterFile Exchange에서 Analog Filters에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by