Transfer function of a filter

2 ビュー (過去 30 日間)
i Venky
i Venky 2011 年 10 月 11 日
I want to plot the transfer function of a butterworth filter and the frequency should be in hertz.
I tried this code
[n wn]=buttord(2*pi*3/2000,2*pi*300/2000,3,20);
[b a]=butter(n,wn,'low');
[h w]=freqz(b,a);
stem(w,20*log10(abs(h)));
But what is 'w'? I want to represent the frequency in Hz. What should I do now so that I get -3 db attenuation at 3Hz and -20 db attenuation at 300 Hz in the graph.

回答 (3 件)

Wayne King
Wayne King 2011 年 10 月 11 日
[h w]=freqz(b,a,[],Fs);
where Fs is your sampling frequency.
  2 件のコメント
Wayne King
Wayne King 2011 年 10 月 11 日
Of course you might want to call the output, f.
[h,f] = freqz(b,a,[],Fs);
i Venky
i Venky 2011 年 10 月 11 日
So according to my problem Fs is 2000. But when I tried it I didn't get 20 db attenuation at 300Hz.

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


Wayne King
Wayne King 2011 年 10 月 11 日
I recommend that you use fdesign.lowpass
d = fdesign.lowpass('Fp,Fst,Ap,Ast',290,300,0.5,20,2000);
Hd = design(d,'butter');
fvtool(Hd);
zoom in on 300 Hz and see what you think.

i Venky
i Venky 2011 年 10 月 11 日
Okay. If I do like this,is it possible to multiply this transfer function with the frequency domain of the input signal and do such kind of operations?
  1 件のコメント
Wayne King
Wayne King 2011 年 10 月 11 日
[h,f] = freqz(Hd);

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

カテゴリ

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