how to vectorize these for loop?
Afficher commentaires plus anciens
clc;
clear all;
close all;
tic;
[s,fs]=audioread('sample.wav')
fdatool
l=length(s);
figure('name','speechsignal');
subplot(3,3,1);
plot (s);
title('speech signal');
xlabel('samples---->');
ylabel('amplitudes---->');
t=(0:1:l-1)/fs;
subplot(3,3,2);
plot(t,s);
title('Speech signal on time axis');
xlabel('time(s) ---->');
ylabel('Amplitude ---->');
f_d=0.1;
f_s=floor(l*f_d);
overlap=f_s/2;
no_f=floor((l/f_s)*2-1);
M=zeros(f_s,no_f);
for j=1:no_f;%i=1:frame size;
for i=1:f_s;%j=1:no of frames;
M(i,j)=s(((j-1)*overlap)+i);
end;
end;
1 commentaire
José-Luis
le 9 Août 2017
Please edit your code to make it easy to read.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Pie Charts dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!