Find discontinuities and lift up or pull down the part after the discontinuity

조회 수: 12 (최근 30일)
lena kappa
lena kappa . 2021년 12월 13일
댓글: Jan . 2021년 12월 24일
Hi everyone i have a singal with discontinuities.Does anyone know how can i find the discontinuities and at those points lift up or pull down the remaining signal?
  댓글 수: 3
Jan 2021년 12월 14일
I do noit see the steps in your diagram.

댓글을 달려면 로그인하십시오.

채택된 답변

Jan 2021년 12월 13일
x = linspace(1, 10*pi, 200);
y = sin(x);
y(60:90) = y(60:90) + 1;
y(120:180) = y(120:180) - 1;
yOrig = y;
limit = 0.2;
dy = [0, diff(y)];
jump = strfind(abs(dy) > limit, [false, true, false]);
for ijump = 1:numel(jump)
k = jump(ijump);
y(k+1:end) = y(k+1:end) - dy(k+1);
axes('NextPlot', 'add')
plot(x, yOrig, '-r', x, y, 'bo')
y2 = lowpass(y, 30, 200);
plot(x, y2, 'c+')
  댓글 수: 8
Jan 2021년 12월 24일
@lena kappa: See the documentation of lowpass:
y = lowpass(x,fpass,fs) specifies that x has been sampled at a rate of fs hertz. fpass is the passband frequency of the filter in hertz.
The result is stable over a wide range of parameters.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2021년 12월 13일
  댓글 수: 5
Image Analyst
Image Analyst 2021년 12월 15일
I guess those were just some parameters to cause a chunk of the waveform to shift by a reasonable amount.

댓글을 달려면 로그인하십시오.


Help CenterFile Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by