A list,

Principle of wavelet transform

Wavelet transform is a time-scale (time-frequency) signal analysis method, a time-frequency localization analysis method in which the size of the window is fixed and the shape of the window can be changed, and the time window and frequency window can be changed. It is characterized by multi-resolution Analysis and has the ability to characterize local signal characteristics in both time and frequency domains.

Wavelet analysis method has high frequency resolution and low time resolution in the low frequency part, and high time partition rate and low frequency partition rate in the high frequency part, so it is known as “mathematical microscope”. It is this characteristic that makes the wavelet transform adaptive to the signal.

Wavelet analysis is as a harmonic analysis for half a century in the field of the mathematical crystallization, has been widely used in signal processing, image processing, quantum field theory, seismic exploration, speech recognition and synthesis, music, radar, CT imaging, color copies, fluid turbulence, object recognition, machine vision, mechanical fault diagnosis and monitoring, fractal and digital TV and other areas of science and technology.

In principle, wherever Fourier analysis has traditionally been used, wavelet analysis can be replaced. The advantage of wavelet analysis over Fourier transform is that it has good localization properties both in time domain and frequency domain.



In this way, the wavelet transform is regulative to the sampling step size of different frequencies in time domain: at low frequency, the wavelet transform has lower time resolution and higher frequency split rate; At high frequency, the temporal resolution of wavelet transform is high, but the rate-like resolution is low. This is consistent with the low frequency signal changes slowly and high frequency signal changes rapidly.

That’s where it’s superior to the classical Fourier transform and the STFT.

Ii. Source code

function varargout = main(varargin)
% MAIN MATLAB code for main.fig
%      MAIN, by itself, creates a new MAIN or raises the existing
%      singleton*.
%
%      H = MAIN returns the handle to a new MAIN or the handle to
%      the existing singleton*.
%
%      MAIN('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MAIN.M with the given input arguments.
%
%      MAIN('Property'.'Value',...). creates anew MAIN or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before main_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to main_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 main

% Last Modified by GUIDE v2. 5 05-Apr- 2021. 22:33:40

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @main_OpeningFcn, ...
                   'gui_OutputFcn',  @main_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 main is made visible.
function main_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 main (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = main_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)%% Select audio [file1, pathName]=uigetfile('*.wav'.'Please select the sample to be identified'); % fname=fullfile(pathname,file1); [X,fs,bits]=wavread(fname); % Read audio file sound(X,fs); % Play sound handles.axes1 
subplot(2.2.1); plot(X); % Display audio file waveform title('Raw audio signal'); 
handles.X=X;
handles.fs=fs;
guidata(hObject, handles);
% --- 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)%% Select watermark [file1, pathName]=uigetfile('*.bmp'.'Please select the sample to be identified'); % fname=fullfile(pathname,file1); key=35; % Number of Arnold replacements as the key Orignalmark=double(imread(fname)); % read64*64[wrow,wcol]=size(Orignalmark);if wrow~=wcol 
    error('wrow~=wcol error'); End % - test key key is beyond the scope of -- -- -- -- -- -- -- -- -- n = check_arnold (wrow);if (key+1) >n
    error('arnold key error');
end


subplot(2.2.2); hold on
imshow(Orignalmark).title('Original image');
handles.Orignalmark=Orignalmark;
handles.n=n;
guidata(hObject, handles);
% --- 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)% % % watermark was embedded into watermark embedding -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- X=handles.X; Orignalmark=handles.Orignalmark; Fs =handles. Fs; % frequency [wrow wcol] = size (Orignalmark); key=35; Arnoldw=arnold(Orignalmark,wrow,key); % Arnold conversion of watermark image [C, L]=wavedec(X, wavedec)2.'db4'); % use db4 wavelet to read the sound file2Ca2 = AppCoef (C, L,'db4'.2); % extract2Low frequency and high frequency coefficients cd2= DetCoef (C, L,2); 
cd1=detcoef(c,l,1); lca=length(ca2); % low frequency length blocksize=fix(lca/(wrow*wcol)); 0 0 0 0 0 0 0 0 0 01,wrow*wcol); % Convert the scrambled watermark to a one-dimensional wlength=wrow*wcol; % Watermark length a=0.25; % quantization step j=1;
for i=1:wlength
    Block=ca2(j:j+blocksize- 1);
    [U,S,V]=svd(double(Block)); 
    cc=floor(S(1.1)/a);  
    if(Arnoldw(i)==1) % embed an odd multipleif(mod(cc,2) = =0)
            cc=cc+1;
        end
        S(1.1)=a*cc;
    end
    if(Arnoldw(i)==0)% is embedded in even multiplesif(mod(cc,2) = =1)  
            cc=cc+1;
        end
        S(1.1)=a*cc;
    end
    Blockw=U*S*V'; %SVD inverse transformation to reduce Ca2 (j:j+blocksize- 1)=Blockw; 
    j=j+blocksize;
end
c1=[ca2',cd2',cd1']';
MarkedX=waverec(c1,l,'db4'); %b is the audio data subplot(2.2.3); 
plot(MarkedX);
title('Audio after embedding watermark'); 
sound(MarkedX,fs);
handles.MarkedX=MarkedX;
handles.key=key;
guidata(hObject, handles);

% --- 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)% watermark embedding -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [c] l=wavedec(X,2.'db4'); % use db4 wavelet to read the sound file2Ca2 = AppCoef (C, L,'db4'.2); % extract2Low frequency and high frequency coefficients cd2= DetCoef (C, L,2); 
cd1=detcoef(c,l,1); lca=length(ca2); % low frequency length blocksize=fix(lca/(wrow*wcol)); 0 0 0 0 0 0 0 0 0 01,wrow*wcol); % Convert the scrambled watermark to a one-dimensional wlength=wrow*wcol; % Watermark length a=0.25; % quantization step j=1;
for i=1:wlength
    Block=ca2(j:j+blocksize- 1);
    [U,S,V]=svd(double(Block)); 
    cc=floor(S(1.1)/a);  
    if(Arnoldw(i)==1) % embed an odd multipleif(mod(cc,2) = =0)
            cc=cc+1;
        end
        S(1.1)=a*cc;
    end
    if(Arnoldw(i)==0)% is embedded in even multiplesif(mod(cc,2) = =1)  
            cc=cc+1;
        end
        S(1.1)=a*cc;
    end
    Blockw=U*S*V'; %SVD inverse transformation to reduce Ca2 (j:j+blocksize- 1)=Blockw; 
    j=j+blocksize;
end
Copy the code

3. Operation results

Fourth, note

Version: 2014 a