%Script to plot mean accuracy data of all audio samples for each window
%against frame size

% Developer:  - Alice Clifford (alice.clifford@eecs.qmul.ac.uk)


clear all
close all

frameSizeVec=[128 256 512 1024 2048 4096 8192]; %framesizes tested
frameSizeLabels=cell(length(frameSizeVec),1);


for f=1:length(frameSizeVec)
   load(strcat('accuracyData_290512_framesize',int2str(frameSizeVec(f)))); 
   meanPercHits(f,:)=mean(percHitsMat);
   
   frameSizeLabels{f}=int2str(frameSizeVec(f));
   
end



figure
figWidth=7;
figHeight=3.5;
set(gcf, 'units', 'inches', 'pos', [0 1000 figWidth figHeight]) 
 
colorVec=(linspace(0,0.5,2))';
colorMat=[colorVec colorVec colorVec]; 

set(gcf,'DefaultAxesColorOrder',colorMat)
set(gcf,'DefaultAxesLineStyleOrder','-|--|:|-.')

set(gca,'FontSize',8)


plot(meanPercHits,'LineWidth',2)


winShapesLabels={
    'Blackman';
    'Blackman-Harris';
    'Flat Top';
    'Gaussian';
    'Hamming';
    'Hann';
    'Rectangular';}

set(gca,'xticklabel',frameSizeLabels)
xlabel('Framesize (samples)')
ylabel('Mean accuracy (%)')
legend(winShapesLabels,'Location','SouthEast')