Tuesday, May 22, 2012

DNA Reshuffled!



From the eyes of a Computer Engineer, I will try to put forth the genetics. 

1.) Lets say we need to fill a register of Genetic code (just like an IP address). For a different person, we need a different code. A code represents a unique person.
For now lets say that there are quadrillion/1000 Trillion different possibilities (considering the fact that current population is just 7billion)
So the no. of bits this register need to have is 50. So, to let you get the feel of this register being the genetic code, Lets say there may be 64 types of eyes, so 6 bits for eyes, 128 different colour of skin, so 7 bits for skin colour, 16000 different face cuts, so 14 bits for face cut and so on..
Now this might let you wonder that 50 bits are such a small register size, and this indeed means that possibility is way over a 1000 Trillion. So God can indeed make more than 10^15/7*10^9 times the population of earth without repeating a single character.

Below is a little illustration of how the IP addresses are allocated, if you know it you can skip it and start reading from  ***STAR***.

2.)The distribution of Ip address to companies done depending how large the chunk you want to give to a particular company. So, Lets say I have an address of 16bits (a total of 64K addresses) and we want to divide it to 32K+16K+8K+8K. So I will fix the first bit to say 0 and give it to company A. fix first 2 bits as 10 and give it to B. and fix first 3 bits as 110 and 111 and give them for use to C and D. Now, A B C D all have 15,14,13,13 bits resp. to vary and hence 32K, 16K, 8K, 8K addresses.

***STAR***

3.) Now lets assume division of Genetic code over 7 continents. Asia is most populated so we have lets say 10 bits fixed for all Asians. Lets say these fixed bits represent colour, nature and all those features that you think are common in all asians. Do the same thing for all the continents.
One can further divide these continents into countries. Lets say Indians and Chinese dont have similar eyes, similar voice etc, but are similar in colour etc.
So lets fix 10 bits between Chinese and Indians. So in total Indians and chinese are more similar than an Indian and American coz they have 20 bits in common rather than 10 bits.

4.) Now lets go up to the illustration of the company (2), Suppose the company initially bought more no. of IP addresses than it uses, then those extra bits are being wasted. And no one can use those IP addresses.
Similar is the case with genetic code, the continents whose population is less are not able to fill up that big gap of available genetic diversity.

5.) Now, the child bears the genetic code which is intermediate value of the genetic code of its parents. Because the child will either pick up the characteristic of its father or its mother, thus giving it an overall intermediate value.

6.) Now the Hypothesis is that if the Parents are genetically very diverse, say belonging to different continents, then only we can fill up those intermediate gaps inbetween. Because we are only using a very small fraction of the available genetic code. only 7 billion reside on earth when the possibility is as large as quadrillion, So it will be better for human race that all these 7 billion genetic codes that we are using right now are very sparse apart rather than being chunked up.

So inter racial marriages and children are the need of the hour!! go for it!!

Saturday, January 21, 2012

Shannon!

One can predict, predict and predict unless the residue becomes perfect noise and that is the limit of compression, the Shannon limit!!

Saturday, January 14, 2012

Denoise it!!


This algorithm may not be very competent but it still gave appreciable results as I made them on my own without any background on image processing. What I have done is, First found out the irregular value in 3X3 matrix, which could possibly be noise. By irregular value I mean, the value which is 20 (this factor can be varied to study its effect) units farther from its neighborhood. Then we substitute the mean of regular values in the matrix to the irregular value.

Below is the MATLAB code for the same and in the end the result. A 3 to 4dB gain in PSNR is observed. Cheers!!



a=imread('plane.jpg');
sze=1200;
a=a(1:sze,1:sze,:);
b=imnoise(a,'gaussian');
c=b;
d=a;


for rgb=1:3
  rgb                       % for R, G and B matrices
  for i=2:sze-1
    i;
    for j=2:sze-1
      z=0;
      arr=zeros(3,3,3);
      for l=1:3
        for n=1:3     % if statement for neighborhood
          pqr=0;      % limit
 if((c(i-2+l,j-2+n,rgb))-c(i,j,rgb)<20 && (c(i-2+l,j-2+n,rgb))-c(i,j,rgb)>-20)
        z=z+1;
        pqr=1;
        arr(l,n,rgb)=c(i-2+l,j-2+n,rgb);   
        end
      end
    end
    c(i,j,rgb)=round((9/z)*(mean(mean(arr(1:3,1:3,rgb)))));
    end
 end 
end
imwrite(b,'3noised.png');
imwrite(a,'3original.png');
imwrite(c,'3noise+myalgo.png');

error_diff = c - b;          
decibels=20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR after reduction= +%5.2f dB',decibels)
error_diff = b - a;
decibels=20*log10(255/(sqrt(mean(mean(error_diff.^2)))));
disp(sprintf('PSNR of noised image = +%5.2f dB',decibels))
original Image
Noised Image
Noised image, denoised!


Quater image denoised


removed noise!!

Thursday, January 5, 2012

The Colours!!

See the world around us! Its beautiful, isn't it? Why?
I guess beauty is defined as correct composition of shapes and colors that somehow appears nice to our mind, even if you cant perceive it. Now just look around you and observe the no. of colors you might see. For example I can see my roommate in green jacket, the color of wall of my hostel room - Yellow, the table - Brown, my pillow cover - Blue. I mean we are just covered with millions of colors.
And the strangest thing majority of elements which, surprisingly comprises of more than 99% of Universe, more than 90% of earth's crust, the s and p block elements are either colorless or white. The f block is too radio active to be around us.
So it is d block elements that surround us and adds colors to our life. The surroundings of yours wouldn't be as colorful as they are without the presence of these d block elements. These small percentage mass of earth's crust has somehow become so important that the earth; leave earth, even our imaginations, our dreams wouldn't be as beautiful as they are, so colorful, so beautiful and so happening.  We must respect nature for all it has given to us and keep our search on, to unveil the secrets.