Smoothing the Data with For Loop (Sliding Window)

조회 수: 6 (최근 30일)
tinkyminky93
tinkyminky93 2023년 2월 3일
답변: Mathieu NOE 2023년 2월 10일
Hello,
I am taking the datas from my sensor and the datas are the multiples of 5.8594 so my whole data looks like a mix of square wave and ramp function. What I want is, smooth the corners of this data with for loop. I want to see exponential-like or sinusoidal-like signal while iterating. I can do it with whole data but can not do it with for loop.
Thank you for your suggestions.
  댓글 수: 2
dpb
dpb 2023년 2월 4일
You don't explain the problem fully nor provide the code illustrate what is what you tried that doesn't work...
Guessing from what wasn't said, if the need is to smooth the data during the collection process as it arrives, then investigate the use of exponential weighting of the input signals as arrive instead of trying to post-process.
Kalman filtering is another technique may be of use here...
Jan
Jan 2023년 2월 5일
"I can do it with whole data but can not do it with for loop." - Why not? what exactly is the problem and what is the purpose to use a loop at all? What do you want to loop over?

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

답변 (1개)

Mathieu NOE
Mathieu NOE 2023년 2월 10일
hello
seems to me smoothdata can do what you need
plot(temperature)
hold on
ts = smoothdata(temperature,'gaussian',30);
plot(ts)

카테고리

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

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by