%% Test FAMS on 1D data

%% randomize data
max_uniform=100;
vect1 = rand(100,1)*max_uniform; % uniform 
vect2 = randn(100,1)*1+20; %first gauss 
vect3 = randn(100,1)*1+60; %second gauss 
data=[vect1;  vect2; vect3];

%% run FAMS
[modes,p_modes,w_modes ] =fams(data,20,5,50,'exmpl1D','res/');

%% view results
p_modes
figure(1),clf;
subplot(2,2,1),plot(data,'*'),title('1D data (x:sample num, y:value)');
subplot(2,2,2),plot(modes,'*'),title('after fams');
[f,xi]=ksdensity(modes,'width',2);
subplot(2,2,3),plot(xi,f,'.g');
subplot(2,2,4),hist(modes,10);

