how to plot phase and frequency

How can I plot the gain magnitude and phase versus frequency for 0<=f<=10  kHz knowing that Av(f)=1+K e^(j*2*pi* f*t_d). Given K = 0.5 and t_d =1  ms.
I am not sure how to even start to set it up, i will appreciate some help.

답변 (1개)

Voss
Voss 2024년 3월 7일

1 개 추천

K = 0.5;
t_d = 0.001; % 1 ms
f = linspace(0,10000,1000); % 1000 f values from 0 to 10 kHz
Av = 1+K*exp(-1j*2*pi*f*t_d);
Av_mag = abs(Av);
Av_phase = angle(Av);
figure
subplot(2,1,1)
plot(f,Av_mag)
subplot(2,1,2)
plot(f,Av_phase)

댓글 수: 2

Valentina
Valentina 2024년 3월 7일
thank you so much!
Voss
Voss 2024년 3월 7일
You're welcome! Any questions, let me know. Otherwise, please "Accept" this answer. Thanks!

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

카테고리

질문:

2024년 3월 7일

댓글:

2024년 3월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by