How to get bode diagram from slx model.

조회 수: 1 (최근 30일)
Isao Okada
Isao Okada 2017년 8월 22일
댓글: Isao Okada 2017년 8월 25일
How to get the bode diagram of digital filter like a FIR LPF designed by Fdatool. That is written in M-file. X axis unit is Hz, not rad/s. Please show me its M file.

채택된 답변

Eeshan Mitra
Eeshan Mitra 2017년 8월 24일
The frequency response of a digital filter can be plotted using the "freqz" function in the Control System Toolbox.
Lets assume that a low-pass FIR filter is designed in the following manner with the following parameters in fdatool:
Filter Order: Minimum order
Fs = 1000 Hz
Fpass = 200 Hz
Fstop = 250 Hz
Apass = 1 dB
Astop =40 dB
The designed filter is then exported to the MATLAB Workspace as a filter object named 'Hd'.
The frequency response can be visualized by typing the following at the Command Window:
>> freqz(Hd)
Alternately if you want to plot the phase and magnitude separately, you can use output arguments with "freqz" to assign the frequency vector and the response for a specific sample frequency. For example:
>> fs = 1000;
>> [h,f] = freqz(Hd,501,fs); % 501 points
>> figure
>> subplot (2,1,1)
>> semilogx(f,20*log10(abs(h)))
>> subplot (2,1,2)
>> semilogx(f,angle(h))
  댓글 수: 3
Eeshan Mitra
Eeshan Mitra 2017년 8월 25일
On second thoughts magnitude response should be represented as real(h) rather than abs(h)
Isao Okada
Isao Okada 2017년 8월 25일
My previous comment was wrong. My operation to get Hd was incorrect. I tried once again. Maybe your procesure to get the bode diagram was correct. Bode diagram method of the digital filter out of Fdatool will be refference for me. Thank you very much. But frequency includes 0Hz. Why?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 フィルターの設計에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!