Digitization of noisy signal

6 次查看(过去 30 天)
I have a signal as shown in the image here. I am trying to digitize the signal so that it catches the right jump only. My system is jumping between two states with noise. I want to calculate how much time it stays up and how much down. Could you please bring a super cool idea? Thanks for your help

采纳的回答

Star Strider
Star Strider 2018-2-20
If your have version R2016a or later of the Signal Processing Toolbox, use the findchangepts (link) function.
  8 个评论
suman Dhamala
suman Dhamala 2018-2-21
编辑:suman Dhamala 2018-2-21
Hi Star Strider,
I also tried it and figure out the problem was on the decimal number. I fixed it, can you please try it. Thanks
phi(1)=0.66702; phi(2)= 0.667003; phidc(1)=0;phidc(2)= 0.00001;
for n=2:10^5 ;
p= 0.5.*rand-0.25; q = 1.*rand -0.5 ;
phi(n+1)= 0.0031+ 1.9676*phi(n) -0.9686*phi(n-1)- 0.0039*cos( 0.5*phidc(n))* sin(phi(n)) + 0.0390* q ;
phidc(n+1)= 1.8873*phidc(n) -0.9686*phidc(n-1)- 0.0079*sin(0.5*phidc(n))* cos(phi(n)) + 4*0.0390* p ;
end
figure(1110)
plot(phi)
Star Strider
Star Strider 2018-2-21
Try this:
t = 1:numel(phi);
ipt = findchangepts(phi, 'MinThreshold',1000, 'Statistic','std');
figure(1110)
plot(t, phi)
hold on
plot([t(ipt(1:2:end)); t(ipt(1:2:end))], [zeros(1,numel(ipt(1:2:end))); 5*ones(1,numel(ipt(2:2:end)))], '-r', 'LineWidth',1.5)
hold off
It plots vertical lines at the transitions.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Measurements and Statistics 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by