How to plot magnitude and phase spectrum of the function
27 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Star Strider
2020-6-16
Try this:
z = tf('z');
X = z / (z-1)^2;
bode(X)
.
6 个评论
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
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 个评论
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
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!