My signal level is strange.

2 ビュー (過去 30 日間)
Ken
Ken 2012 年 7 月 17 日
x is my .csv file.
I using Pan & Tompkins 1985 QRS detecter paper.
but on the Low-pass filter , My Wave's level is low, not horizontal.
Following is my code.
function a = lowpass(x)
y=zeros(1,length(x));%y=zeros(1,2+length(x));
for n=13:length(x)
y(n) = 2*y(n - 1) - y(n - 2) + x(n)- 2*x(n- 6)+x(n- 12);
end
a=y;
plot(1:length(a),a);
end
My error picture is on here. http://www.flickr.com/photos/82814421@N08/sets/72157630617085494/ Album "MatLAB-question -02"
Top figure is original signal. Bottom figure is after the low-pass's signal.
Who can help me?

回答 (1 件)

Wayne King
Wayne King 2012 年 7 月 17 日
It looks like you are just implementing this difference equation
A = [1 -2 1]; B = [1 0 0 0 0 -2 0 0 0 0 0 1];
y = filter(B,A,x);
where x is the input to the filter and y is the output. Why not just use the above?
Also, your filter is a lowpass filter, but it does not look like a particularly good one, for one thing, it isn't stable.
Is there any reason you have to use this lowpass filter?
That is a lowpass filter, but it's

カテゴリ

Help Center および File ExchangeECG / EKG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by