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

조회 수: 35 (최근 30일)
632541
632541 2021년 9월 23일
댓글: 632541 2021년 9월 23일
How to find out roll-off from magnitude response of filter in matlab?
This is from doc frequency response of matlab site

답변 (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
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);

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

카테고리

Help CenterFile Exchange에서 PHY Components에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by