필터 지우기
필터 지우기

How to plot the magnitude and phase of a given transfer function(z-domain)?

조회 수: 157 (최근 30일)
Daniel Ramirez
Daniel Ramirez 2015년 11월 27일
편집: Arkadiy Turevskiy 2024년 6월 18일
I tried approacting this by doing the LTI function:
>> z=tf('z'); >> H=0.203*[(1-z^-1)*(1-0.2743*z^-1+z^-2)]/[(1+0.2695*z^-1)*(1+0.4109*z^-1+0.6758*z^-2)]
H =
0.203 z^8 - 0.2587 z^7 + 0.2587 z^6 - 0.203 z^5
-----------------------------------------------
z^8 + 0.6804 z^7 + 0.7865 z^6 + 0.1821 z^5
I don't even know if I'm approacting this right, please I need help in doing this.
  댓글 수: 1
Daniel Ramirez
Daniel Ramirez 2015년 11월 28일
편집: Daniel Ramirez 2015년 11월 28일
I think I did it?
L=1000;
dw=2*pi/L;
w = -pi:dw:pi-dw;
aa=[1,0.6804,0.953486,0.182128];
bb=[0.2031,-0.2588,0.2588,-0.2031];
HH=freqz(bb,aa,w);
mag=abs(HH);title('Magnitude response')
figure
phase=angle(HH);title('Phase response')
plot(w,mag)
plot(w,phase)
The next step that they want me to do is plot the impulse response. So anyone know how to go from the freq domain to the time domain(n)? This is what I'm struggling the most, any help would be appreciated.

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

답변 (2개)

Aik-Siong Koh
Aik-Siong Koh 2021년 7월 8일
편집: Arkadiy Turevskiy 2024년 6월 18일
The following links show how to get frequency domain plots from a transfer function.
The following links show how to get impulse response from transfer function.
The following links show how to get time domain from frequency domain.
Additional comments from Siddharth Jawahar at MathWorks on 6/18/2024
You will need to define your transfer function using the ‘tf’ function which is also suitable for discrete-time systems by setting the ‘z’ variable and specifying the sample time. Then for the magnitude and the phase plots you can use the ‘bode’ plot command.
See the MATLAB code example below:
% Numerator and Denominator coefficients
b = 0.2031 * conv([1, -1], [1, -0.2743, 1]); % Convolution of numerator parts
a = conv([1, 0.2695], [1, 0.4109, 0.6758]); % Convolution of denominator parts
% Sample time - Adjust based on your specific requirements
Ts = 1;
% Create a discrete-time transfer function model
H = tf(b, a, Ts, 'Variable', 'z^-1');
% Plot the Bode plot
figure;
bode(H);
title('Bode Plot of H(z)');
grid on;

ANNALURU R R SREENIVASA MURTHY
ANNALURU R R SREENIVASA MURTHY 2021년 11월 15일
편집: ANNALURU R R SREENIVASA MURTHY 2021년 11월 15일
You can use 'imp' function to plot impulse response.

카테고리

Help CenterFile Exchange에서 Frequency-Domain Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by