%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% .m script of web demo "Sphere Detector"
% Written for GNU Octave
%
% INSTITUTE OF TELECOMMUNICATIONS
% University of Stuttgart
% www.inue-uni-stuttgart.de
% author: Johannes Pfeiffer
% date: 2016/05/15
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [ ] = slide_show_fun( N_tx , Modulation , SNR , Radius , ...
    New_Random , Plot_full_tree , Display_distances , ...
    Display_info_text , Tree_shape , Order_en , fileformat , webdemo_en , N_frames , filename )
%
% calculation and visualization of sphere detector search trees 
%
% slide_show_fun(3, 'QPSK', 20, Inf, true, true, false, true, 'regular', true, 'portrait', false, 2, 'tree')
%
% JPF - 2016/05/15
%

if nargin < 1
    % use default values:
    N_tx        = 3;
    Modulation  = 'QPSK';
    SNR         = 20;
    Radius      = Inf;
    Plot_full_tree    = true;
    Display_distances = false;
    Display_info_text = true;
	Tree_shape	= 'regular';
    Order_en	= true;
    fileformat	= 'portrait';
    webdemo_en  = false;
	N_frames  	= 2;
    filename    = 'tree';
    
end


% hard limits for number of created image files
max_img_index = min(500,max(N_frames,2));

for idx = 0:max_img_index
	sphere_tree_fun(N_tx, Modulation, SNR, Radius, true ,Plot_full_tree, Display_distances, ...
    Display_info_text, Tree_shape, Order_en, fileformat, webdemo_en, [filename '_' num2str(idx)]);
	clf;
end


end




