pypore.file_converter module

Created on Jan 28, 2014

@author: @parkin

pypore.file_converter.convert_file(filename, output_filename=None)[source]

Convert a file to the pypore .h5 file format. Returns the new file’s name.

pypore.file_converter.filter_file(filename, filter_frequency, out_sample_rate, output_filename=None)[source]

Reads data from the filename file and uses a Butterworth low-pass filter with cutoff at filter_frequency. Outputs the filtered waveform to a new pypore.filetypes.data_file.DataFile.

Parameters:
  • filename (StringType) – Filename containing data to be filtered.
  • filter_frequency (DoubleType) – Cutoff frequency for the low-pass Butterworth filter.
  • out_sample_rate (DoubleType) – After the data is filtered, it can be resampled to roughly out_sample_rate. If out_sample_rate <= 0, the data will not be resampled.
  • output_filename (StringType) – (Optional) Filename for the filtered data. If not specified, for an example filename=’test.mat’, the default output_filename would be ‘test_filtered.h5’
Returns:

StringType – The output filename of the filtered data.

Usage:

>>> import pypore.file_converter as fC
>>> fC.filter_file("filename", 1.e4, 1.e5, "output.h5") // filter at 10kHz, resample at 100kHz