Digital Signal Processing Reference
In-Depth Information
Zur grafischen Darstellung der Spektren wird das Signal auf eine Sekunde verkürzt.
Danach wird das Audiosignal in sich überlappende Blöcke eingeteilt und jeder
Block für sich transformiert. Im Beispiel der FFT-Länge, M = 512, und dem Para-
meter OL = 0.5 (Overlap), wird das FFT-Fenster jeweils um 256 Folgenelemente
weitergeschoben. Die Beträge der resultierenden DFT-Spektren werden zusammen
als Wasserfalldiagramm und als Spektrogramm angezeigt, siehe Bild 6-4 und Bild
6-5.
Bestimmen Sie für das Beispiel die Frequenzauflösung (DFT-Frequenzraster) der
DFT-Spektren und den zeitlichen Versatz zwischen zwei DFT-Spektren im Spektro-
gramm. Die Abtastfrequenz beträgt 16 kHz.
3
f
=
3
t
=
Programmbeispiel 6-1 Audiosignal, DFT-Spektrum und Spektrogramm
% Short-time spectral analysis of audio signal
% dsplab6_1.m * mw * 26Oct2010
[y,fs,bits] = wavread( 'speech' );
% load audio signal
soundsc(y,fs,bits);
% sound
%% Graphics
t = 0:length(y)-1; t = t/fs; % time scale
figure( 'Name' , 'Audio signal "telecommunications laboratory" ' ,...
'NumberTitle' , 'off' );
plot(t,y), grid
xlabel( 'Time, in Seconds' ), ylabel( 'Audio signal' )
%% Spetral analysis - short term
y = y(1:fs);
% curtail signal to 1 second
M = 512;
% fft length
w = hamming(M);
% Hamming window
OL = 0.5;
% 50% overlap of the fft blocks
NY = floor(length(y)/(M*(1-OL)));
% number of dft spectra
MY = M/4;
% number of dft coeffizients per dft spectrum
Y = zeros(NY,MY);
start = 1; stop = start + M - 1; k = 0;
while stop<=length(y)
k = k + 1;
YY = fft(w.*y(start:stop))';
Y(k,:) = abs(YY(1:MY));
start = start + M*(1-OL);
stop = start + M - 1;
end
%% Graphics
figure( 'Name' , 'Waterfall diagram "telecommunications"' ,...
'NumberTitle' , 'off' );
Y = Y/max(max(Y));
t = 1:NY; t = t*(M*(1-OL))/fs;
% time scale
f = 0:1:M/4-1; f = fs*f/M;
% frequency scale
Search WWH ::




Custom Search