Filter löschen
Filter löschen

isolated word detection, comparing two audio files

2 Ansichten (letzte 30 Tage)
Ayush
Ayush am 5 Jun. 2015
i am trying to compare two audio files, one is user input and the second file is the pre-recorded sample (defined). I need to compare both, i have converted both .wav file from time domain to frequency domain. yet i cannot establish a way to compare both the files.
Fs = 10000; % Sampling Frequency (Hz)
Nseconds = 1; % Length of speech signal
fprintf('say a word immediately after hitting enter: ');
input('');
% Get time-domain speech signal from microphone
y = wavrecord(Nseconds*Fs, Fs, 'double');
x = fft(y);
% Get response until Fs/2 (for frequency from Fs/2 to Fs, response is repeated)
x = x(1:floor(Nseconds*Fs/2));
% Plot magnitude vs. frequency
m = abs(x);
f = (0:length(x)-1)*(Fs/2)/length(x);
plot(f,m);
xlabel('Frequency (Hz)');
ylabel('Magnitude');
% Get time-domain speech signal already recorded sample
y2=wavread('sample01_6k.wav','double');
x2 = fft(y2);
% Get response until Fs/2 (for frequency from Fs/2 to Fs, response is repeated)
x2 = x2(1:floor(Nseconds*Fs/2));
% Plot magnitude vs. frequency
m2 = abs(x2);
f2 = (0:length(x2)-1)*(Fs/2)/length(x2);

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 5 Jun. 2015
fft() is for periodic signals. If the longer signal consisted of nothing other than the same word repeated over and over again exactly the same way then comparing the fft() might be useful.
You will need to use a technique that deals with analysis over short times rather than infinite. One technique is Short Time Fourier Transform. See for example http://www.mathworks.com/help/signal/ug/formant-estimation-with-lpc-coefficients.html
  2 Kommentare
Ayush
Ayush am 5 Jun. 2015
got it, but i still cannot figure how will i compare those two speech signal. Lenght approx. 2 sec. Currently i am not considering noise.
Anjaneyulu Challa
Anjaneyulu Challa am 15 Apr. 2016
I to have the same problem

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Audio I/O and Waveform Generation finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by