MATLAB Functionality For Digital Speech Processing
MATLAB Functionality For Digital Speech Processing
Speech Processing
MATLAB Speech Processing Code
MATLAB GUI Implementations
Lecture_3_2013
Basics
Basics
Text Box 1
Graphics
Panel 1
Buttons 1-11
Panel 2
Panel 1
Graphics
Panel 2
Panel 3
10
14
hello_goodbye_world
run:
hello_goodbye_world_GUI26.m
directory:
hello_goodbye_world
15
hello_goodbye_world
Text Box1
Button1 - Pushbutton
Message Box from Code
Button2 - Pushbutton
Button3 - Pushbutton
Panel2
Panel1
16
hello_goodbye_world GUI
Modifications
Run program runGUI.m to bring up GUI Lite 2.6 editor
Choose Mod (modify) and select GUI file
hello_goodbye_world.mat for editing
Choose Move & Resize Feature option
Choose Button option
Left click inside button to be modified
Choose new button coordinates by using graphics cursor to
identify lower left and upper right corners of modified
button
Click Save GUI button
Iterate on other buttons
Click Quit option to terminate GUI Lite 2.6 editor
17
2 Panels
0 Graphics Panels
1 Text Box
3 Buttons
18
runGUI.m
Modify Feature
Feature Index
Save GUI
Save GUI As
Quit
hello_goodbye_world_GUI26.m19
radio button
check box
listbox
toggle button
table
axes
button group
active X control
Pyramid of Learning
Ability to implement
theory and concepts in
working code (MATLAB, C,
C++); algorithms,
applications
Basic understanding of
how theory is applied;
autocorrelation,
waveform coding,
Mathematics, derivations,
signal processing; e.g.,
STFT, cepstrum, LPC,
22
23
Basic Functionality
read a speech file (i.e., open a .wav speech file and read the speech sample into a
MATLAB array)
write a speech file (i.e., write a MATLAB array of speech samples into a .wav
speech file)
play a MATLAB array of speech samples as an audio file
* play a sequence of MATLAB arrays of speech samples as a sequence of audio
files
record a speech file into a MATLAB array
plot a speech file (MATLAB array) as a waveform using a strips plot format
* plot a speech file (MATLAB array) as one or more 4-line plot(s)
convert the sampling rate associated with a speech file (MATLAB array) to a
different (lower/higher) sampling rate
lowpass/highpass/bandpass filter a speech file (MATLAB array) to eliminate DC
offset, hum and low/high frequency noise
plot a frame of speech and its associated spectral log magnitude
plot a spectrogram of a speech file (MATLAB array)
* plot multiple spectrograms of one or more speech files (MATLAB arrays)
* indicates exercise not yet done
26
% test_wavread.m
% test waveread function
%
% read speech samples from file 'test_16k.wav' into array x1 using wavread
% routine
filein='test_16k.wav';
[x1,fs1,nbits]=wavread(filein);
% print out values of fs1, nbits, wavmin1, wavmax1
wavmin1=min(x1);
wavmax1=max(x1);
fprintf('file: %s, wavmin/wavmax: %6.2f %6.2f, fs1: %d, nbits: %d \n,
filein,wavmin1,wavmax1,fs1,nbits);
% read speech samples from same file into array x2 using loadwav routine
[x2,fs2]=loadwav(filein);
% print out values of fs2, nbits, wavmin2, wavmax2
wavmin2=min(x2);
wavmax2=max(x2);
fprintf('file: %s, wavmin/wavmax: %d %d, fs2: %d \n',...
filein,wavmin2,wavmax2,fs2);
Terminal Display:
file: test_16k.wav, wavmin/wavmax: -1.00 1.00, fs1: 16000, nbits: 16
file: test_16k.wav, wavmin/wavmax: -32768 32767, fs2: 16000
28
29
32
s2.wav
s3.wav
s4.wav
s5.wav
s6.wav
play_multiple_files_GUI26.m
33
35
Basics
Basics
37
Basics
38
Basics
zoom_strips_plot_GUI25.m
39
40
Example:
[xin, fsin] = loadwav(s5.wav); % fsin=8000;
fsout = 10000; % desired sampling rate;
y = srconv(xin, fsin, fsout);
41
SRC_GUI25.m
Basics
42
Frame-Based Spectrums
NB_WB_spectra_GUI25.m
Basics
44
Wideband/Narrowband Spectrogram
Spectrogram_GUI25.m
Basics
45
46
Fundamentals
Representations
time domain exercises
windows; features; autocorrelation estimates; amdf
Algorithms
endpoint detector
Voiced-Unvoiced-Background estimation
method
autocorrelation pitch detector
log harmonic spectral waterfall plots
cepstral pitch detector
SIFT pitch detector
formant estimation method
49
Applications Part 1
Speech waveform coding;
statistical properties of speech; quantization
characteristics of a B-bit uniform or mu-law compressed
and quantized speech file; uniform quantization; mu-law
compression; mu-law quantization; Signal-to-Noise Ratio
(SNR) of uniform and mu-law quantizers
Applications Part 2
51
Summary
Set of about 60 MATLAB speech processing
exercises
Exercises aligned with distinct sections in the
textbook TADSP by Rabiner/Schafer
Each exercise has an associated Graphical User
Interface created using a GUI LITE program and
created expressly for these speech processing
exercises
GUI LITE design and implementation Callbacks
are in totally separate code packages
53