1 2 3 4 5 200459 200456 2007102856
- Slides: 15
과제 순위 1. 2. 3. 4. 5. 200459 장재필 200456 임명준 2007102856 임영민 2007102854 이준관 2005200439 이지민
생체신호의 실시간 DSP “Setting” ECG 증폭기 + - ADC Micro processor Start H. R : 75 bpm Stop Embedded Software : 특정한 기능을 하는 전자제품에 ( = Firmware) 들어있는 Software
신호처리의 순서도 START Initialization No Key? Yes Mode = Key Digital Signal Processing Display
프로그램에 쓰이는 파일 • • • monitor. c Get. ADC. c Dsp. c my_def. h Initialization. c Key. c
Monitor. c & Get. ADC. c // monitor. c #include my_def. h Int main(){ Init(); while(1){ mode = Key(); switch(mode){ case start; d = Get. ADCData(); dn = Dsp(d); Display signal(d); Display HR(dn); break; default : break; } } return 0; } //Get. ADC. c #include my_def. h Int Get. ADCData(void) { int d; // Read Data from ADC … … … return 0; } // my_def. h # define START 0 xff; # define STOP 0 x 00; # define FALSE 0; # define TRUE 1; // 자주 쓰이는 값들을 하나의 헤더파일에 저장
Initialization. c & Key. c & Dsp. c // Initialization. c Void Init(void) { … … } // 프로그램의 초기값들을 저장 // Dsp. c #include my_def. h Int Dsp(int d) { int d 1, d 2, d 3, d 4; d 1 = lpf(d); d 2 = hpf(d 1); d 3 = differentiate(d 2); d 4 = absolute(d 3); d 5 = mwi(d 4); d 6 = threshould(d 5); d 7 = RR_interval(d 6); d 8 = compute. HR(d 7); return (d 8); } //데이터를 처리해주는 부분, 각각의 함수를 호 출하여 연산을 거친 값을 반환한다. // Key. c #inlcude my_def. h Unsigned char key(void) { if(key_value == 1) return (START); else return (STOP); 새로 키가 눌려지기 전에는 } 이전의 키 값으로 return 해주 는 program을 짜야한다.
mwi() y[n] = ∑x[n-i] = x[n] + x[n-1] + … + x[n-29] // i=0 ~ 29 //mwi() – moving window integral Int mwi(int x) { int y; static int x 1, x 2, x 3, … x 29; y = x + x 1 + x 2 + … + x 29; x 29 = x 28; x 28 = x 27; …. x 2 = x 1; x 1 = x; return (y); } P x 6 x 5 … // mwi() Int mwi(int x) { int y 1; static int y, p, x[30]; if(++p==30) P=0; y=y-x[p]+x; // y: running sum x[p] = x; return(y); } 제일 예전 Data x 제일 예전의 Data에 새로운 Data를 넣는 Program -> Ring buffer 위의 함수는 최근 30개의 Data의 값을 더하여 주는 함수이다.