1 / 5

BIOMEDICAL INSTRUMENTATION

BIOMEDICAL INSTRUMENTATION. 2012103843 REPORT #9 원지혜. Non-faded Display & QRS Detector. Non-faded Display. static int p=0; static int displayBuffer [1000]; displayBuffer [p]= newdata ; if((++p)==1000) p=0;. 0. 1. 2. 999. 998. erase. ring buffer 구현. paint. QRS Detector.

Download Presentation

BIOMEDICAL INSTRUMENTATION

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BIOMEDICAL INSTRUMENTATION 2012103843 REPORT #9 원지혜

  2. Non-faded Display & QRS Detector Non-faded Display static int p=0; static intdisplayBuffer[1000]; displayBuffer[p]=newdata; if((++p)==1000) p=0; 0 1 2 999 998 erase ring buffer 구현 paint QRS Detector integration ECG Signal LPF HPF ( )2 (미분) BPF Digital Filter Thresholding Decision

  3. LPF & HPF H(Z) = = = y[n]-2y[n-1]+y[n-2]=x[n]-2x[n-6]+x[n-12] 1. LPF(Low Pass Filter) int QRS_LPF(int x) //y[n]=x[n]-2x[n-6]+x[n-12]+2y[n-1]-y[n-2] { static int y1=0, y2=0, x[26], p=12; int y; x[p]=x[p+13]=x; y=x[p]-(x[p+6]<<1)+x[p+12]+(y1<<1)-y2; y2=y1; y1=y; if(--p<0) p=12; return (y>>5); LPF의 출력을 HPF에 입력하여야 함. p 2.HPF(High Pass Filter) int QRS_HPF(int x) //y(n)=x[n-16]-1/32(l[n-1]+x[n]-x[n-32]) { static int l1=0, x[66], p=32; int l; x[p]=x[p+33]=x; l=l1+x[p]-x[n+32]; l1=l; if(--p<0) p=32; return(x[p+16]-(l>>5)); } HPF의 출력을 뒤의 필터의 입력으로 씀. 현재 것까지 13개 필요. 효율적이기 위해 두 배 사용 low pass filter (초기값. 뒤에서부터 저장)

  4. Differentiation & Square x2=x1; x1=x; return(y); } main() { int y1,y2…… d=getdata; y1=QRS_LPF(d); y2=QRS_HPF(y1); y3=QRS_Derivative(y2); } 4. Square(제곱) ① intQRS_Square { return(); } ② intQRS_Abs(int) { if(x<0) return(-x); else return(x); } 3. Differentiation(미분) intQRS_Derivative(int x) //y[n]=x[n]-x[n-1] //y[n]=1/8(2x[n]+x[n-1]-x[n-3]-2x[n-4]) ①간단한 Derivatitive { static int x1=0; int y; y=x-x1;(가장 간단) x1=x; return(y); } ②5 Point Difference { static int x1,x2,x3,x4; int y; y=((x<<1)+x1-x3-(x4<<1))>>3; x4=x3; x3=x2; ①보다 ②가 신호의 변하는 경향을 시간적으로 좀 더 넓게 반영한다. ->신호의 변화 추이에 더 좋다. ① 은 시간이 너무 오래 걸림. 따라서 ② 의 방법으로 구현해본다.

  5. Integration & two channel에서의 low pass filter 5. Integration(적분) int QRS_MWI(int x) (QRS 폭은 보통 100ms) //y(n)=1/32(x[n]+x[n-1]+……+x[n-31]) { static int x[32],p=0; static long sum=0; long ly; int y; if(++p==32) p=0; sum -=x[p]; sum+=x; x[p]=x; ly=(sum>>5); if(ly>32400) y=32400; else y=(int)ly; return y; } d1=GetDatach1(); d2=GetDatach2(); l1=MyLPF1(d1); l2=MyLPF2(d2); int MyLPF1(int x) { static int x1,x2,x3,x4; x4=x3; x3=x2; x2=x1; x1=x; return (y); } MyLPF2에 대해서도 같은 방법으로 함수를 만듦. ※LPF 함수를 두 개 쓰는 이유 하나를 쓰면 두 채널에 하나의 필터를 연결한 것이 됨. 따라서 필터링이 중첩되므로 문제가 됨. 참고) 여기서의 적분= 최근 몇 개의 데이터를 더하는 것 (일정한 폭을 가지는 window를 signal 들어올 때 마다 가지고 다니면서 더함)

More Related