Advertisement

07.23.2008 at 04:47PM PDT, ID: 23590600 | Points: 500
[x]
Attachment Details

Slow matlab code

Asked by Stromhau in MatLab Programming Language, Math & Science Questions, Algorithms

Hi, can anybody help me to get this function faster ?
Think the matrix concatenation is the trouble? I also know that a double for i not good.
Takes 8-9 seconds for a 15 seconds sound file.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
function p=SDC(signal)
 
%functions to compute shifted delta cepstral from MFCC,PLP,LPC
%
%Signal is coeff of MFCC
 
%Author Tommy Strømhaug, 2008
 
%Hardcoded N, d, P, and k
 
%d and P considered in frames. N amd k is ints
N=7;  % number of c cepstral coefficients in each cepstral vector
d=1;  % time advance and delay for the delta computation
P=3;  % timeshift netween consecutive blocks
k=7;  % number of blocks whose delta coefficients are concatenated to form the SDC vector
 
[row,col]=size(signal);
sdc=[];
sdc_temp=[];
 
%Pad data to not get out of bound. circular padding
right=signal(:,col-9:col)
left =signal(:,1:21)
signal=cat(2,signal,left);
signal=cat(2,right,signal);
 
for t=11:col+10
        
    for i=0:k-1
        
        sdc_temp=signal(:,t+i*P+d)-signal(:,t+i*P-d);
        sdc=cat(2,sdc,sdc_temp);     
        
      end    
end
 
p=sdc;
[+][-]07.25.2008 at 04:21AM PDT, ID: 22087457

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 07:10AM PDT, ID: 22088732

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.25.2008 at 07:45PM PDT, ID: 22093542

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.26.2008 at 09:34AM PDT, ID: 22095456

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2008 at 05:00PM PDT, ID: 22100011

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628