Graphing 3D Z-Transform in MATLAB

In summary, the conversation discusses how to graph the Z-Transform in 3D, with the use of functions such as meshgrid(), surf(), and plot3(). It is suggested to use the Symbolic Math Toolbox, as it contains helpful functions for calculating z transforms. An example code is provided, but it generates an error due to an undefined function.
  • #1
enceladus_
58
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: 850
Physics news on Phys.org
  • #2
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 1 person
  • #3
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,262
Last edited:
  • #4
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,070
Last edited:
  • #5


I am familiar with the Z-Transform and its applications in signal processing and control systems. To graph the Z-Transform in 3D using MATLAB, you can use the "mesh" function. This function creates a mesh plot, where the Z-Transform values can be plotted in a three-dimensional space. You can specify the values of the independent variables (usually frequency and time) and the Z-Transform function itself, and the plot will show the values of the Z-Transform at different points in the 3D space.

To make the plot look similar to the picture provided, you can adjust the color and style of the plot using the "colormap" and "surf" functions in MATLAB. Additionally, you can use the "view" function to change the perspective of the plot and make it look like it is rotating in space.

It is important to note that the Z-Transform is a complex function, so the plot will have a real and imaginary component. Therefore, the 3D graph will have two surfaces, one for the real part and one for the imaginary part, which can be distinguished by using different colors or shading.

In conclusion, by using the appropriate functions in MATLAB, you can easily create a 3D graph of the Z-Transform that resembles the picture provided. It is a useful tool for visualizing the Z-Transform and gaining a better understanding of its behavior in three-dimensional space.
 

Related to Graphing 3D Z-Transform in MATLAB

1. What is the purpose of graphing 3D Z-Transform in MATLAB?

The purpose of graphing 3D Z-Transform in MATLAB is to visualize the complex-valued frequency response of a discrete-time signal. This allows for better understanding and analysis of the signal's behavior in the frequency domain.

2. How do I plot a 3D Z-Transform in MATLAB?

To plot a 3D Z-Transform in MATLAB, you will need to use the surf function. This function takes in the signal's frequency response as a matrix and creates a 3D surface plot that represents the magnitude and phase of the signal at each frequency.

3. What is the difference between a 2D and 3D Z-Transform plot?

A 2D Z-Transform plot only shows the magnitude or phase of the signal at a specific frequency, while a 3D Z-Transform plot shows both the magnitude and phase at all frequencies. This allows for a more comprehensive understanding of the signal's frequency response.

4. Can I customize the appearance of my 3D Z-Transform plot in MATLAB?

Yes, you can customize the appearance of your 3D Z-Transform plot in MATLAB by changing the color, scale, and other visual elements. You can also add labels and legends to make the plot more informative.

5. How can I use the 3D Z-Transform plot to analyze a signal?

The 3D Z-Transform plot can be used to analyze a signal by examining its frequency response, such as identifying peaks and dips in the magnitude and phase. This can provide insights into the signal's characteristics and help with signal processing and filtering.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
163
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
620
  • General Math
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
171
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Back
Top