Home > pitchmark > plotpitchmarks.m

plotpitchmarks

PURPOSE ^

SYNOPSIS ^

function plotpitchmarks(y, fs, pitchmarks, SFS_pitchcurve, AXISsetting1, AXISsetting2)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function plotpitchmarks(y, fs, pitchmarks, SFS_pitchcurve, AXISsetting1, AXISsetting2)
0002 
0003 Marks_pitchcurve = (fs./diff(pitchmarks))'; %row-based vector.
0004 
0005 if nargin<5,
0006    AXISsetting1 = 'tight';   
0007    MAXpitch = max([Marks_pitchcurve; SFS_pitchcurve])+20;  %Unit : Hz
0008    MINpitch = min([Marks_pitchcurve; SFS_pitchcurve])-20;  %Unit : Hz
0009    Curvelength = max([length(Marks_pitchcurve) length(SFS_pitchcurve)]);
0010    AXISsetting2 = [1 Curvelength MINpitch MAXpitch];
0011 end;
0012 
0013 figure('position', [-3 43 1280 646]);
0014 % ==================================================================== %
0015 subplot(2,1,1);
0016 plot((1:length(y)), y, '.-');
0017 for i=1:length(pitchmarks),
0018    line(pitchmarks(i), y(pitchmarks(i)), 'marker', 'o', 'color', 'r', 'linewidth', 1.6);
0019 end
0020 ylabel('Amplitude'); title('Wave form'); legend('Wave','Pitch marks');
0021 axis(AXISsetting1);
0022 
0023 % ==================================================================== %
0024 subplot(2,1,2);
0025 if length(SFS_pitchcurve) > length(Marks_pitchcurve),
0026    SFS_pitchcurve = SFS_pitchcurve(1: length(Marks_pitchcurve));
0027 else
0028    SFS_pitchcurve = scalevector(SFS_pitchcurve, length(Marks_pitchcurve))'; %row-based vector
0029 end;
0030 A = plot(SFS_pitchcurve, 'ro-'); set(A, 'linewidth', 1.6);
0031 hold on; A = plot(Marks_pitchcurve, 'bx-'); set(A, 'linewidth', 1.6);
0032 RMSE = sqrt(mean(abs(Marks_pitchcurve - SFS_pitchcurve).^2));
0033 title(['RMSE of SFS-pitch and Marks-pitch is: ' num2str(RMSE) ' (Hz).']);
0034 ylabel('Frequency (Hz)'); xlabel('Frame Index (10 ms)');
0035 legend('Pitch curve estimated by using Speech Filing System software (SFS-pitch)', 'Pitch curve estimated directly by using distance of pitch marks (Marks-pitch)', 2);
0036 axis(AXISsetting2);

Generated on Tue 21-Aug-2007 22:52:24 by m2html © 2003