views:

30

answers:

0

i have already wrote the decode coding in Matlab but i know it is wrong because i cant extract hidden message which is .wav from the cover audio, also in .wav format. there are few problems n i cant detect the problem. if the hidden message is text, it easy compared to audio.. that is why i need ur help.

function varargout = gui(varargin) % GUI MATLAB code for gui.fig % GUI, by itself, creates a new GUI or raises the existing % singleton*. % % H = GUI returns the handle to a new GUI or the handle to % the existing singleton*. % % GUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GUI.M with the given input arguments. % % GUI('Property','Value',...) creates a new GUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before gui_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to gui_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help gui

% Last Modified by GUIDE v2.5 30-Sep-2010 12:54:55

% Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @gui_OpeningFcn, ... 'gui_OutputFcn', @gui_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end

if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT

% --- Executes just before gui is made visible. function gui_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to gui (see VARARGIN)

% Choose default command line output for gui handles.output = hObject;

% Update handles structure guidata(hObject, handles);

% UIWAIT makes gui wait for user response (see UIRESUME) % uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line. function varargout = gui_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure varargout{1} = handles.output;

% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile('*.wav','Select a file');
[y,fs,nbits,opts]= wavread([pathname filename]); sound(y, fs); % Playback of the sound data plot(handles.axes1,y);

%open the file with hidden text fid1=fopen([pathname filename],'r'); header=fread(fid1,40,'uint8=>char'); data_size=fread(fid1,1,'uint32');

%read the wave data samples [dta,count]=fread(fid1,inf,'uint16');

%close the file,only wav data samples are sufficient for extracting the text ans=fclose(fid1);

lsb=1;

identity=bitget(dta(1:8),lsb)'; identity=[1 0 1 0 1 0 1 0]

%extract the length of text from first 9th to 28th wav data samples 
len_bin=zeros(20,1);
m_bin=zeros(10,1);
n_bin=zeros(10,1);

m_bin(1:10)=bitget(dta(9:18),lsb);
n_bin(1:10)=bitget(dta(19:28),lsb);

%convert the length to decimal
%len=bi2de((len_bin)');
m=bi2de(m_bin');
   n=bi2de(n_bin');
   len=m*n*8;

   secmsg_bin=zeros(len,1);

%extract the lsb from wave data sample secmsg_bin(1:len)=bitget(dta(29:28+len),lsb); secmsg_bin_re=reshape(secmsg_bin,len/8,8);

   secmsg_double=bi2de(secmsg_bin_re); %convert it to decimal

   secmsg=char(reshape(secmsg_double,m,n));  %convert to char(ASCII)
   %size(secmsg)
   %secmsg=reshape(secmsg,m,n/8);

% --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile('*.wav','Select a file');
[y,fs,nbits,opts]= wavread([pathname filename]); plot(handles.axes2,y);

% --- Executes on button press in pushbutton3. function pushbutton3_Callback(hObject, eventdata, handles) % hObject handle to pushbutton3 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)

[filename, pathname] = uigetfile('*.wav','Select a file');
[y,fs,nbits,opts]= wavread([pathname filename]); plot(handles.axes3,y);

% --- Executes on button press in pushbutton4. function pushbutton4_Callback(hObject, eventdata, handles) % hObject handle to pushbutton4 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA)