Thursday, December 25, 2014

More Is Yet to Come...

Hello Everyone,

Well, It's the end of 3rd semester and I must say this was a hectic one.

So, the most challenging thing I was able to do in this semester was a semester project for one of the subjects as I will describe further.

The project was about comparing audio files and finding a match between them. It wasn't a surprise that it was titled as "Detect Audio Misappropriations". When I first started working on this one I was a bit curious about how an audio file is actually structured from inside except the fact that all data is binary. As I learnt more about different audio file extensions the picture became clear. One thing I liked about this project was the problem statement which was very well structured as it came in bits and pieces every week and I had to dwell in some new concepts. I will try to describe the whole process I followed in the project but one of the concepts I struggled with was Fast Fourier Transform which is a part of Electrical Engineering. I really wish I would have taken some Electrical Engineering classes to form my basics about it. I also feel that I made it tough for myself somehow by writing the algorithm myself. So, this project was a team project and we were suppose to handle 3 file extensions ".wav", ".mp3" & ".ogg".

For any format below was the process:

a) Validate the format by reading its header data (Every format has its header and the header has specific values for each format).
b) If the header was in valid format, the file was converted in a canonical format which apparently was ".wav".
c) Then the audio data of the file was read (samples).
d) 16384 samples were read in each iteration and this was termed as 1 bin of samples.
e) Each sample was processed through Hanning Window and Fast Fourier Transform and a single value was generated for every bin.
f) Further these values were compared for two files to detect a match.

This is actually a brief description of the process and it actually involves some more important concepts which might be too thorough for this post.

While I was working on this project, I also tried to implement one of the great research papers by Haitsma & Kalker (http://ismir2002.ismir.net/proceedings/02-FP04-2.pdf). We were able to implement about 90% of this research paper but we got stuck due to less knowledge about terms such as frequency bands. I would say there is a scope of improvement of what we now have implemented and scope is handling silence in audio.

For now, the developed product takes two directories or files and compares all the files in first directory to all the files in the second directory and reports a match if there is same audio content of more than 5 seconds. Future improvements can be handling silence as I mentioned above.

This process was interesting to come up with and I really thank one of my friends Raymond Li who worked as a great class mate.

Below is the github link to the project:
https://github.com/vishalrajpal/Assignment-7

Please feel free to drop your suggestions. Thanks for reading.

Vishal

Wednesday, August 6, 2014

Heap (Priority Queue) Library

Hello Everyone,

As promised, below is the repository for the Heap Library.

https://github.com/vishalrajpal/Heap

Now the library uses a generic approach and will be more helpful. The repository's README.md file has other helpful information. Feel free to try and implement it. I look forward for your suggestions.

Thanks,
Vishal

Monday, June 23, 2014

Heaps (Max-Min)

Hello Everyone,

Midst the Algorithms class this Summer, we were being taught some efficient Data Structures in terms of handling large Data. One of them was Heaps which is a very interesting one. Our Professor  Zhifeng Sun told us that there are less libraries for Heaps and hence inspired me to right one with almost all the supported operations by Heaps. Though I look forward to improve the library, some applications I found were such as finding a winner among many people and this application can be extended over many other similar applications. With Heaps you can achieve this O(1) time i.e. constant time. It also appeared interesting to me as when working with Multi-Platform mobile applications we generally see that the application takes time to process even 100 records in an array and our aim is to find a single record which satisfies our needs. Heaps can effectively reduce that time from O(n) to O(logn). Though this library for now works only for integers, I am thinking to extend it to <AnyType>. Below is the list of operations supported by the library:

/* Heap Operations
1) DeleteMax/ExtractMax: ------ Running Time: O(logn)
2) Query Max/Min: ------- Running Time: O(1)
3) InsertElement: ----- Running Time: O(logn)
4) Heapify: ----- Running Time: O(logn)
5) Build Heap: ------ Running Time: O(nlogn)
6) Find K Min/Max Elements: ------ Running Time: O(klogn)
*/


The library supports operations for both the Max-Heap and Min-Heap. Below is the github
URL from which you will get a thorough understanding and it can be used as a
plugin/module for PhoneGap & Titanium applications though it might need some additional
work.

https://github.com/vishalrajpal/TestHeap

I look forward for your suggestions on improving it.

Thanks,
Vishal

Saturday, May 31, 2014

PhoneGap 3.x Mobile Application Development Hotshot - Review

Hello folks,

Around 6 months back, I got an opportunity from Packt Publishing to review one of their new books

http://www.packtpub.com/phonegap-3-x-mobile-application-development-hotshot/book

Since, this was the first time for me I was actually not sure about the process and actually was not sure how to review but I think they made me understand the process and I reviewed in the last 6 months.

So, something about the book. It is a great book by author Kerri Shotts and I the book has almost 10-12 practical applications which will really go deep into PhoneGap. They published almost a week before. So if you are interested, a beginner and have some know how of PhoneGap, you can go for it.

Thanks,
Vishal

Monday, April 28, 2014

Student - A Character Revisited

Hello Folks,

First, It feels challenging, sometimes scared and responsible to be a Student again after giving a pause to my work back there in India. While, I am writing this post I got an idea to keep this post as more elaborate with my till-now experience here in Seattle-US.

A great city with a good Spring season (Flowers all around with Sun starring them). So getting back to the title now, It wasn't that easy to incorporate rather recall all those characteristics I had in myself during my student life. I really took some time to go back to past and recall how I took classes, the way I paid attention and the way I dealt with some of the difficult assignments at that time. But this was all in that 1 week before the classes started. Since, I arrived 1 week earlier I got some time to recall them. But after the classes started, its now that I feel I can look around to some other things.

Something about the University: Northeastern University, Seattle is a great to place to study at. India being a country with high traditional values, its not that easy to capitulate those values and just settle quickly at this new land. But, I think the university played a role for me and making me comfortable though slowly and always teaching me lessons on the way. The staff working close with Students (I really think this point is very similar to what APIIT had), good technology infrastructure (I was surprised by the size of the projector in the lecture room, even more when I presented a co-op presentation on it. I will come to what co-op is.... :) ), their hospitality are some good qualities to mention. I think all the reasons I thought had something optimistic in it.

