Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Regarding code for speech recognition in robotic car

Status
Not open for further replies.

bidyutkalita

Newbie level 1
Joined
Jun 4, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,303
i am doing a project speech controlled robotic car ..i have written code for parallel communication.

here are the code

%%%%%%%% Training Process %%%%%%%%
% Prepare the user to record voice
'record your commands'

l=0;
m=0;
avg=0;
for j=1:4
'record command'
disp(j)

input ('You will have 2 seconds to command. Press enter when ready')

% Record Voice
usertemp = wavrecord (88200,44100);
sound (usertemp,44100);
'';
plot(usertemp);
count=0;
for n=2:44100
if(usertemp(n,1)<=0.4)%0.02
%p(n,1)=0;
else
%p(n,1)=1;
count=count+1;
end
end
avg(1,j)=count;
disp(avg(1,j))
count=0;
usertemp=0;
end


%%%%%%%% Verification Process %%%%%%%%
%clear;
parport=digitalio('parallel','LPT1');
addline(parport,0:7,'out');

% Prepare the user to record voice


input ('You will have 2 seconds to command. Press enter when ready')

% Record Voice and confirm if the user is happy with their recording
usertemp = wavrecord (88200,44100);
sound (usertemp,44100);
'';
rec = input ('Are you happy with this recording? \nIf not Press 1 to record again or just press enter to proceed--> ');
while rec == 1
rec = 0;
input ('You will have 2 seconds to command. Press enter when ready')
usertemp = wavrecord (88200,44100);
sound (usertemp,44100);
rec = input ('Are you happy with this recording? \nIf not Press 1 to record again or just press enter to proceed--> ');

end
%plot(usertemp);
count=0;
for n=2:44100
if(usertemp(n,1)<=0.4)%0.02
% P(n,1)=0;
else
%P(n,1)=1;
count=count+1;
end
end
disp(count);




if count<=(avg(1,1)+500) & count>=(avg(1,1)-500)
disp('forward')
putvalue(parport,5);
pause(.4);
putvalue(parport,0);

elseif count<=(avg(1,2)+500) & count>=(avg(1,2)-500)
disp('left')
putvalue(parport,1);
pause(.3);
putvalue(parport,0);

elseif count<=(avg(1,3)+500) & count>=(avg(1,3)-500)
disp('right')
putvalue(parport,4);
pause(.3);
putvalue(parport,0);

elseif count<=(avg(1,4)+500) & count>=(avg(1,4)-500)
disp('back')
putvalue(parport,10);
pause(.4);
putvalue(parport,0);

else
disp('speak again')
putvalue(parport,0);

end
count=0;

a=input('press any key to continue.....');
voicecomp;




now i am facing for serial communication .for serial communication how to write code and what hardware will have need for this interface,please suggest me.
 

well for serial communication, you will surely need a microcontroller. There you have a UART port, but to connect it to PC you need to convert this TTL UART signal to RS-232, so u need an RS232 converter IC (max 232) or you can use FTDI chip ft232 for usb to uart conversion.
ft232 has some gpio as well, so if your IO requirement is less, you can even directly use ft232.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top