% Spectrogram of vowels A,E,I,O,U [Y, fs, Nbits]=wavread('aeiou.wav'); % 1.9093 sec % You can produce the above wav file at http://atc.ccl.itri.org.tw/ % Welcome to the Text-to-Speech Engine demo Advanced Technology Center % ICL/ITRI 歡迎使用工研院(ITRI: Industrial Technology Research Institute of % Taiwan, R.O.C)資通所前瞻技術中心研發的 中文文字轉語音合成系統 N = length(Y); T=1/fs; % fs=16000; N=30548; Nbits=16 figure; plot([0:N-1]*T,Y) soundsc (Y,fs) L = 256; % Compute spectrogram by Matlab built-in function specgram.m(uses a Hanning window) figure; specgram(Y, L, fs, 256, 128); % Compute spectrogram by the function f_specgram.m (a little changed by Tang)created by Schilling & Harris L = 256; Hamming = 3; levels = 12; [G,f,t] = f_specgram (Y,L,fs,Hamming); figure; contour(t,f(1:L/2),G(1:L/2,:),levels) % Original: contour(t,f(1:L/2),G(:,1:L/2),levels) f_labels ('Spectrogram of vowels: Hamming window','{\itt} (sec)','{\itf} (Hz)','\it{G(t,f)}');