Hi,
I have tied to make a Pulsoximeter so firstly I read some materials in TI Designs.
And now I have several questions about it:
1.The FIR filter for removing 50/60Hz and 100/120Hz from the signals
I think it is designed by using the MATLAB or other tools.
I want to understand the example FIR filter so I want to know how to design it.
The codes are shown below:
//FIR filter coefficient for removing 50/60Hz and 100/120Hz from the signals #if 0 static const int16_t coeffs[9] = { 5225, 5175, 7255, 9453, 11595, 13507, 15016, 15983, 16315 }; #else static const int16_t coeffs[12] = { 688, 1283, 2316, 3709, 5439, 7431, 9561, 11666, 13563, 15074, 16047, 16384 }; #endif int16_t vs_filter(int16_t sample) { static int16_t buf[32]; static int offset = 0; int32_t z; int i; //Filter hard above a few Hertz, //using a symmetric FIR. //This has benign phase //characteristics */ buf[offset] = sample; z = mul16(coeffs[11], buf[(offset - 11) & 0x1F]); for (i = 0; i < 11; i++) z += mul16(coeffs[i], buf[(offset - i) & 0x1F] + buf[(offset - 22 + i) & 0x1F]); offset = (offset + 1) & 0x1F; return z >> 15; }
2.About the DC current match:
In the PDF A Single-Chip Pulsoximeter Design Using the MSP430, it says
For each wavelength of light, the DC value is removed from the signal leaving the AC part of the signal, which reflects the arterial oxygenation level. The RMS value is calculated by averaging the square of the signal over a number of heart beat cycles. The DC measurement is continuously calculated by averaging the signals over a number of heart beat cycles. The driving strength of each LED is controlled so that the DC level seen at the PIN diode meets a set target level with a small tolerance. By doing this for each LED, the final results is that the DC levels of these two LED match one another to within a small tolerance.
It seems that we should make the DC current For each wavelength of light equal to each other and then compare the AC components.
But I read the program and find it matches the original ADC values rather the DC components after the filter.
vs_sample = ADC12MEM0; //Read the visible LED results if (vs_sample > FIRST_STAGE_TARGET_HIGH || vs_sample < FIRST_STAGE_TARGET_LOW) { // We are out of the target range //display_correcting(1, 1); if (vs_sample > FIRST_STAGE_TARGET_HIGH) { if (vs_sample >= FIRST_STAGE_TARGET_HIGH_FINE) vs_LED_level -= FIRST_STAGE_STEP; else vs_LED_level -= FIRST_STAGE_FINE_STEP; if (vs_LED_level < 0) vs_LED_level = 0; } else { if (vs_sample < FIRST_STAGE_TARGET_LOW_FINE) vs_LED_level += FIRST_STAGE_STEP; else vs_LED_level += FIRST_STAGE_FINE_STEP; if (vs_LED_level > 4095) vs_LED_level = 4095; } }
I don't know which is better/right?
I am looking forward for your kind help.
-Di