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:

Wednesday, February 27, 2013

SPOJ:Insertion Sort

The problem asks us to find the number of swaps an insertion sorts does, which in a way is a measure of efficiency of the sort.

The basic logic is answer is the sum of ( for each element the number of elements greater than itself occuring before it .)

One way to implement it is Employ merge sort on it and during each merge operations if you are copying an element from the right array (swaps +=no. of elements in the left array) .

A novice mistake which I made what that I dynamically allocating and de-allocating a temporary array during each merge operation, BEWARE this is a very costly operation and should not be used. Allocate memory once and pass that array .