function plotperdisc(x) % FUNCTION: plotperdisc Part of DPWT Toolbox % % SYNOPSIS: plotperdisc(X) % % DESCRIPTION: Plot a sequence over the discrete circle. The sequence % is assumed to be normalized so that its max and min % values lie between -1 and 1. The sequence is plotted % around a circle. Three circles indicate the -1 value % 0 value and 1 value. % % NOTE: X is assumed to be prescaled to be between -1 and 1 % % EXAMPLE: plotperdisc(sin(0:.1:2*pi)) % AUTHOR: Neil Getz % DATE: 3-30-94 if(nargin ~= 1), help plotperdisc, return; end; GAP = 1/7; %size of space between zero circle and 1 circle xx = GAP*row(x); lenxx = length(xx); theta = 0: 2*pi/lenxx : 2*pi; st = sin(theta); ct = cos(theta); A = zeros(2*lenxx,2*lenxx); xy = zeros(2*lenxx,2); for i = 1:length(xx), xy(2*i - 1,:) = [st(i), ct(i)]*2*GAP; % from point xy(2*i,:) = [st(i), ct(i)]*(2*GAP+xx(i)); % to point A(2*i - 1, 2*i) = 1; A(2*i, 2*i - 1) = 1; end gplot(A,xy); axis('square'); axis('off'); hold on; if (length(theta)<300) longtheta = 0:2*pi/300:2*pi; longst = sin(longtheta); longct = cos(longtheta); plot(2*GAP*[longst, longst(1)], 2*GAP*[longct, longct(1)],'r-', ... 3*GAP*[longst, longst(1)], 3*GAP*[longct, longct(1)],'r-', ... 1*GAP*[longst, longst(1)], 1*GAP*[longct, longct(1)],'r-'); else, plot(2*GAP*[st, st(1)], 2*GAP*[ct, ct(1)],'r-', ... 3*GAP*[st, st(1)], 3*GAP*[ct, ct(1)],'r-', ... 1*GAP*[st, st(1)], 1*GAP*[ct, ct(1)],'r-'); end hold off;