Code Search for Developers
 
 
  

plotClusters.m from marsyas at Krugle


Show plotClusters.m syntax highlighted

% function [] = plotClusters(clusters)
clf

name = [path '/' fileName(1:end-4) 'Grd_'];

[nbClusters, nbAttributes] = size(clusters);

nb_coul = 64 ;
coul = floor(rand(1, nbClusters)*nb_coul)+1;
cm = colormap;

maxA = max(clusters(:, 8));
maxAstd = max(clusters(:, 9));
 
[nbPeaks, nbP] = size(peaks);
    
for i=1:nbClusters
    oriLabel = clusters(i, 1)
    groundLabel = clusters(i, 2);
    label = clusters(i, 3);
    start = clusters(i, 4);
    length = clusters(i, 5);
    freqMean = clusters(i, 6);
    freqStd = clusters(i, 7);
    ampMean = clusters(i, 8)/maxA;
    ampStd = clusters(i, 9)/maxAstd;
    voicing = clusters(i, 10)

    frequencyEvolution = clusters(i, 11:11+length);
    amplitudeEvolution = clusters(i, 11+length+1:11+length*2+1);

    value_color = coul(i);
    color = cm(value_color, :) ;
   
    firstC = zeros(1, nbP)+-1;
    firstC(2) = oriLabel;
    iPeaks = [firstC; peaks];
    
    subplot(2, 1, 1);
    line([start start+length], [ freqMean freqMean], ...
        'Color', color, 'LineWidth', ampMean*3, ...
    'ButtonDownFcn', 'plotCluster', 'UserData', iPeaks);
    line([start+length/2 start+length/2], [freqMean-freqStd/2 freqMean+freqStd/2], ...
        'Color', color, 'LineWidth', 1+voicing*10, ...
        'ButtonDownFcn', 'plotCluster', 'UserData', iPeaks); % , 'playCluster', 'UserData', [name num2str(oriLabel) '.wav']);

ylabel('Frequency (Hz)');
xlabel('Time (ms)');
    
    % line([start start], [freqMean-freqStd/2 freqMean+freqStd/2], 'Color', color, 'Marker', '+');
% line([start], [freqMean], 'Color', 'k', 'Marker', 'o', 'MarkerSize', 2);

%      subplot(4, 1, 3);
%      line((start:start+length), frequencyEvolution, 'Color', color, 'LineWidth', ampMean*3);
%      subplot(4, 1, 4);
%      line((start:start+length), amplitudeEvolution, 'Color', color, 'LineWidth', ampMean*3);

end




See more files for this project here

marsyas

Marsyas (Music Analysis, Retrieval and Synthesis for Audio Signals) is a framework for developing systems for audio processing. It provides an general architecture for connecting audio, soundfiles, signal processing blocks and machine learning.

Project homepage: http://sourceforge.net/projects/marsyas
Programming language(s): C++
License: other

  ncut/
    a_times_b_cmplx.dll
    a_times_b_cmplx.mexglx
    a_times_b_cmplx.mexmac
    discretisation.m
    discretisationEigenVectorData.m
    eigs2.m
    mex_w_times_x_symmetric.dll
    mex_w_times_x_symmetric.mexglx
    mex_w_times_x_symmetric.mexmac
    ncut.m
    ncutW.m
    sparsifyc.dll
    sparsifyc.mexglx
    sparsifyc.mexmac
    spmtimesd.dll
    spmtimesd.mexglx
    spmtimesd.mexmac
  divisor.m
  getSnr.m
  harmo.m
  harmoGen.m
  playCluster.m
  plotCluster.m
  plotClusters.m
  plotGpPeaks.m
  plotHarmo.m
  plotPeaks.m