Coming on to the subjects I took:

a) Programming Design Paradigm (PDP)
b) Database Systems (DB)
c) Co-op Seminar (This is what I was talking about above)

I really think that all the three subjects I took in my first semester were really good. PDP of which I will mention some of the assignments we got as examples, DB which sometimes went very deep into the memory calculations we would need to access some data and finally co-op which is about some great behavioral skills to have in you.

Starting with PDP which is a pure programming course based on Scheme programming language had assignments every week. This was no less than 40 hours per week which we generally spend at work.

I know that almost all of you must be familiar of the Pitcher/Jugs problem which is famous being a Google Interview Question. We got an assignment which told us to have some Pitchers and a desired amount and we had to determine the moves in which we could achieve the desired amount. I think this was a great question as I really enjoyed developing it. The whole week, my brain had almost n pitchers with any quantities.



The image above shows an example. Just to explain The solve function takes a list of Pitchers which is one of 8 liters, 5 and 3 respectively and the desired amount is 4 liters. The result is a list of moves where a number is the jug/pitcher number. I would suggest you to try these moves by making an assumption that the first pitcher is initially filled completely and you cannot waste any water, you only have this amount of water. This was the first time I implemented the breadth-first search algorithm which was a good experience.

Another assignment I found interesting was the N-level tree. Try the video below:


So, I press T and a new tree is created, pressing N while a tree is selected creates a new child and d while a tree/child is selected deletes it. I think this was really a good one.

We had almost 10 assignments and its not possible to describe everyone of them here, but these are some good ones.

The Database Systems which also had submissions every week involved concepts such as Indexing, Cost calculation, stored procedures and user-defined functions. I think seeing the course content is what encouraged me to take this subject and it was a good experience.

Some other things I would like to mention is the speed of speaking of native people here in US. It really made me thought when one day, I tried to ask the bus driver if this was the stop I wanted to get down and in spite of asking him 3 times I couldn't grab his answer properly and got down at the stop and more funny thing was that the stop was the wrong one. I think, till the time you try to understand what have they said, its gone. But, I remember the lessons from Asif's Sir class during my under graduation which have helped me a bit. Some picky things such as "(pronunciation of P is Phee not Peee") I hope I am still write.

The next semester is about to begin and the vacation is like it never started. I think gone are the days when during the vacation, I would be at home enjoying the best food in the world. I must say food is one thing I miss almost every time.
I hope you enjoyed reading the post though and as always feel free to give any suggestions on the things mentioned in the post.

Thanks,
Vishal

Monday, January 21, 2013

PhoneGap 2.3.0 Plugin to Extract .zip file

Hi All,

You must be familiar with the PhoneGap plugin to Extract .zip files. As there are some changes for plugin development in version 2.3.0, I have created a new repo for 2.3.0 and the plugin seems to be working after some changes. Below is the repo URL:

https://github.com/vishalrajpal/PhoneGap-ZipFile-Plugin-2.3.0

Thanks,

Tuesday, December 4, 2012

"PotLuck": Guess what do you have in your Pot?

Initiated by Namit and myself..It happened to be a successful gathering with around 40 different dishes and guess what I won't be able to categorize them due to their versatility. "PotLuck" I wasn't knowing the meaning of it though being my 2nd PotLuck lunch at DP, but yes it had to be known. It has a great meaning which says "What do you have in your Pot and that depends on your luck..." isn't that interesting?...











When I was pursuing my B.E, I got various chances to organize such things being in a kind of team, but this was the first instance at DP. I enjoyed a lot and ate up to the brim that afternoon. Thanks to everyone who was a part of such a great gathering and the Photo Session was another unforgettable thing :)