



全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
附录D利用FFT实现基于MP的信号稀疏分解参考程序% MATLAB script for MP algorithm based on FFT%* Preparation part *%* part 1:imput signal *%read signal data (to be processed)% Here we can input different types of data, to check the program.% In this example, we read one signal data from disk, which is saved in the% format: save bat.dat bat -asciiload bat.dat _ascii;signal=bat;%*part 2: set parameters *iterative_number= 30 ; % the matching pursuit processing iterative numbera,N=size(signal); % the length of signal and the length of atoms; Nsignal_reconstruct=zeros(1,N);signal_r=signal;a_base=2; % scale: the scale is determined by a and j;j_min=0;j_max=log2(N); u_base=l/2; % the transmission or displacement u should determined as followingv_base=pi; % the frequency vk_min= 0 ;w _base=pi/ 6; % the phase wi_min= 0 ;i_max= 12 ;%*wipe off the direct current vector *signal_reconstruct=( 1 /N)*sum(signal);signal_r=signal-signal_reconstruct;%* create dictionary *atoms=dic_a(signal_r,N,a_base,j_min,j_max,u_base,v_base,k_min,w_base,i_min,i_max%* start calculation *for n=1: iterative_numbern% *the following program uses one subroutine to select the best atom*proj,scale,translation,freq,phase=select_best(signal_r,N,a_base,j_min,j_max,u_base,v_base, k_min,w_base,i_min,i_max,atoms);%*reconstruct the best atom from the parameters gotted by above subroutine*t=0:N-1;t=(t-translation)/scale;g1=(1/sqrt(scale)*exp(-pi*t.*t).*cos(freq*t+phase);g=g1/sqrt(sum(g1.*g1);%* 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 siganlsubplot( 222 );plot(g); %the atomsubplot( 223 );plot(signal_r); %the residualsubplot( 224 );plot(signal_reconstruct); %reconstruct signalend% * end of main program file *% * the following is the atom dictionary creation program*function atoms=dic_a(signal_r, N, a_base, j_min, j_max, u_base, v_base, k_min, w_base, i_min, i_max)% this subroutine is to create the dictionary% INPUT% the signal_r:the signal or the residual of the signal to be decomposed% the N: the length of the signal or of the residual of the signal or the length of the atoms% parameters :the parameter to construct the dictionary, it has much influence on the%speed of the decomposition%OUTPUT% atoms:the dictionarysize_dic=1;atoms=zeros(size_dic,N);% * creat dictionary *for j=j_min:j_maxfor k=k_min:2(j+1)for i=i_min:i_maxsize_dic=size_dic+1; %the munber of atomss=a_basej; %scale of the atomu=N/2; % transmission of the atomv=k*(1/s) * v_base; %frequency of the atomw=i*w_base; %phase of the atomt=0:N-1;t=(t-u)/s;g=(1/sqrt(s)*exp(-pi*t.*t).*cos(v*t+w); %generate the atomg=g/sqrt(sum(g. *g); %normalizationatoms(size_dic,:)=g;endendend%* end of the dictionary creation subroutine program*% *the following is the best atom selecting subroutine program using FFT*Function projscale,translation,freq,phase=select_best(signal_r,N,a_base.j_minj.ubase, v_base.k_min,w_base,i_min,i_max,atoms)% this subroutine is to select in the dictionary the best atom suited the siganl or the %residualof the signal using FFT to reduce computational time% INPUT% the signal_r:the signal or the residual of the signal to be decomposed% the N: the longth of the signal or of the residual of the signal or the length of the atoms% parameters :the parameter to construct the dictionary , it has much influence on the%speed of the decomposition%OUTPUT% proj: the projection of the signal or the residual of the signal on the best atom% the scale: the scale of the best atom (s in the formula)% the translation : the translation of the best atom (u in the formula)% the freq:the frequency of the best atom (v in the formula)% phase: the phase of the best atom (w in the formula)% proj_trans :to determine which projection is biggest%*intializtion* m n=size(atoms);re=zeros(5,m);proj_trans=0;proj=0;size_dic=0;%*selcet the best atom*for j=j_min:j_maxfor k=k_min:2(j+1)for i=i_min:12size_dic=size_dic+1;g=atoms(size_dic, N:-1:1);co=real(ifft(fft(signal_r,2*N).*fft(g,2*N);recon=co(N/2+1):3*N/2);proj_trans e=max(abs(recon);proj_trans=rccon(e); %choose the biggest projectionre(:,size_dic)=proj_trans j e k i;endendendse=r
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025贵州民族大学高层次人才引进85人模拟试卷有答案详解
- 2025福建三明大田县公开招聘紧缺急需专业教师7人模拟试卷及1套完整答案详解
- 2025年煤炭综合采掘机械设备项目发展计划
- 2025广东清远市英德市建筑工程检测站有限公司招聘员工1人模拟试卷有完整答案详解
- 2025江苏常州市钟楼区卫生健康系统定向招聘农村订单定向医学毕业生1人考前自测高频考点模拟试题带答案详解
- 2025年西藏自治区烟草专卖局(公司)招聘(29人)模拟试卷(含答案详解)
- 2025广西南宁市青秀区发展和改革局招聘2人模拟试卷及答案详解(必刷)
- 2025年装订活动及印刷用附件项目合作计划书
- 2025广东广州市中山大学孙逸仙纪念医院超声科医教研岗位招聘考前自测高频考点模拟试题有答案详解
- 2025年宝应县卫生健康系统事业单位公开招聘专业技术人员37人考前自测高频考点模拟试题及答案详解(考点梳理)
- T-CDHA 20-2024 T-CAR 20-2024 供热碳排放核算和碳排放责任分摊方法
- 6G移动通信的关键技术与未来发展
- 辅警考试试题500题及答案
- 入驻京东协议合同
- 园区保洁员操作流程内容
- 周晓枫《潮汐》阅读答案
- 自媒体招生培训
- 徐州市城市轨道交通1号线一期工程电动客车运营、修理及维护手册
- 制作并观察植物细胞临时装片教学设计(五篇模版)
- 导游证《中国古代建筑》知识考试(重点)题库(含答案)
- 《大气的组成和垂直分层》
评论
0/150
提交评论