view _Old/Pitch Track Data/plotPitchData.m @ 3:475bddaf580c tip

Add report and Presentation
author Dave Moffat <d.j.moffat@qmul.ac.uk>
date Wed, 25 Feb 2015 16:07:05 +0000
parents 26494c0d9ffd
children
line wrap: on
line source
function songDataSet = plotPitchData()

pitchDataInput = 1:13;
pitchDataInput(11) = [];
pitchDataInput(7) = [];
pitchDataInput(6) = [];
pitchDataInput(5) = [];
pitchDataInput(3) = [];
pitchDataInput(1) = [];

% data = readInCSV('Dataset.csv')

songDataSet = {'How long has this been going on?',           'Wh';
        'But don`t you remember?',                   'YN';
        'Is there life on Mars?',                    'YN';
        'Can you feel the love tonight?'             'YN';
        'What have I done?',                         'Wh';
        'Are we human or are we dancers?',           'Echo';
        'How can anybody possibly know how I feel?', 'Wh';
        'D`you know what I mean?',              	 'YN';
        'Do you remember?',                          'YN';
        'Do you remember the first time?',           'YN';
        'Who want to live forever?',               	 'Wh';
        'Is this the real life?',                	 'YN';
        'Is this just fantasy?',                      'YN'};


   
    
plotCol = ['y','m','c','r','g','b','k','m','c','r','g','b','k'];
colIndex = 1;
for i = pitchDataInput
   % i
    songTrack = csvread(strcat(num2str(i),'.csv'));    
    songTrack = songTrack(:,1:2);
%     songTrack = songTrack(ceil(end/2):end,:)

    songTrack(:,1) = songTrack(:,1) / max(songTrack(:,1));
    songTrack(:,2) = smooth(songTrack(:,2),50);
    songTrack = songTrack(songTrack(:,1)<0.95,:);
%     songTrack(:,2) = songTrack(:,2) / min(songTrack(:,2));
    size(songTrack);

    songTrack(:,2) = songTrack(:,2) / max(songTrack(:,2));

    songTrack(songTrack(:,2) == 0,:) = [];
    hold on
        plot(songTrack(:,1),songTrack(:,2),plotCol(colIndex));

%     plot(songTrack(:,1),smooth(songTrack(:,2),size(songTrack,1)/20),plotCol(colIndex));
    colIndex = colIndex +1;
end
xlabel('Normalised Time');
ylabel('Normalised Frequency');
title(strcat('Full Data Plot of Question Type: ',songDataSet{2,2}));
legend(songDataSet{pitchDataInput,1});
saveas(gcf,'plots/FullDataPlot','pdf');


end