www.pudn.com > voicesong.rar > draw.m


figure 
 
x=wavread('Xviocesongleft'); 
R = 256;               % R: block length 
window = hamming(R);   % window function of length R 
N = 512;               % N: frequency discretization 
L = 35;                % L: time lapse between blocks 
fs = 16000;             % fs: sampling frequency 
overlap = R - L; 
% COMPUTE SPECTROGRAM 
[B,f,t] = specgram(x,N,fs,window,overlap); 
% MAKE PLOT 
subplot(311) 
imagesc(t,f,log10(abs(B+0.0000001))); 
colormap('jet') 
axis xy  
 
 
 
x=wavread('speakersongconventionalspeaker'); 
R = 256;               % R: block length 
window = hamming(R);   % window function of length R 
N = 512;               % N: frequency discretization 
L = 35;                % L: time lapse between blocks 
fs = 16000;             % fs: sampling frequency 
overlap = R - L; 
% COMPUTE SPECTROGRAM 
[B,f,t] = specgram(x,N,fs,window,overlap); 
% MAKE PLOT 
subplot(312) 
imagesc(t,f,log10(abs(B+0.0000001))); 
colormap('jet') 
axis xy  
ylabel('Frequency/Hz') 
 
 
 
x=wavread('speakersongwaveletspeakr'); 
R = 256;               % R: block length 
window = hamming(R);   % window function of length R 
N = 512;               % N: frequency discretization 
L = 35;                % L: time lapse between blocks 
fs = 16000;             % fs: sampling frequency 
overlap = R - L; 
% COMPUTE SPECTROGRAM 
[B,f,t] = specgram(x,N,fs,window,overlap); 
% MAKE PLOT 
subplot(313) 
imagesc(t,f,log10(abs(B+0.0000001))); 
colormap('jet') 
axis xy  
xlabel('Time/s')