I have data corresponding to 300 seconds. Sampling rate is 500Hz. I should have 500*300 = 150000 samples. But due to hardware error, I am receiving a few extra samples. What is the optimal way of removing extra samples obtained to reduce the data to 150000 samples. I can't use all of the samples because data obtained contains many events which are synchronized in time.

  • 3
    $\begingroup$ What are you doing with the data? Many applications aren't particularly sensitive to the sample rate being right on the money. If you application is, you may need to resample it to the correct sample rate. Also, are the samples that you do have taken at uniform intervals? $\endgroup$ – Jason R Jul 27 '16 at 13:19
  • 2
    $\begingroup$ Do you have an accurate record of the time-stamps for each sample, or do you know the exact time interval between each sample? If you do, the optimal way to re-sample to uniformly spaced time instants is via interpolation. If you don't, then my guess is that a semi-optimal solution would be to re-sample from an average uniform rate to the desired rate, as suggested above (also using interpolation, but with erroneous offsets in the time-instants)... [In some applications, the non-uniform sampling is called 'jitter', and it can cause unwanted modulation.] $\endgroup$ – Arnfinn Jul 27 '16 at 13:36
  • $\begingroup$ doe these few extra samples just mean that sampling didn't stop after exactly 300 seconds, or do you really have a sampling rate mismatch of $1+\frac{\text{a few}}{150000}$? $\endgroup$ – Marcus Müller Jul 27 '16 at 15:01
  • $\begingroup$ . . . or does the hardware throw in an occasional "extra" sample? Or are samples occasionally duplicated? Are the extra samples at all useful? We need to know the nature of your "hardware error" in order to know how to compensate. $\endgroup$ – Mark Jul 27 '16 at 23:05
  • $\begingroup$ Yes, the samples are taken at a uniform rate. The problem is that I don't know the exact time instants at which extra samples are introduced so that i can interpolate samples at that time instant. Is it okay to randomly interpolate samples? $\endgroup$ – Anoop Bhushan Jul 28 '16 at 5:28

Depends on for what you need the samples. If you don't need high accuracy of frequency rate for your analysis, it's common to just throw away some samples at the beginning or end of your set to get the needed number.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.