新聞中心

EEPW首頁 > 模擬技術 > 設計應用 > ECG信號數(shù)字化處理技術

ECG信號數(shù)字化處理技術

作者: 時間:2011-08-16 來源:網(wǎng)絡 收藏

ECG信號是一維的數(shù)據(jù)。一般被記錄在熱敏紙上。不便于保存和處理??梢韵扔脪呙鑳x,至少300DPI的分辨率,掃描下來。

使用PHOTOSHOP的旋轉將圖旋轉到正確方向。使用魔棒工具 容差50 連續(xù) 將相應圖線選出。反選后將背景的格子顏色,及說明去除。圖像模式改為灰度,去除顏色。再交圖像模式改為位圖。50%閾值。另存成bmp文件。

然后使用下面的程序轉換。bmp文件被讀入MATLAB中,并查找非空邊沿,然后再做一維數(shù)字化。bmp圖像轉換成對應文件名的文本文件,文本文件可以導入EXCEL或其它可以接受數(shù)據(jù)的程序中。數(shù)據(jù)以科學計數(shù)法表示。

% remove blank line and digitalize
% try to find 4 boundery and put it to
% an txt file
% 4 bounder is bup bdown bleft bright
%
% usage: removeblank 'filename' filename must be a bmp file

function y = removeblank( x )
a = imread(x,'bmp');
for i = 1 : length(a(:,1))
if(length(find(a(i,:))) ~= 0)
bup = i;
break;
end
end
for i = length(a(:,1)) : -1 : 1
if(length(find(a(i,:))) ~= 0)
bdown = i;
break;
end
end
for i = length(a(1,:)) : -1 : 1
if(length(find(a(:,i))) ~= 0)
bright = i;
break;
end
end

for i = 1 : length(a(1,:))
if(length(find(a(:,i))) ~= 0)
bleft = i;
break;
end
end;
% 4 boundery found


fid = fopen(['dg',x,'.txt'],'W');

for i = bup : bdown
b = find(a(i, bleft : bright));

if(length(b) == 0)
c(i - bup + 1) = c(i - bup)
else
c(i-bup + 1) = sum(b)/(length(b));
end
fprintf(fid,'%6dn',c(i-bup + 1));

end;
plot(c);
fclose(fid);
%imwrite(a(bup : bdown, bleft : bright),['rb',x] ,'bmp');



評論


相關推薦

技術專區(qū)

關閉