Sunday, August 10, 2008

Both.Session6

We decided to make modified file by ourself because our goal is putting data in every 8bits ( but we didn’t have enough information about that program which is explained in last session ).
To hide data we wrote in this program ( in an M-file ):
data=wavread ('1');
data=data*256*256;
data=uint16(data);
r=randint(22046*2,1);
for i=1:22046
bitset(data(i),1,r(i));
bitset(data(i),9,r(22046+i));
end
data=double(data)
data=data*(1/(256*256));
wavwrite(data,22046,'2');
 Certainly this program has some problems that we should solve them.
For hiding data , first we should read a *.wav file and show it 8bits -8bits.now we use wavread(). This instruction gives some values(vectors): vector of data, vector (or amount ) of the bits using for exhibiting each of data and the frequency of sampling .( we use only from data because we have other value but if we have an input with unknown parameters we have to use other values ).
We have a problem in this step,because in the vector of data we have 16bits data but we need 8bits data . now we continue without paying attention to this problem .
Then we multiple data vector by 256*256 to have signed num instead of double num . after that, we made a random vector, that the 0 and 1 have same probablity , as our bit string with rand(m,n) that m=frequency of sampling & n=1 . in next step , by using a loop we hide data in original data vector . in this loop we use from bitset() to change less value bit in every 8bit to our bit string .we should attend to 2 points:
  1. Because we have 16 bits in each row of data vector ,so we should have 2*Fs numbers ,
  2. In bitset() we couldn’t use negative num , we have to change our data to unsigned format .
Now we have a modified data but for having a vector like original one we do as follow:
First change format to double . then multiple data by1/(256*256) .after that make *.wav file by wavwrite() ( to use wavwrite() you should give correct frequency ).we listen to this file .it is similar to original but because of deleting negative num its quality wasn’t very good.

To do list for next session :

  1. Find out how we can read data 8bit-8bit ,
  2. Editing our program to get input ,
  3. Solve the problem of setbit ( there are two suggestion :first sum data with a constant number and after change minus data from that constant num ,second use from two’s complement),
  4. Plot histogram and find the possible changes.