Tuesday, October 28, 2014

[Von-mises distribution with EM] Matlab example code P.106

Description :

This code demonstrates EM Algorithm for circular data. 

Normally, Expectation-Maximization (EM) algorithm example employs a Gaussian distribution.

However, in this example, I employed a Von-mises distribution to EM algorithm.
EM algorithm will cluster circular data as below.


















See p.106 in the text book Pattern Recognition and Machine learning by Christoper Bishop for more information about Von-mises distribution.

The mathematical description about Von-mises distribution and EM algorithm can be described as below. 


Von-mises Distribution : 



Theta_0 is mean of distribution.
m is normalization coefficient
I_0(m) is bessel function 



Expectation : 

Maximization : 


In this example, I used audio data that are panned between multiple audio channels.
More detailed description can be found on this paper : PDF 



Instruction :


run the code "RUN_THIS_em_von.m"

Download MATLAB code here :


https://drive.google.com/file/d/0B78FUAKU68mXdlhfd0I3aTJxUFU/view?usp=sharing




Monday, October 20, 2014

[K-means Algorithm] Matlab example code p.424


Description :

This code demonstrates basic K-means Algorithm. 

First, initial code book is defined in the beginning of the code. 
Random data will be generated around this initial code book.
Finally, k-means algorithm will divides and classify through the iteration.

This example file consists of three m files as below.  


kmeans.m
RUN_THIS_kmeans.m
disteusq.m

The k-means algorithm will classify the scattered points with color. 




Instruction :

run the code "RUN_THIS_kmeans.m"

Download MATLAB code here :


https://drive.google.com/file/d/0B78FUAKU68mXUmhlbHd4TW55eTg/view?usp=sharing


Monday, October 13, 2014

LMS (Least Mean Square) Filter Matlab example code


Description :

This code demonstrates LMS (Least Mean Square) Filter. 

(1) lms_test.m 

In this example, we set up two identical signal and 
find a delay that was previously defined by us. (default =50 sample)

in this file, we call the function lms_function.m 

(2) lms_function( target, source, filter_length, mu, h )


target : A target signal that we would like to extract source signal from
source :  Source signal we want to extract
filter_length : Length of LMS filter 
mu : mu value of LMS filter
h : initial filter value 





Instruction :

Extract the uploaded file and 
run the code "lms_test.m"

Download MATLAB code here :


https://drive.google.com/file/d/0B78FUAKU68mXQmZkT2ttU0Z4bUU/view?usp=sharing

Saturday, October 11, 2014

[Mahalanobis distance] Matlab code for chapter 2.3 p.80


Description :

This code demonstrates Mahalanobis distance.

The Mahalanobis distance is a measure of the distance between a point P and a distribution D, introduced by P. C. Mahalanobis in 1936. It is a multi-dimensional generalization of the idea of measuring how many standard deviations away P is from the mean of D. This distance is zero if P is at the mean of D, and grows as P moves away from the mean. (Wikipedia) 






See p. 80 in the text book Pattern Recognition and Machine learning by Christoper Bishop.

Instruction :

run the code "ch2_3_p80_Mahalanobisdistance.m"

Download MATLAB code here :


https://drive.google.com/file/d/0B78FUAKU68mXSnpIek53MTJOV2s/view?usp=sharing




[Maximum Margin Classifier]Matlab code for chapter 7.1 p326

Description :

This code demonstrates Maximum margin classifier in ch 7.1. 

See p. 326 in the text book Pattern Recognition and Machine learning by Christoper Bishop.





Instruction :

run the code "p326_inctrl_Ch07_1_MaximumMarginClassifier.m"

Download MATLAB code here :


https://drive.google.com/file/d/0B78FUAKU68mXdmYxMElFc21FeUU/view?usp=sharing

Wednesday, October 1, 2014

Automatic Speech Recognition MATLAB example for learning purpose (HMM, Baum-welch, etc)


Description :

This code demonstrates a ASR code for learning purpose. 

Caveat ! ) This example code does not perform better than any other well-known ASR software (Spinx, HTK, etc). It is just an example code for learning purpose. And, do not use this example code for any commercial use. 


I offer this matlab example for a learning purpose and impart a few piece of knowledge about Baum-welch algorithm , viterbi algorithm, and Hidden Markov Model which consist a traditional, typical ASR system. 

Hope you would feel helpful with this example code. 

Instruction :

run the code "RUN_THIS"


there are two folders in the uploaded compressed file. 
1. VOICEBOX : This one is very good tool box for speech/audio processing. 
In this example code, I have used several functions from VOICEBOX toolbox. 

refer to this like for further information about VOICEBOX  : http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html

2. WAVDATA
In this folder I included a speech corpus that was recorded by myself. (Yes it is Spturtle's voice)
The matlab code I uploaded should run with this folder existing in the main directory. 


Download MATLAB code here :

https://drive.google.com/file/d/0B78FUAKU68mXNkxIM2hqR0dXckU/edit?usp=sharing

Gradient descent Algorithm matlab example

Description :

This code demonstrates gradient decent algorithm.
In this example, I set up a very simple function.
From initial point (-5,5), the algorithm let the point move toward a maximum point.
I recommend you to modify tau and initial point X(:,1) to see how it changes.






Instruction :

run the code "gradient_descent.m"

Download MATLAB code here :


https://drive.google.com/file/d/0B78FUAKU68mXZ0NidzRXY1E3bVE/view?usp=sharing


When terminal is not starting in Ubuntu

Untitled Document.md When terminal in Ubuntu is not starting gnome-termial crashes with python 3.6 update. Go to /usr/bin/gnome-termi...