Separate words in audio file

조회 수: 6 (최근 30일)
Michael Saniuk
Michael Saniuk 2017년 5월 14일
답변: Michael Saniuk 2018년 11월 5일
Hello, I am trying to separate words in an audio file, leaving only samples between red lines, with also having a variable with a border of each word:
I understand I can remove the silence between words using
envelope = imdilate(abs(y), true(1500, 1));
quietParts = envelope < 0.05;
y(quietParts) = [];
but this does leave me without knowing the boundary between each of these words.
  댓글 수: 2
Arthur Goodhart
Arthur Goodhart 2018년 11월 2일
Did you ever work out how to do this?
Michael Saniuk
Michael Saniuk 2018년 11월 3일
I posted this question 1.5 year ago but yes, I managed to do it myself.
[y, fs] = audioread(sprintf('test%d.wav', i));
envelope = imdilate(abs(y), true(1500, 1));
quietParts = envelope > 0.01;
beginning = strfind(quietParts',[0 1]);
ending = strfind(quietParts', [1 0]);
With this code you can get boundaries between words but also between noises and sometimes the word gets separated.
In order to concatenate fragments of word into one full word, I had to detect parts where where is a very small distance between them and remove their corresponding endings/begginings:
eg. [b1 e1] [b2 e2] [b3 e3] are from the same word,
distances between them are very small.
I concatenate them and now I have a full word [b1 e3]
The last thing that might annoy us are the boundaries of noise that we do not want to be treated as a word! In order to get rid of them I calculated minimal length of a word in my dictionary and counted it as a minimal length for a detected word to be counted as a word.

댓글을 달려면 로그인하십시오.

채택된 답변

Michael Saniuk
Michael Saniuk 2018년 11월 5일
Copying my comment to post it as an answer:
I posted this question 1.5 year ago but yes, I managed to do it myself.
[y, fs] = audioread(sprintf('test%d.wav', i));
envelope = imdilate(abs(y), true(1500, 1));
quietParts = envelope > 0.01;
beginning = strfind(quietParts',[0 1]);
ending = strfind(quietParts', [1 0]);
With this code you can get boundaries between words but also between noises and sometimes the word gets separated.
In order to concatenate fragments of word into one full word, I had to detect parts where where is a very small distance between them and remove their corresponding endings/begginings:
eg. [b1 e1] [b2 e2] [b3 e3] are from the same word,
distances between them are very small.
I concatenate them and now I have a full word [b1 e3]
The last thing that might annoy us are the boundaries of noise that we do not want to be treated as a word! In order to get rid of them I calculated minimal length of a word in my dictionary and counted it as a minimal length for a detected word to be counted as a word.

추가 답변 (1개)

huda farooqui
huda farooqui 2018년 11월 1일
I am facing the same problem .kindly help

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by