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.
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.