日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

力科示波器 matlab,有没有人研究过力科示波器的二进制文件(.trc)怎么读取?...

發布時間:2023/12/20 62 豆豆
生活随笔 收集整理的這篇文章主要介紹了 力科示波器 matlab,有没有人研究过力科示波器的二进制文件(.trc)怎么读取?... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

該樓層疑似違規已被系統折疊?隱藏此樓查看此樓

自個兒搞清楚了……不算很難,就是略繁。重點是參照

forums.ni.com/attachments/ni/60/4652/2/LeCroyWaveformTemplate_2_3.pdf

中的格式說明。以下給出代碼(其實可以進一步整理成函數的,我懶得弄了……):

str = OpenRead[(*文件地址*), BinaryFormat -> True];

byte = "Integer8";

word = "Integer16";

long = "Integer32";

string = "TerminatedString";

float = "Real32";

double = "Real64";

SetStreamPosition[str, 0];

lengthofwavedesc = 8;

headlength = StringLength@BinaryRead[str, string] - lengthofwavedesc;

l@wavedesc = read[36, long];

l@usertext = read[40, long];

l@trigtimearray = read[48, long];

l@ristimearray = read[52, long];

l@wavearray = read[116, long];

read[pos_, type_] := (SetStreamPosition[str, headlength + pos]; BinaryRead[str, type])

readlist[pos_, type_, length_] := (SetStreamPosition[str, headlength + pos];

BinaryReadList[str, type, length])

raw = readlist[l@wavedesc + l@usertext + l@trigtimearray + l@ristimearray, byte,

l@dataarray@1];

{vertical@gain, vertical@offset} = readlist[156, float, 2];

data = vertical@gain * raw - vertical@offset;

horizon@interval = read[176, float];

horizon@offset = read[180, double];

rightboundary = horizon@interval (l@wavearray - 1) + horizon@offset;

Close@str;

ListLinePlot[data[[;; ;; 10]], DataRange -> {horizon@offset, rightboundary}]

順便,那個MATLAB的.m文件其實是bug,它在算文件位置的時候丟了一項。(當然這項一般是空的所以通常不會引發問題。)

總結

以上是生活随笔為你收集整理的力科示波器 matlab,有没有人研究过力科示波器的二进制文件(.trc)怎么读取?...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。