In this session we find a useful software named:"hex editor" . you can easily find this software by searching internet. There're lots of free downloads available. In this software we can open "wav" files as "hex" and view the file's bytes and also modify them.
But we should notice that it's not possible to modify every byte we like. Some special bytes are essential for a wav file.
We've studied wav files more carefully. Below is the main explanation for the format of a wav file:( source:http://www.codeproject.com/KB/security/steganodotnet8.aspx )
------------------------------------------------------------------------------------------------------
The Wave File Format
Have you ever looked at a Wave file in a HEX editor? It starts like that, and continues with unreadable binary data:
Every RIFF file starts with the text "RIFF", followed by the Int32 length of the entire file:
The next fields say that this RIFF file contains Wave data and open the format chunk:
The length of the following format chunk must be 16 for PCM files:
Now the format is being specified by a WAVEFORMATEX structure:
data chunk. The data chunk contains all the Wave samples. That means the rest of the file is pure audio data. Little changes might be hearable, but won't destroy the file.
------------------------------------------------------------------------------------------------
Also in this article there's a C# program which can embed esoteric data to a wav file, but the program's download link didn't work.
Another way to create *.wav file from variables is in MATLAB by this instruction:
wavwrite(u,Fs,bits,'filename')
But when using this instruction we should pay attention to give a correct input variable. For example its numbers should be between 1 & -1…
We began to use "stem(data)" instead of "hist(data)" because "hist" only plots some special numbers but "stem" can show all the numbers between 0 and 256 one by one.
Also since MATLAB use to divide numbers by 256, we decided to multiple floating point numbers by 256 instead of 1000. then we add numbers with 100 to have all the numbers positive. After that we count numbers by using two intricate loops. We did all these works in an m-file program which you can see below:
counter=zeros(256,1);
new=pahang*256;
new=round(new);
new=new+100;
for i=0:256
for j=1:22046
if (new(j)==i)
counter(i+1)=counter(i+1)+1;
end
end
end
i=[0:255];
figure;stem(counter)
On the pictures below you can see how "stem" can plot a better histogram of our data.
In Next step, we modified a *.wav file by "hex editor" and then imported it into MATLAB and ran above m-file program on it. Since our changes were'nt very much we couldn't find any critical difference between their histograms. When we looked for any changes in their vectors we made this observation that only first arrays have been changed a little. You can see numbers in the pictures below. First column shows modified audio file vector and second column shows the original one. The third column shows whether they are different or not.( if different 0 and if equl 1 is showed.)
To do list for next session:
- Making a large number of modified files and doing a statistical research on them and find the difference between their histogram and the original file's.
- continue studying matlab-jahad
- Search about this point that whether making all the numbers positive is correct or not.
No comments:
Post a Comment