How to use freqz to plot filter frequency response?
조회 수: 56 (최근 30일)
이전 댓글 표시
Christopher Saltonstall
2020년 4월 2일
댓글: Kritika Gupta
2023년 3월 2일
I used systemIdentification to calculate the transfer function of my filter (see first figure) and then saved the idtf variable (attached). However, when I load the idtf variable and use freqz to plot the frequency response it looks very different (see second figure).
%number of frequencies
n = 50000;
%sampling frequency
f_sample = 2e8; %Hz
%transfer function numerator
b = [9.875702215802889e+04,6.459317537238607e+09];
%transfer function denominator
a = [1,1.844463395715939e+05,5.691593683410083e+09];
%calculate tranfer function response
[h_calc, w_calc] = freqz(b,a,n,f_sample);
%plot transfer function
figure(3)
plot(w_calc,h_calc)
set(gca,'XScale','log')
set(gca,'YScale','log')
xlabel('Frequency (Hz)')
ylabel('Filter Response')
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!