Sei sulla pagina 1di 12

EAB 3043

DIGITAL SIGNAL PROCESSING


DIGITAL SIGNAL PROCESSING PROJECT
RECORDED VOICE AND VARIOUS PLAYBACK
MOHAMED MEERA HUSSIEN B. JAWHAR SATHIK 15093
AZMEER B. ABDUL MAJID 15136
OBJECTIVE
1. This project record audio signal from the computer/audio cd , then plays it back with various
playback such as reverse, delayed and fast forward conditions.
2. To apply these playbacks in our daily life for audio/music purpose.
INTRODUCTION
In this new technology era, speech recognition has become popular research topic. Many Researches had
been done to improvise this technology. The application is not only limited for calls, however it can be
used to simply human daily chaos. s an e!ample, voice recorded is embedded in the security system and
in mobile application. Moreover, dvd player, ipod and computer also use these features to simplify the
audio function system in our daily life.
The main idea of this project is to record the audio file from the computer or audio "# by
recogni$ing the audio data using #%&'()* board. The buffer is continually overwritten with
new values until recording is halted manually. Voice activated recording is used with
Audio file input and will start recording when the switch for record is press. For the
output of this project, there will be three outputs that is everse, !low and Fast
forward playbac"s. These outputs are produce with the concept of fre#uency
sampling and inverse that satisfy the formula Fs$2Fo to avoid aliasing effect.
F%&'( 1) "oncept of this project on how the input being manipulated to produce three different types of
output +Reverse, %low and ,asforward- condition.
METHOD
%*+'T
!,-. +,A/0A12
FA!T F-.A3
+,A/0A12
(V(!( +,A/0A12
-'T+'T
,or this project, Matlab software is used for testing purpose. .owever, the real programme is applied in
#%& kit using " language. In analy$ing the input signal, time shifting, fre/uency response and
/uanti$ation are applied to produce the desired outcome. Moreover, the ,re/uency sampling need to
satisfy the formula ,s01,o to avoid aliasing effect. 2elow is the Matlab code and flow chart.
Matla !"#$
record3mic.m
rec4bj 5 audiorecorder+66)77, )', )-8
get+rec4bj-
9 Record your voice for seconds.
rec4bj 5 audiorecorder8
disp+:%tart speaking.:-
recordblocking+rec4bj, sec-8
disp+:;nd of Recording.:-8

9 <lay back the recording.
play+rec4bj-8

9 %tore data in double=precision array.
myRecording 5 getaudiodata+rec4bj-8
wav>ink 5 :"?@record3chunk.wav:8
wavwrite+myRecording,wav>ink-8
9 <lot the waveform.
plot+myRecording-8
title+:Record %ound Aaveform +RA-:-8
y 5 wavread+:"?@Bsers@<ublic@Music@%ample Music@ustin3<owers3danger.wav:-8
9normal playback
,s5C)D18
sound+y-8
9fipped playback
y15flipud+y-8
soundsc+y1-8
wavwrite+y1,:"?@Bsers@<ublic@Music@%ample Music@ustin3<owers3danger3reverse.wav:-8
9delayed playback
y) 5 wavread+:"?@Bsers@<ublic@Music@%ample Music@ustin3<owers3danger.wav:-8
,s 5 E7778
soundsc+y),,s-8
wavwrite+y),,s,:"?@Bsers@<ublic@Music@%ample Music@ustin3<owers3danger3slow.wav:-8
9fast playback
y* 5 wavread+:"?@Bsers@<ublic@Music@%ample Music@ustin3<owers3danger.wav:-8
,s 5 )D7778
soundsc+y*,,s-8
wavwrite+y*,,s,:"?@Bsers@<ublic@Music@%ample Music@ustin3<owers3danger3fast.wav:-8
start
end
%l"&!'a(t )"( Matla
!et the sampling
fre#uency of audio
input
!tart
ecording
ecord signal
until time 4
5sec
!top ecording
6(nd of
ecording6
+laybac" the record audio
with three types of
outputs
7everse,slow,fastforward8
playbac"
DSK6*13
,or the #%& board, the value for fre/uency sample is set to C&h$ and the buffer length for recorded audio
is set to 1677777+*77secs- which e/ual to about ) song for a playback. ,or this project we use polling
techni/ue to determine the three outputs+Reverse,,astforward and slow playbacks-. The switches on the
#%& board were assign to %A*5Recording %A15,asforwad/%low %A)5Reverse %A754riginal audio.
Moreover, >;# function were included as the switch turn F7G or F)G to show the signal playback. 2elow
is the source code for the project.
S"+(!$ !"#$
//record.c record/play input using e!ternal memory
Hinclude Idsk'()*3aic1*.hI //codec support
Bint*1 fs5#%&'()*3I"1*3,R;J3C&.K8 //set sampling rate
Hdefine #%&'()*3I"1*3IL<BT3MI" 7!77)E
Hdefine #%&'()*3I"1*3IL<BT3>IL; 7!77))
Bint)' inputsource5#%&'()*3I"1*3IL<BT3>IL;8 // select input
Hdefine L 1677777 //large buffer si$e *77 secs
long i,j8
short bufferMLN,delay8
Hpragma #T3%;"TI4L+buffer,I.;OT3RMI- //buffer =0e!ternal memory
short #I<3Mask 5 178 //any #I< %A value e!cept 7=)E
short newMask 5 78
void main+- P
short recording 5 78
short playing 5 78
for +i57 8 iQL 8 iRR- bufferMiN 5 78
#%&'()*3#I<3init+-8
#%&'()*3>;#3init+-8
comm3poll+-8 //init #%&, codec, Mc2%<
while+)- //infinite loop
P
if+#%&'()*3#I<3get+*- 55 7- //if %AH* is pressed
P
for +i578 iQL 8 iRR- bufferMiN 5 78
i578
recording 5 )8
while +recording 55 )-
P
#%&'()*3>;#3on+*-8 //turn on >;#H*
if +iQL- bufferMiRRN 5 input3left3sample+-8 //input data
if +i01777-
if +#%&'()*3#I<3get+*- 55 )-
P
j5i8 //last buffer inde!
recording 5 78
#%&'()*3>;#3off+*-8
S //>;#H* off when buffer full

