Flexible downsampling?

Post Reply
christina
Posts: 1
Joined: Fri Jan 30, 2009 9:44 pm
Location: US

Flexible downsampling?

Post by christina »

I would like to combine Biosemi data collected at 1024 Hz with older data collected at 250 Hz in a single analysis. For various reasons, including the size of the datafiles and the analysis I'm doing, it would be best to downsample the new data rather than upsample the old data.

I have previously used the decimator utility available on the download page of the biosemi website to decimate my data collected at 1024 Hz to 256 Hz, but I'm wondering whether it would be possible to modify the utility to allow downsampling to 250 Hz?

Coen
Site Admin
Posts: 1125
Joined: Fri Mar 26, 2004 7:00 pm
Location: Amsterdam, Netherlands
Contact:

Post by Coen »

The utility is written in open-source LabVIEW version 8.2. The code is available form our website, and can quite easily be modified by yourself (for labVIEW, see http://www.ni.com/labviewse/select.htm).

The utility processes blocks of one second, or 1024 samples in you case. Delete 24 approximately equally spaced samples to get a block of 1000 samples, and decimate this to 250 samples with the existing 5th order decimation filter. This is a quick-and-dirty method, and will introduce a little distortion because the sample points are not perfectly equally spaced anymore (maximal skew of approx 1 millisecond with a sample period of 4 millisecond).

The proper way to re-sample would be to interpolate between each pair of samples, and then to re-sample from 1024 to 100 Hz with the sample points on the correct place of the interpolated curve. However, it is unlikely that such a precision is needed in your case.

Best regards, Coen (BioSemi)

Post Reply