Why does my filtered time series approach zero as time approaches zero?
조회 수: 5 (최근 30일)
이전 댓글 표시
I have some time series data:
I have built the following filter:
% Build filter
f_samp = 1;
f_nyq = f_samp/2;
f_cutoff = 0.1;
cutoff_norm = f_cutoff/f_nyq;
filt_order = 1;
[B,A] = butter(filt_order,cutoff_norm);
x_smooth = filter(B,A,x);
I apply the filter to the data:
From 10 seconds onwards the data is okay but before this it tends towards zero as t tends towards zero. Does anyone know why this is? Is it a charactersitic of the buuterworth filter or all filters?
I would like to know how to remove this characterstic so that the filtered data is accurate during the first few samples.
Thanks.
댓글 수: 0
답변 (1개)
Wayne King
2013년 1월 23일
편집: Wayne King
2013년 1월 23일
It's because your time series have a large mean value, which makes the start-up effects of the filter much more apparent.
Because it's an IIR filter, it's not trivial to calculate exactly what the length of the start-up transient will be. In the case of an FIR filter, the group delay is often constant and easy to correct for.
You can either:
1.) First remove the mean from your data. Assume X is your signal, you can do
X = X-mean(X);
or
X = detrend(X,0);
2.) Use filtfilt() to perform zero-phase filtering, this should alleviate the start-up transient
y = filtfilt(B,A,X);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!