S // while +recording 55 )-
S //if
if+#%&'()*3#I<3get+7-557- //if %AH7 pressed
P
i578
playing 5 )8
while +playing 55 )-
P
#%&'()*3>;#3on+7-8 //turn on >;#H7
output3left3sample+bufferMiRRN-8 //input data
if +i05j- i578
if +i01777-
if +#%&'()*3#I<3get+7- 55 )-
P
playing 5 78
#%&'()*3>;#3off+7-8
S //>;#H* off when buffer full

S // while +playing 55 )-
S
if+#%&'()*3#I<3get+)-557- // if %AH) pressed, play backward
P
i5j8
playing 5 )8
while +playing 55 )-
P
#%&'()*3>;#3on+)-8 //turn on >;#H)
output3left3sample+bufferMi==N-8 //input data
if+iQ57- i5j8
if +#%&'()*3#I<3get+)- 55 )-
P
playing 5 78
#%&'()*3>;#3off+)-8
S
S//while +playing 55 )-
S
/T if+#%&'()*3#I<3get+1-557- // if %AH) pressed, play fast forward
P
i578
playing 5 )8
while +playing 55 )-
P
#%&'()*3>;#3on+1-8 //turn on >;#H7
bufferMiRRN5output3left3sample+bufferMiRRN-8 //e/uation for fast forward speed
output3left3sample+bufferMiRRN-8 //input
if +i05j- i578
if +i01777-
if +#%&'()*3#I<3get+1- 55 )-
P
playing 5 78
#%&'()*3>;#3off+1-8
S //>;#H* off when buffer full
S
ST/
if+#%&'()*3#I<3get+1-557- // if %AH) pressed, play slow
P
i578
playing 5 )8
delay 5 78
while +playing 55 )-
P
#%&'()*3>;#3on+1-8 //turn on >;#H7
delay5 output3left3sample+bufferMiRRN-8 //e/uation for slow playback
output3left3sample+delay-8 //input
if +i05j- i578
if +i01777-
if +#%&'()*3#I<3get+1- 55 )-
P
playing 5 78
#%&'()*3>;#3off+1-8
S //>;#H* off when buffer full
S
S
S
S
.
Flowchar !or CCS
!tart
end
no
yes
Yes
D,-!+--,".
!et the sampling
fre#uency of audio
input
Test switch 5
if press99
+laybac" the record audio
with three types of
outputs
7everse,slow,fastforward8
playbac"
Test switch :
if press99
ecord signal
until time 4
5sec
,rom the project, we manage to get * outputs that are original audio, reverse and fast forward playback
using #%&'()* board. The fre/uency were set at C&.$ and the buffer length is 1677777+*77secs- which
e/ual to about for ) song. ll of the outputs have been test in Matlab and it works. fter success in
Matlab, we do the programming in "ode "omposer %tudio to get the output using #%&'()* board using
polling techni/ue. s we tried using interrupt techni/ue for this project , the switch function works fine
but when we try to record the were no audio recorded. %o we used the polling method instead. ,our
switches used for recording, original, reverse fast forward and slow playbacks. .owever for the slow
playback the ouput that we determine have certain noise. This occurs because of the formula used are not
suitable with the program/source code.
C".!l+-,".
s what we learn in our lab for #%<, we manage to implement it in our project Uoice Recorded and
Uarious <layback. The project works fine in Matlab and #%&'()*. This project can be implemented in
our audio system to help human daily life. ,rom the project done, we are capable of handling certain
techni/ues in Matlab as well as ""% that helps to understand in depth about #igital %ignal <rocessing.

Potrebbero piacerti anche