Other Parts Discussed in Thread: ADS1298,
Hello. I'm receiving data of an ADS1298 (with a dsPIC, to a PC) and trying to filter the 50hz noise of the data, in Octave.
The current setting of the ADS1298 is:
/* CONFIG1 (pag. 67 HD) */ #define HR 1 // High resolution mode #define DAISY_EN 0 // Daisy-chain mode #define CLK_EN 0 // Oscillator clock output disabled #define DR 0b110 // 500SPS /* CONFIG2 (pag. 68 HD) */ #define INT_TEST 1 // Test signals are generated internally (1) #define TEST_AMP 0 // 0 = 1 × ?(VREFP ? VREFN) / 2400 V #define TEST_FREQ 0b00 // 00 = Pulsed at fCLK / 2^21 /* CONFIG3 (pag. 69 HD) */ #define PD_REFBUF 1 // 1 = Enable internal reference buffer #define VREF_4V 0 // 0 = VREFP is set to 2.4 V #define RLD_MEAS 0 // #define RLDREF_INT 1 // 1 = RLDREF signal (AVDD ? AVSS) / 2 generated #define PD_RLD 1 // 1 = RLD buffer is on #define RLD_LOFF_SENS 0 // 0 = RLD sense is disabled /* CHnSET (ON) (pag. 71 HD) - definiciones para un canal encendido */ #define PD_ON 0 // 0 = Normal operation #define GAIN_ON 0b110 // PGA gain: 12 #define MUX_ON 0b000 // Normal input electrode /* CHnSET (OFF) (pag. 71 HD) - definiciones para un canal apagado */ #define PD_OFF 1 // 1 = Channel power-down #define GAIN_OFF 0b001 // PGA gain: 1 #define MUX_OFF 0b001 // Channel input: shorted /* RLD_SENSP (pag. 72 HD) */ #define RLD8P 1 // 1: Enabled /* RLD_SENSN (pag. 73 HD) */ #define RLD8N 1 // 1: Enabled #define SINGLE_SHOT 0 // 1 = Single-shot mode
I'm using only the channel 8. In Octave I receive three bytes with the data in two's complement. Then I apply a stopband filter with the following code:
% Removing 50hz noise f1 = (47 / 180)*pi(); % 47hz f2 = (53 / 180)*pi(); % 53hz coef_fir_50hz = fir1(64,[f1 f2],'stop'); % coef for the stopband filter data_to_plot = filter (coef_fir_50hz,1,data_from_ADS1298); Then plot...
The question is: Is it correct to apply the fir filter (if I'm doing it right...I've never did that in the past) to the two's complement data? or should I conditionate the data in some way before aply the filter?
Are correct my register settings?
Thank you.