How to find out roll-off from magnitude response of filter in matlab

回答 (1 件)

Chunru
Chunru 2021 年 9 月 23 日
fs = 2000;
[b,a] = butter(9,400/(fs/2));
[h, f] = freqz(b,a,16384,fs);
h = 20*log10(abs(h));
[~, i3db] = min(abs(h - 10*log10(1/2)));
f3db = f(i3db);
plot(f, h);
xline(f3db)
grid on
ylim([-60 0])

8 件のコメント

632541
632541 2021 年 9 月 23 日
Hi Chunru ,
Thank you for your response
What is the rolloff is it 20dB/decade or someother in your design
632541
632541 2021 年 9 月 23 日
How do I calculate roll-off rate from the plot
Chunru
Chunru 2021 年 9 月 23 日
How do you define roll-off rate?
632541
632541 2021 年 9 月 23 日
Slope of the line in transition band.
dB/decade or dB/ octave.
Is it not the one
Chunru
Chunru 2021 年 9 月 23 日
In programming, you need to define the quantity that is computable. Where is the "line" from which point to which point? Do you want to compute the slope at certain point or certain type of average slope over certain range? If there is no definition given, it is up to everyone to give a different version.
632541
632541 2021 年 9 月 23 日
From which point to which point not decided. In the general design it is from pass-band frequency to stopband frequency. As I can only cutoff stopband and pass band frequencise are not confirmed .
Can you please tell for your design
Chunru
Chunru 2021 年 9 月 23 日
Shouldn't you come out your design first?
632541
632541 2021 年 9 月 23 日
Please have a look at it
fs= 50e3;
cutOff= 5;
order = 3;
t=0:1/fs:1-(1/fs);
Sig=sin(2*pi*200*t)+sin(2*pi*150*t);
noise=2*rand(size(t))+sin(2*pi*1*t)+sin(2*pi*5*t)+sin(2*pi*3*t)+sin(2*pi*7*t)+sin(2*pi*11*t)+sin(2*pi*0.5*t)+sin(2*pi*0.2*t);
noisySig = Sig+noise;
wn= 2*cutOff/fs;
[B, A] = butter(order,wn,'high');
freqz(B,A); %%Freq response of filter
filteredData=filtfilt(B,A,noisySig);

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

カテゴリ

ヘルプ センター および File ExchangeLinear Model Identification についてさらに検索

質問済み:

2021 年 9 月 23 日

コメント済み:

2021 年 9 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by