【信号处理】基于均分原理的同步信号分割与建模附matlab代码

💥💥💥💞💞💞欢迎来到本博客❤️❤️❤️💥💥💥

📝目前更新:🌟🌟🌟智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真。

                         

                              🎉🎉欢迎您的到来🎉🎉

                ⛅⛅⛅ 📃优快云主页:Matlab科研室🌈🌈🌈

              📚📚📚📋所有代码目录见微信公众号:天天Matlab👨•💻👨•💻👨•💻

1 内容介绍

在本文中,我们提出了一种基于 EquiPartition 原则 (EP) 的信号时间间隔分割方法。 根据 EP,信号被分割成段,在重建中给出相等的误差,选择最合适的模型来描述每个段。 此外,这些片段在内容域中是等效的,因为信号被分割成由相同数量的系数建模的片段。 所提出的方法已成功应用于不同类型的信号,例如:生理、语音、人体运动、金融时间序列。 最后,所提出的方法在误差标准、信号建模和信号维度的变化上非常灵活,从而产生了一种用于信号分割和建模的鲁棒方法。

2 仿真代码

%This code is a simple (not speed optimized) implementation of EP   

% based Simultaneous Segmentation and Modelling of Signals, see papers [1-3]. 

%

close all;

clear all;

S = 7;%number of coefficients 

N = 3;%number of segments 

%mode = 1;  %FFT

%mode = 2;  %Polynomial method

%mode = 3;  %Wavelet method

mode = 4;  %Selection between FFT + Polynomial method + Wavelet (basis selection)

file = 'data\synSignal3Seg-noise_0_025.txt'; %data file

%read data

fid = fopen(file, 'r');

a = fscanf(fid, '%g', [inf]);    

a = a';

fclose(fid);

y = a';

figure;

plot(y);

xlabel('samples');

title('signal');

%compute distance matrix 

warning('off','all');

[d,meth] = getDistanceFromSignal(y,4,S,1);

%write distance matrix 

fileD = sprintf('%s_D.txt',file(1:length(file)-4));

fid = fopen(fileD, 'w');

for i=1:size(d,1),

    fprintf(fid,'%f ',d(i,:));

    fprintf(fid,'\n');

end

fclose(fid);

%%%EP starts

command = sprintf('ep %s %d data\\ epRes_signal4SegN1-noise',fileD,N); 

dos(command);

[Sol1,error1] =  getBestSolution(d,'solutionsEQP.txt',N,1);

[Sol2,error2] =  getBestSolution(d,'solutions.txt',N,2);

if error1 < error2,

    Sol = round(Sol1);

else

    Sol = round(Sol2);

end

fclose(fid);

%Sol stores the best EP solution 

Segments = Sol;

[y_,error,method] =  getReconstruction(y,Segments,mode,S,1);

figure;

hold on;

plot(y,'LineWidth',1.2);

hold on;

plot(y_,'r');

hold on;

%plot(x(points),0,'gs','MarkerFaceColor','g','MarkerSize',6);

for i=2:length(Segments)-1,

    plot([Segments(i) Segments(i)],[min(y) max(y)],'-.k');

end

for i=1:length(Segments)-1,

    if method(i) == 1,

        text(-10+(Segments(i)+Segments(i+1))/2,(min(y)+max(y))/2,'Fourier');

    elseif method(i) == 2,

        text(-10+(Segments(i)+Segments(i+1))/2,(min(y)+max(y))/2,'Polynomial');

    else

        text(-10+(Segments(i)+Segments(i+1))/2,(min(y)+max(y))/2,'Wavelets');

    end 

end

s = sprintf('N = %d,  Error = %2.4f, S = %d ',N,error, S);

title(s); 

legend('Original','Reconstruction','Segmentation');

xlabel('samples');

3 运行结果

4 参考文献

[1] C. Panagiotakis, K. Athanassopoulos and G. Tziritas, The equipartition of curves,Computational Geometry: Theory and Applications, Vol. 42, No. 6-7, pp. 677-689, 2009.

[2] C. Panagiotakis and G. Tziritas, Signal Segmentation and Modelling based on Equipartition Principle,  International Conference on Digital Signal Processing, 2009.

[3] C. Panagiotakis and G. Tziritas, Simultaneous Segmentation and Modelling of Signals based on an Equipartition Principle, 20th International Conference for Pattern Recognition  (ICPR), 2010.

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

5 往期回顾扫扫下方二维码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值