% helmholtz dissonance fo = 300; fmax = 2000; m = 10; h = fo * (1:m); h = h(find(h15); % badly diss k = find(abs((h-fh(j))/fh(j))<0.15 & abs((h-fh(j))/fh(j))>0.1); % bit diss if ~isempty(i), plot([fh(j) h(i)], [1.1 1.1*ones(size(i))], 'b-*'); end if ~isempty(k), plot([fh(j) h(k)], [1.2 1.2*ones(size(k))], 'g-o'); end t(1) = t(1)+numel(i); t(2) = t(2)+numel(k); end disp(sprintf('Int: %g, # of dissonances = %d (badly), %d (a bit)', ... int, t(1), t(2))); sc(a) = t(1) + 0.5*t(2); end print -depsc2 diss_partials.eps figure;plot(ints, sc, '+-'); % scores print -depsc2 diss_scores.eps % end