フィルターのクリア

How to deal with this error??

17 ビュー (過去 30 日間)
Good mind
Good mind 2017 年 5 月 4 日
コメント済み: Star Strider 2017 年 5 月 7 日
A model of the surface EMG signal is created by filtering a white gaussian noise, using a shaping filter H(f). this filter has low cut-off freq=60hz and high cut-off freq=120hz. this is my code but i don't know how to deal with Undefined function 'designfilt' for input arguments of type 'char'.
clear all;
subplot(322);
load nnoise.m;
plot(nnoise,'k');
% design shaping filter
bpFilt = designfilt('bandpassfir',...
'CutoffFrequency1',60,'CutoffFrequency2',120, ...
'SampleRate',2000);
subplot(323);
W = filter(bpFilt,nnoise);
plot(W,'k');title ('EMG');
  2 件のコメント
Adam
Adam 2017 年 5 月 4 日
Do you have the Signal Processing toolbox? If not then you will not have this function.
Good mind
Good mind 2017 年 5 月 4 日
So what is the solution? how can i get it

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2017 年 5 月 4 日
The designfilt function was introduced in the R2014a version of the Signal Processing Toolbox.
If you have an earlier version of the Signal Processing Toolbox, this filter will work, since all the functions were introduced prior to R2006a:
Fs = 2000;
notch_frq = [50 60 120 130];
mags = [0 1 0];
devs = [0.05 0.01 0.05];
[n,Wn,beta,ftype] = kaiserord(notch_frq,mags,devs,Fs);
n = n + rem(n,2);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'scale');
figure(1)
freqz(hh, 1, 2^17, Fs)
Use the filtfilt function to do the actual filtering of your signal.
See the documentation on the various functions to understand how to use them.
  13 件のコメント
Good mind
Good mind 2017 年 5 月 7 日
Mr. Strider I would like to thank you very much. you alerted me to important informations. I hope that everyone will benefit from these discussions, especially beginners.
2^17 is from where?
Star Strider
Star Strider 2017 年 5 月 7 日
As always, it is my pleasure to help.
The ‘2^17’ is the length of the Fast Fourier Transform that freqz uses to compute the transfer function. I apologise for not explaining that earlier.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFilter Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by