Data logger with accelerometer

Hi, I`m working with analog sensors and I wish to know how can I filter my signal in order to get a more accurate readiing.

Filtering will not make the readings more accurate, it will only reduce the average noise in the signal. If you need more details, do tell which sensors you have.

Thanks for your answer, Im using the ADXL377 of analog devices, it measures +-200G and Im using this sketch.

#include <Wire.h>

#include <I2Cdev.h>

#include <ADS1115.h>

#include <SD.h>


 const int CS = 10;
 int pow_pin = 8;
 File logfile;
 unsigned long time = 0;
 ADS1115 adc;
 ADS1115 adc1(0x49);
 
void error(char *str)
{
  Serial.print("error");
  Serial.println(str);
}

void setup() {
  // open a serial connection
  Wire.begin();
  Serial.begin(38400);
  analogReference(EXTERNAL);
  Serial.println("Iniciando ads1115");
  adc.initialize();
  adc1.initialize();
  Serial.println("Probando coneccion ads");
  Serial.println(adc.testConnection() ? "ADS1115 connection successful" : "ADS1115 connection failed");
  Serial.println(adc1.testConnection() ? "ADS1115b connection successful" : "ADS1115 connection failed");
  Serial.println(" ");
  
  adc.setMode(ADS1115_MODE_CONTINUOUS);
  adc.setGain(ADS1115_PGA_6P144);
  adc.setRate(ADS1115_RATE_860);
  
  adc1.setMode(ADS1115_MODE_CONTINUOUS);
  adc1.setGain(ADS1115_PGA_6P144);
  adc1.setRate(ADS1115_RATE_860);
  
  pinMode(CS, OUTPUT);
  pinMode(pow_pin, OUTPUT);
  digitalWrite(pow_pin, HIGH);
  
  if(!SD.begin(CS))
  {
    Serial.println("Card Failure");
    return;
  }
  Serial.println("card initialized.");
  
  // create a new file
  char filename[] = "LOGGER00.TSV";
  for (uint8_t i = 0; i < 100; i++) {
    filename[6] = i/10 + '0';
    filename[7] = i%10 + '0';
    if (! SD.exists(filename)) {
      // only open a new file if it doesn't exist
      logfile = SD.open(filename, FILE_WRITE);
    }
    
    if (logfile) {
   logfile.print("Tiempo");
   logfile.print("\t");
   logfile.print("X");
   logfile.print("\t");
   logfile.print("Y");
   logfile.print("\t");
   logfile.print("Z");
   logfile.print("\t");
   logfile.print("X1");
   logfile.print("\t");
   logfile.print("Y1");
   logfile.print("\t");
   logfile.println("Z1");
   break;
  } 
  }
  
  Serial.print("Logging to: ");
  Serial.println(filename);
}

void loop() {
  
  float zero_G_xcaja = 8473;
  float zero_G_ycaja = 8551;
  float zero_G_zcaja = 8570;
  float scale_xcaja = 35;
  float scale_ycaja = 35;
  float scale_zcaja = 37;
    
  float zero_G_xmov = 8504;
  float zero_G_ymov = 8533;
  float zero_G_zmov = 8508;
  float scale_xmov = 36;
  float scale_ymov = 36;
  float scale_zmov = 36;
  
  // change the resolution to 16 bits and read A0
  time = millis();
  int sensorOneCounts=adc.getConversionP0GND();
  delay(1);
  int sensorTwoCounts=adc.getConversionP1GND();
  delay(1);
  int sensorThreeCounts=adc.getConversionP2GND();
  delay(1);  
  int sensorOne1Counts=adc1.getConversionP0GND();
  delay(1);
  int sensorTwo1Counts=adc1.getConversionP1GND();
  delay(1);
  int sensorThree1Counts=adc1.getConversionP2GND();
  
  Serial.print("x :");
  Serial.print(sensorOneCounts);
  Serial.print("y :");
  Serial.print(sensorTwoCounts);
  Serial.print("z :");
  Serial.print(sensorThreeCounts);
  Serial.print("x1 :");
  Serial.print(sensorOne1Counts);
  Serial.print("y1 :");
  Serial.print(sensorTwo1Counts);
  Serial.print("z1 :");
  Serial.println(sensorThree1Counts);
  
  logfile.print(time);
  logfile.print("\t");
  logfile.print((sensorOneCounts - zero_G_xcaja) / scale_xcaja);
  logfile.print("\t");
  logfile.print((sensorTwoCounts - zero_G_ycaja) / scale_ycaja);
  logfile.print("\t");
  logfile.print((sensorThreeCounts - zero_G_zcaja) / scale_zcaja);
  logfile.print("\t");
  logfile.print((sensorOne1Counts - zero_G_xmov) / scale_xmov);
  logfile.print("\t");
  logfile.print((sensorTwo1Counts - zero_G_ymov) / scale_ymov);
  logfile.print("\t");
  logfile.println((sensorThree1Counts - zero_G_zmov) / scale_zmov);
  logfile.flush();
  
  delay(10);
}

That sensor is designed to measure extremely large accelerations, as in sudden violent impacts or model rocketry. Why do you think the measurements are "inaccurate" and how do you imagine that filtering will help?

As a general comment, with all that code running to process and store each single measurement, you will not be able to accurately measure and may even miss many significant short-duration peak events. This is particulary important if you are monitoring impacts, in which case you need to rethink the measurement strategy completely. Do you know the loop time for measurements?