Smoothing data with Filtering

1 回表示 (過去 30 日間)
SS
SS 2017 年 2 月 9 日
編集済み: Image Analyst 2017 年 2 月 10 日
Hi, Please check the attached image. So, I was trying to smoothing the data with filtering. But, in some cases, the value doesn't go up to mark (black circles). Please let me know, how can I fix this problem?
Here is the code I am using now:
FOrd = 400;
fitleredData = filter(ones(1,FOrd)/FOrd,1,inputData);

回答 (2 件)

Image Analyst
Image Analyst 2017 年 2 月 9 日
Obviously if you smooth the data, the smoothed data will never get as high as the peak - otherwise it wouldn't be smoothed now, would it?
Your FOrd should be an odd number, or else you will get a lateral shift in your array, as you are seeing.
  2 件のコメント
SS
SS 2017 年 2 月 9 日
Hi, I know that. However, for this problem, I want the peaks to be same. Is there any way I can do it while filtering? That was my question. If not, what is the best way to matching those peaks (such as using if else)?
Image Analyst
Image Analyst 2017 年 2 月 10 日
編集済み: Image Analyst 2017 年 2 月 10 日
You can detect the peaks and save their values. Then smooth the whole array. Then replace only the peak locations with the peak values, leaving everything else as it is (smoothed).
Also, can you put back your graph to help people understand what we're talking about?

サインインしてコメントする。


John D'Errico
John D'Errico 2017 年 2 月 9 日
A characteristic of virtually any smoothing scheme is it will tend to round over the peaks and valleys. So what do you expect?
  1 件のコメント
SS
SS 2017 年 2 月 9 日
Hi, I know that. However, for this problem, I want the peaks to be same. Is there any way I can do it while filtering? That was my question. If not, what is the best way to matching those peaks (such as using if else)?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by