- 1、本文档共6页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基于GA和MP的信號稀疏分解matlab程序
基于GA和MP的信号稀疏分解
%% MATLAB script for MP algorithm based on FFT
%
%
%******************** Preparation part *****************************
%
%************************** part 1:imput signal ***************************
Im=wavread(FEM);
Im=Im;
%**************************** part 2: set parameters ***********************
f1=50;
f2=160;
fs=200;
iterative_number=100; % the matching pursuit processing iterative number
[a,N]=size(Im); % the longth of signal and the longth of atoms; N
a_base=2; % scale: the scale is determined by a and j;
j_min=0;
j_max=log2(N);
u_base=1/2; % the transmission or displacement u should determined as following
v_base=pi; % the frequency v
k_min=0;
w_base=pi/6; % the phase w
i_min=0;
i_max=12;
%%************************ initialization ********************************
signal=Im;
signal_reconstruct=zeros(1,N);
signal_r=Im;
%*************** wipe off the direct current vector *************************
signal_reconstruct=(1/N)*sum(signal);
signal_r=signal-signal_reconstruct;
%*********************start calculation*********************************
for n=1:iterative_number
% ********the following program uses one subroutine to select the best atom**************
[proj,scale,translation,freq,phase]=gas(signal_r,N,a_base,j_min,j_max,u_base,p_min,v_base,k_min,w_base,i_min,i_max);
%******reconstruct the best atom from the parameters got by above subroutine*********
t=0:N-1;
t=(t-translation)/scale;
g=(1/sqrt(scale))*exp(-pi*t.*t).*cos(freq*t+phase);
g=g./sqrt(sum(g.*g)); %normalizatiom the atom
%***********reconstruct signal and renew the residual**********************
signal_reconstruct=signal_reconstruct+proj*g;
signal_r=signal_r-proj*g;
%************************* the figure of result ************************
subplot(221);
plot(signal); % original siganl
subplot(222);
plot(g); %the atom
subplot(223);
plot(signal_r); %the residual
subplot(224);
plot(signal_reconstruct); %reconstruct signal
end
% *************
文档评论(0)