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.

sampling frequency of the sensor tag's accelerometer and gyroscope?

Other Parts Discussed in Thread: CC2541

I am working on a project in which i am making use of the CC2541 sensor tag. I have downloaded the sensor tag app in my i-phone and have obtained the readings for accelerometer and gyroscope in the form of a matrix (i.e. x, y and z axis). Now I need to perform filtering on this data so that i can remove noise from it. I am using a butterworth low pass filter. I need to know the sampling frequency, that i can choose for designing my  filter. How it can be selected?

Does the accelerometer and gyroscope of the sensor tag have any sampling frequency by default?

Any help related to this would be highly appreciated.

  • Hi,

    Accelerometer has default sampling frequency of 50 Hz which is in Hardware.

    But in code by default it reads accelerometer data at 1 second. If you have change this interval from application then it'll be your sampling interval for calculation.

    Same is for Gyroscope, default interval is 1 second but application can set an interval for reading the output that'll be sampling period for you.  


    Press "Verify" button if your question is answered 

  • Hi, 

    Thanks for the reply.

    The accelerometer sensor is by default set to an interval of one second in my phone, but even then it is giving three-four readings per second.Can you explain why is this possibly happening and what is the solution to obtain evenly sampled reading .

    Whereas , for gyroscope it is fine ,that  it is giving one reading/second.

    Secondly,so in designing the Low pass filter what should we take our sampling frequency as...50Hz or 1 Hz?

  • Hi,

    I checked into sensorTag code. 

    When you write for period in characteristic, it should change it.

    I don't know how you are getting 3-4 samples in one second. May be you can try by writing characteristics manually by BLE device monitor. 

    For second, In low pass filter, sampling frequency should be 1 Hz.

  • Hi

    Thank you so much for the reply. Actually I can't check manually as I don't have a USB dongle. I am working with i-phone. Is there any option of refreshing the sensor tag? As it is important for me to get evenly timed readings....please help.

    Moreover if I take the sampling frequency of the filter as 1 Hz then can you suggest the cut-off frequency that can be taken? 

  • I again changed the accelerometer period in my i-phone to 1 sec but then took the readings, but still the accelerometer is giving three readings in 1 second. On the other hand gyroscope is providing the correct readings- i.e 1 reading/sec. I urgently need a solution as to what can be done to correct the accelerometer  so that I can receive evenly timed readings from it.  My project deadline is nearby, please help me as soon as possible. Its really urgent.

    any help would be greatly appreciated.

  • Hi,

    I guess you can take a look at firmware. In accelerometer service, when you write 1 , it's received as 1 or not? but you'll need to connect to debugger and put breakpoint in accel callback function in sensorTag,c file.

    You should also try with other values, like 2 , 3,4. Check for which value is it giving 1 sample per second.

  • Hey , Thank you so much.

    We will try doing this once we get the debugger.

    Another thing is that once i get the readings I transfer them in my laptop and apply the simple  MATLAB code on it just to plot the readings of the sensor tag.

    Can you tell me that the graph that we obtain on MATLAB, whether it is in frequency domain or time domain?