
function test_seo
% Recreates the figure 2 of martucci paper

% ------- test_seo.m ---------------------------------------
% Marios Athineos, marios@ee.columbia.edu
% http://www.ee.columbia.edu/~marios/
% Copyright (c) 2004-2005 by Columbia University.
% All rights reserved.
% ----------------------------------------------------------

type = {'WSWS','HSHS','WSWA','HSHA', ...
        'WAWA','HAHA','WAWS','HAHS', ...
        'WSHS','HSWS','WSHA','HSWA', ...
        'WAHA','HAWA','WAHS','HAWS'};

% Make alla the sequences we are going to test
x = {[1:5], ...
     [1:4], ...
     [1:4], ...
     [1:4], ...
     [2:4], ...
     [1:4], ...
     [2:5], ...
     [1:4], ...
     [1:4], ...
     [1:4], ...
     [1:4], ...
     [1:3], ...
     [2:4], ...
     [1:3], ...
     [2:4], ...
     [1:4]};

% Makes figure larger for any resolution
% for full-screen do [0 0 1 1]
figure('units','normalized','outerposition',[.1 .1 .8 .8]);

for I=1:length(type)
    subplot(4,4,I);
    
    % Make the symmetric operator
    [E,P,S,M,N,idx] = seo(length(x{I}),type{I},2,0);
    
    % Symmetrize the sequence and plot
    stem([-M:M-1],E*(x{I}.'),'fill');
    
    % Some prettyfying trickery
    hold on;
    plot(idx+[0:length(x{I})-1],x{I},'o','MarkerFaceColor','w');
    title(type{I});
    axis([-M-1 M -6 6]);
    grid on;
    set(gca,'YTick',[]);
    set(gca,'XTick',[0]);
end
