Graphing 3D Z-Transform in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter enceladus_
  • Start date Start date
  • Tags Tags
    3d Matlab Z-transform
Click For Summary

Discussion Overview

The discussion revolves around the process of graphing the Z-Transform in 3D using MATLAB. Participants explore methods for both calculating the Z-Transform and visualizing it in a three-dimensional format, with a focus on specific functions and coding techniques within MATLAB.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant inquires about the method to graph the Z-Transform in 3D, expressing a desire for a specific visual output.
  • Another participant asks whether the inquiry is about plotting in 3D or calculating the Z-Transform, suggesting the use of the Symbolic Math Toolbox for helpful functions.
  • A participant confirms their focus is on plotting in 3D and mentions their lack of experience with the functions meshgrid and surf, while also noting they have access to the Symbolic Toolbox.
  • A code snippet is shared by a participant, which includes the use of meshgrid and surf, but it encounters an error due to an undefined function 'test'.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the best approach to graph the Z-Transform in 3D, as there are varying levels of experience with MATLAB functions and some uncertainty about the necessary steps.

Contextual Notes

The discussion includes a code snippet that raises an error, indicating potential issues with function definitions and dependencies on specific MATLAB toolboxes. There is also uncertainty about the necessity of using both meshgrid and surf for the desired plotting.

Who May Find This Useful

This discussion may be useful for MATLAB users interested in advanced plotting techniques, particularly those working with the Z-Transform in signal processing or related fields.

enceladus_
Messages
58
Reaction score
0
Does anyone know how I might go about graphing the Z-Transform in 3D? It want it to look something like the picture below.
 

Attachments

  • ztransform.jpg
    ztransform.jpg
    22.2 KB · Views: 930
Physics news on Phys.org
Are you interested in knowing how to plot in 3D, or how to calculate the z transform? Do you have access to Symbolic Math Toolbox? If so, there are some helpful functions in it for doing z transforms. I don't think core MATLAB has a function for it but there is probably something on the file exchange. This may also be relevant:

http://www.mathworks.com/help/matlab/data_analysis/filtering-data.html#bqm3i7m-5

Otherwise, the plot you're looking at probably came from using meshgrid() and surf(), then overlaying the unit circle values with a call to plot3().
 
  • Like
Likes   Reactions: 1 person
More so plotting in 3d, I've never used meshgrid or surf before. I do have access to the Symbolic Toolbox. Would I have to use BOTH meshgrid() and surf()?
 

Attachments

  • vh11.jpg
    vh11.jpg
    30.2 KB · Views: 1,334
Last edited:
I have found this code from another site:

xmin = -2; xstep = 0.1; xmax = 2;
ymin = -2; ystep = 0.1; ymax = 2;
x = xmin : xstep : xmax;
y = ymin : ystep : ymax;
[X,Y] = meshgrid(x,y);

Z = 10*log10(abs(test(X + j*Y))); % here is the call to the function to be plotted.
Z2 = abs(X + j*Y) <=1; % Here is the mask the zeros things outside the unit circle

hold off
surf(X, Y, Z) % Draw and label the surface
colormap(cool)
xlabel('Re')
ylabel('Im')

ww=-pi:pi/25:pi;

[xn, yn, zn] = freqMove(0, ww);
hold on
plot3(xn, yn, zn)

It generates the following error:

Undefined function 'test' for input arguments of type 'double'.

Error in hmm (line 7)
Z = 10*log10(abs(test(X + j*Y))); % here is the call to the function to be plotted.
 

Attachments

  • figure2.gif
    figure2.gif
    6.5 KB · Views: 1,181
Last edited:

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
Replies
6
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K