Monday, June 2, 2014

HTKBook Tutorial and Solutions

While re-creating the chapter 3 of the HTK I encountered the following problems and the solutions to the those problems when I found them

1. The 'gram' file copy the text shown the book into a file 'gram.txt' and run the following command
HParse gram.txt wdnet


2. HSlab does not work showing the following error " MakeXGraf: Not compiled with X11 support" 

Step1. Open htk/HTKLib/htik_htklib_nt.mkf

          Change HGraf.null.obj -> HGraf_WIN32.obj
          Change HGraf.null.olv -> HGraf_WIN32.olv
          Run "nmake /f htk_htklib_nt.mkf all" under HTKLib directary
Step2. Open htk/HTKTools/Makefile.in
           Delete -lXll (lower case of "L")
           Run "nmake /f htk_htktools_nt.mkf all" under HTKTools directory

Found a awesome site which lists all the common error noticed when using HTK. Here is the link for your benefit: HTK Problems and Solutions

Note: The tutorial given in the HTKBook it misses one thing which training dataset. It suggests using TIMIT Database for training. But TIMIT is not free.

I decided to skip a step and search for pre-trained models available online. First I found this one
http://www.keithv.com/software/htk/us/
But then again this did not work as given, many errors occured in the pronounciation dictonary.

Next I found this one http://www.repository.voxforge1.org/downloads/Nightly_Builds/ which has a nicely trained hmm models along with the respective dictionary which is very helpful. Now note you cannot run the live recogniser with these models because they use the following feature extraction scheme which is "MFCC_0_D_N_Z" , but you can sucessfully use the HVite decoding example given in the tutorial. The accuracy for decoding module is very low using these models since they use features described above but which is only possile using HCompV used for training.

I couldn't find a way to emulate the features using HCopy

The next database I tries was the part of TIMIT database available freely( thanks to MIT) , the link is following MIT TIMIT Corpora . The problem with this I am facing is that the pronounciation dictionary is and label files are not matching and some phoneme are not there.

Hacking my way through HTK, I was told that TIMIT label format needs to be modified quite a bit for use with HTK.

Incase of any queries you can contact me.

Friday, May 30, 2014

HTK

HMM Tool Kit has been around for very long and has many predefined tutorials. But stil I found them a little bit confusing the first time around. This post is for those like me

1. Register on the site , you will get a password
2. Download the HTK source and samples for your respective system( I am using windows 7)
3. Follow this link to build your the source http://htk.eng.cam.ac.uk/docs/inst-win.shtml
4. OR alternatively you can directly download the binaries from the following link
http://htk.eng.cam.ac.uk/ftp/software

Finally run the runDemo.pl to check if your installation is finally complete.

Now we will see how to use these libraries in your C++ Projects, which is what we have to do in the long run. The HTKBook which is the guide for using HTK declares in the starting itself that it does not tell how to integrate in some programming evnironment. There is an alternative called ATK.

Note HTK is primarily used for building HMM models and there exists more user friendly tools for testing purposes and HTK HMM Models can generally be converted into other applications HMM Models. Furthermore HTK has been written with speech recognition in mind and I quote my mentor "using HTK for any other application become an uphill battle". I am facing the same in my current project.







Monday, February 3, 2014

Microprocessor 8085

Microprocessors 8085 is one of the earliest microprocessor with wide use in practical applications, though only for learning purposes now. I wish to talk about it's interrupts. It has a total of five interrupts,
i) INTR
ii) RST 5.5
iii) RST 6.5
iv) RST 7.5
v) TRAP

Now there are two fundamentals to be remembered, the interrupts can be disabled and they can be masked there is a difference between the two. When you disable interrupts using the "DI" command ,well they are disabled.
But when you mask any interrupt what basically happens is that the interrupt input is passed through a NAND gate before going to individual flip-flops for each interrupt input. When you mask any interrupt a '0' is passed to NAND thus effectively rendering the output of NAND to '1' when most of the interrupt are edge-triggered or low-level initiated. The masking is done using SIM command. which takes the accumulator value and to set various masks. Every bit in the 8-bit input given to SIM corresponds to masking of a specific interrupt.

One other example I would like to discuss with 8085 is generation of some complex waveform like the sine wave. Unfortunately, calculating each point in the 8085 is cumbersome and roundabout way to precalculate the points and store them in the memory then write a simple program which iterated through the values and displays them.

Hope this helped you learn something more.

Sunday, June 16, 2013

Global Silhouette Matlab

Whenever we cluster we should check the cluster quality but how can we do this ? One of the way to do that is to calculate it's Global Silhouette. It works pretty well for most clustering algorithms.

The basic idea behind global silhouette is what is the quality of separation between the points in one cluster to another cluster's points.

Below is the matlab code for it which uses silhouette() function from matlab .


If you need the code for silhouette or how to calculate s(i) for each data point e-mail me.

Tuesday, May 28, 2013

Matlab Examples

Here is a code for averaging a set of signals, note that my input is taken from a .wav file and thus is of different making it a little more code. This is for who got stuck and can't find a way out.Using the saved .jpeg files you can see how it works visually.



Friday, May 24, 2013

Douglas-Peucker Algorithm

An algorithm for smoothing a 2-d plot . You can read a good explanation of it at wikipedia Wiki Link . Following is the matlab code that I wrote for it: