필터 지우기
필터 지우기

How to plot magnitude and phase spectrum of the function

조회 수: 12 (최근 30일)
MUHAMMAD RAHMAT ASMAT
MUHAMMAD RAHMAT ASMAT 2020년 6월 16일
답변: Usman 2023년 12월 4일
Hye i really confuse on how much method to write the code to plot magnitude and phase. Below is my function.
X(z)=z / (z-1)^2
Any idea how to start beside plot?

채택된 답변

Star Strider
Star Strider 2020년 6월 16일
Try this:
z = tf('z');
X = z / (z-1)^2;
bode(X)
.
  댓글 수: 6
MUHAMMAD RAHMAT ASMAT
MUHAMMAD RAHMAT ASMAT 2020년 6월 16일
Hye sorry to bother again, but i just raelize that after i amplify the signal and try to z transform it, it give me the ans, but i think it was not correct. Maybe my code is not accurate or vise versa.
>> d=decimate(p2,500);
>> amp=10*d;
>> syms amp %from here i think my z transform it not valid
>> f=amp;
>> ztrans(f)
ans =
z/(z - 1)^2
i need to calculate the spectrum of the decimated signal using Z-transform technique
Star Strider
Star Strider 2020년 6월 16일
I have no idea what you are doing, and I cannot run your code. I cannot imagine how you get a transfer function straight out of a decimated signal, or what ‘calculate the spectrum of the decimated signal using Z-transform technique’ refers to.
If you are estimating a transfer function from the input to and output of a discrete (sampled) system in either the time-domain or frequency-domain, you can either use the System Identification Toolbox functions (there are several that could apply), or the Signal Processing Toolbox invfreqz function. You will need to experiment with whatever functions you choose to use to get the result you want.
.

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

추가 답변 (2개)

Deepak Gupta
Deepak Gupta 2020년 6월 16일
Star Strider has given the answer but just FYI:
X = tf([1 0], [1 -2 1]);
bode(X), grid
This will work too.
You can know more about bode plots here:
  댓글 수: 3
Star Strider
Star Strider 2020년 6월 16일
Note that this creates a s-domain function, not a z-domain function.
Deepak Gupta
Deepak Gupta 2020년 6월 16일
It creates z-tranfer too. If we give sampling period 0.1s then you will get same result. i.e. tf([1 0], [1 -2 1], 0.1)

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


Usman
Usman 2023년 12월 4일
Validate magnitude and phase spectrum for x(t) = e−atu(t) for a > 1 and 0 < a < 1. write code for matlab

카테고리

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