This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS1298R: Question about filtering the signal.

Part Number: ADS1298R
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.

  • Hi Pablo,

    Register settings look fine - is this GNU Octave you are talking about with the ADS1298?
  • Hi Tom. Yes, my project is like this:

    ADS1298R <---(SPI)---> dsPIC <---(RS232)---> PC (GNU Octave to filter and plot)

    By RS232 I receibe the channel 8 data in GNU Octave (without any modification of the data...so it is in two's complement). My question is: can I apply a notch filter (to reduce the 50hz interference) to a data wich is in two's complement (directly from the ADS) or should I modify the data in some way?
    I know it isn't a question related with the ADS1298, it's more a question of digital theory, but I can't find the answer...

    Thank you!.
  • Hi Pablo,

    I'm sorry for the delay here, been a busy couple days... You should not have to transform the data you receive from the ADS1298, but I really don't know anything about the GNU Octave language to tell you what needs to be considered to get the filtering you are looking for.