i am working with the pulse oximeter i used the filter given by TI only but its not responding well so please give appropriate solution for it
digital filter code of the TI
int16_t ir_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;}
The code fragment you have shown seems very reasonable. Whether it "responding well" or not depends on the nature of the sample you feed it, the values of the coeffs[], and the correctness of mul16().
What are the values of coeffs[]? What is the nature of the sample? What do you expect this filter to do? What disappointed you?
1. values of coeffs[]
#if 0 static const int16_t coeffs[9] ={ 5225, 5175, 7255, 9453, 11595, 13507, 15016, 15983, 16315};#elsestatic const int16_t coeffs[12] ={ 688, 1283, 2316, 3709, 5439, 7431, 9561, 11666, 13563, 15074, 16047, 16384};#endif
Sir can i use the other from FDA tool of matlab amd also in my signal 50hz strong noise is there using which coeffs i can remove it
2. nature of sample is nothing but one 12 bit ADC value
3. I want to filter my signal because i got the signal using RC passive filter but i have to do digital fitlering so i want this filter to remove all frequencies more then 10Hz
4. using circular method i have done the filter but for the 10Hz cutoff there is so many coeffs generated by the FDA tool of MATLAB . i want minimun number of coeffs for 10hz cutoff low pass filter can u able to help me