Since I have been in third year, I have been dealing with complex signals. Now real signals are always easy to visualize but the same is not the case with complex signals. Since a large portion of my work involves getting a feeling of what is going on, trying to see the signals from an engineer's eye is always considered a better approach than simply doing algebraic juggling.
The most logical method that comes to mind is expanding of the real axis into an entire plane facing the time axis. A complex exponential like exp(jwt) will then appear to be a spiraling staircase. An extremely useful matlab program which takes in a complex signal and outputs a 3D complex plot is given below:
function complexplot(x,t,connect)
% This function plots complex sequences in 3D line format
% x is the given complex sequence (1D)
% t is the optional time axis. By default t = 1:length(x)
% put connect = 1 if you want to connect the plot with the axis
%% Input validation
if (nargin <>
connect = 0;
end
if (nargin <2)
t = 1:length(x);
end
%% plotting 3D
x1 = real(x);
y1 = imag(x);
axisline = zeros(size(t));
plot3(axisline,t,axisline,'k');
hold on
plot3(x1,t,y1);
%% Connect lines
if(connect ==1)
for k = 1:length(t)
plot3([x1(k) 0],[t(k) t(k)],[y1(k) 0],'r')
end
end
view([90 0])
hold off
No comments:
Post a Comment