how to filter quantization uncertainty

what is the best option to filter data with quantization uncertainty.if the curve bounces between two values before an edge. what I want is to have the mean of upper and lower value, which is not possible with med1 median filter, because the median of e.g. 99*upper value + 100*lower value is lower value and not the mean. what filter returns the mean while preserving sharp edges?
thanks for your help!

回答 (1 件)

Star Strider
Star Strider 2015 年 10 月 21 日

0 投票

Assuming I understand your Question, I would use a moving average filter. Experiment with the length to get the result you want:
s = [5 + randi([0 1], 1, 20) 4:-1:0]; % Create Data
t = 0:length(s)-1;
N = 4; % Filter Length
b = ones(1,N);
a = N;
sf = filtfilt(b, a, s);
figure(1)
plot(t, s)
hold on
plot(t, sf)
hold off
grid
axis([xlim 0 10])

カテゴリ

質問済み:

2015 年 10 月 21 日

編集済み:

2015 年 10 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by