admin管理员组文章数量:1122832
I use the asammdf python library to read files in MDF4 format and export them to CSV format :
from asammdf import MDF
mdf = MDF("C:/Users/haonf/Downloads/RecordFile_24-11-12_22_11_10_237.mf4")
mdf_cut = mdf.cut(start=0.0,stop=1.0)
mdf_resample = mdf_cut.resample(raster=0.001)
mdf_resample.configure(float_interpolation=1)
mdf_resample.export(fmt='csv',filename='C:/Users/haonf/Downloads/ResampledRecordFile.csv')
The MDF4 file that I want to export contains a signal corresponding to a temperature sampled at 250 Hz (1 sample every 4 ms). I want to export the signal by oversampling to 1 kHz (1 sample every 1ms). The figure below presents the results obtained :
Linear interpolation obtained
Without interpolation, the samples are repeated well to obtain a period of 1ms. With linear interpolation, the samples created are not placed on a line separating two samples of the input signal. I expect to get the results below :
Expected linear interpolation
The results were obtained with version 8.0.1 of the asammdf library. Have I misunderstood how this option works or maybe I'm using it wrong? Thank you in advance for your answers!
本文标签: pythonUsing the asammdf library to resample a signal with linear interpolationStack Overflow
版权声明:本文标题:python - Using the asammdf library to resample a signal with linear interpolation - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310828a1934517.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论