필터 지우기
필터 지우기

How to adjust data?

조회 수: 4 (최근 30일)
Kacper Suchecki
Kacper Suchecki 2021년 1월 17일
댓글: Star Strider 2021년 1월 20일
Hi,
I need help. I had get data of signal but it doesnt seems good. I want to have straight signal with limit 200 on below and up to 1100 on the top, by only adjusting him not cuting.
I tried something like this .
for x 1:5000005
if x<40000
wspolrzedna(x)=wspolrzedna(x)-100;
end
if x<100000 & x>40000
wspolrzedna(x)=wspolrzedna(x)+200;
end
if x<300000 & x>100000
wspolrzedna(x)=wspolrzedna(x)+300;
end
if x<500000 & x>300000
wspolrzedna(x)=wspolrzedna(x)+500;
end
if x<750000 & x>500000
wspolrzedna(x)=wspolrzedna(x)+750;
end
if x<1000000 & x>750000
wspolrzedna(x)=wspolrzedna(x)+1000;
end
end
I get only something like this. I please for help. Thanks. (The plots plots are built in time scale , the code was write using samples. I have 5000005 samples which i want adjust )

채택된 답변

Star Strider
Star Strider 2021년 1월 17일
It would be easiest to use the detrend function:
t = linspace(0, 100, 1E+4); % Create Data
s = sin(2*pi*t) + 0.001*(t-50).^2; % Create Data
figure
plot(t,s)
grid
s_det = detrend(s, 3); % Detrend Using 3° Polynomial
figure
plot(t, s_det)
grid
.
  댓글 수: 2
Kacper Suchecki
Kacper Suchecki 2021년 1월 20일
Thanks. It's work pretty well.
Star Strider
Star Strider 2021년 1월 20일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spectral Measurements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by