「音高」(Pitch)是另一個音訊裡面很重要的特徵,直覺地說,音高代表聲音頻率的高低,而此頻率指的是「基本頻率」(Fundamental Frequency),也就是「基本週期」(Fundamental Period)的倒數。

若直接觀察音訊的波形,只要聲音穩定,我們並不難直接看到基本週期的存在,以一個 3 秒的音叉聲音來說,我們可以取一個256 點的音框,將此音框畫出來後,就可以很明顯地看到基本週期,請見下列範例:

範例1輸入:

close all

waveFile='soundFork.wav';

[y, fs, nbits]=wavread(waveFile);

index1=11000;

frameSize=226;

index2=index1+frameSize-1;

segment=y(index1:index2);

subplot(2,1,1);

plot(y); grid on

title(waveFile);

set(gca, 'xlim', [0, length(y)]);

limit=axis;

line(index1*[1 1], limit(3:4), 'color', 'r');

line(index2*[1 1], limit(3:4), 'color', 'r');

subplot(2,1,2);

plot(segment, '.-');

set(gca, 'xlim', [1, index2-index1+1]);

point=[7, 189];

line(point, segment(point), 'marker', 'o', 'color', 'red'); periodCount=5;

更多推荐