Segmentation of audio signal.

62 visualizaciones (últimos 30 días)
Djordje Damnjanovic
Djordje Damnjanovic el 13 de Jun. de 2019
Respondida: Sravanth Meka hace alrededor de 3 horas
Hello everybody!
I have this issue about segmentation of audio signal. I want to do segmentation of audio signal but with overlap of each segment of 25%. For example, first segment of signal will start from 0 sec to 1 sec, next segment will start from 0.75 sec to 1.75 sec, third segment will start from 1.5 sec to 2.5 sec. etc. Later I need to use each segment seperatly for futher analysis so it is good to put every segment in some vector or again save as audio signal... I create picture where I paint segments in signal.
Thanks in front!
ffff.jpg

Respuestas (3)

Star Strider
Star Strider el 13 de Jun. de 2019
Try this:
s = 0.1*randn(1E+4,1)+sin(0.02*pi*(1:1E+4)'-1); % Signal (Column Vector)
L = numel(s); % Vector Length
Fs = 1000; % Sampling Frequency
Ts = 1/Fs; % Sampling Interval
sec1 = 1:Fs; % One-Second Segment Length
secq = fix(3*Fs/4); % 750ms Segment Length
seg = zeros(Fs,fix(L/Fs)); % Preallocate
for k = 1:fix(L/Fs)
seg(:,k) = s(sec1+secq*(k-1)); % Signal Segments
end
If you only wanted the segments without the offset, the reshape function would have been best.
  2 comentarios
Alsha Babu
Alsha Babu el 27 de Feb. de 2020
@Star Strider
Could you please tell me how the reshape function can be used to remove the offset?

Iniciar sesión para comentar.


Greg Dionne
Greg Dionne el 13 de Jun. de 2019
If you have the Signal Processing Toolbox, buffer may be what you're after.
Hope this helps!
-Greg
  1 comentario
Djordje Damnjanovic
Djordje Damnjanovic el 25 de Jun. de 2019
I will also try with buffer! Thanks!

Iniciar sesión para comentar.


Sravanth Meka
Sravanth Meka hace alrededor de 3 horas

s = 0.1*randn(1E+4,1)+sin(0.02*pi*(1:1E+4)'-1); % Signal (Column Vector) L = numel(s); % Vector Length Fs = 1000; % Sampling Frequency Ts = 1/Fs; % Sampling Interval sec1 = 1:Fs; % One-Second Segment Length secq = fix(3*Fs/4); % 750ms Segment Length

seg = zeros(Fs,fix(L/Fs)); % Preallocate for k = 1:fix(L/Fs) seg(:,k) = s(sec1+secq*(k-1)); % Signal Segments end

if true
  % code
end

Categorías

Más información sobre Audio Processing Algorithm Design en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by