Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
hii,
I have used mfcc for feature extraction of speech samples and then normalized them using min_max algorithm.Now I want to take 70% of them for training and 30% for sampling or testing. I am unable to do that using the code which I have.I am writing the code below .I ma thankful to the person for helping me in advance.

VB
clc;
training = min_max_norm(n700train,-1,1);% training sample or matrix
sample = min_max_norm(n300test,-1,1);%testing samples or matrix

no_obj = 2;
no_sample = 350;
u=no_obj*(no_sample);
group=repmat(1:no_obj,[no_sample,1]);
group=group(:);

CLASS = knnclassify(sample,training,group,1,'euclidean');
res=sum((CLASS==group))/u;
fprintf( 'The result of classification is %f%% \n\n',res*100/2);

%NEW code%
for j = 1: no_obj

       rs = reshape(CLASS',250,no_obj);
       sm = sum(rs(j,:)==j);
       if (sm > 3)
            fprintf('\nSpeaker %d is matched with Speaker %d',j,j);
        else
            fprintf('\nSpeaker %d is not matched ',j);
        end
   end
    fprintf('\n\n%d samples matched out of %d\n',res*u,u);
    fprintf( 'The result of classification is %f%% \n\n',res*100);


it shows following error

??? Error using ==> eq
Matrix dimensions must agree.

Error in ==> test_one at 12
res=sum((CLASS==group))/u;

please help me .my mail_id is [email id removed - once someone asnswers, automatically an email will be sent to registered id.]
Posted
Updated 13-May-12 3:27am
v2
Comments
abhishekmathur786 13-May-12 9:38am    
Dear Mr Sandeep ,what is wrong with the grammar or language i wrote in my query.
Sergey Alexandrovich Kryukov 13-May-12 12:57pm    
I can show what still should be fixed:
"hii",
"mfcc",
"below .I ma thankful",
"help me .my mail_id".

I included not just grammar or syntax but also capitalization and punctuation.
--SA
abhishekmathur786 13-May-12 13:05pm    
thanks dear,i got the mistakes but do you have any solution for my problem @sakryukov

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900