Giter VIP home page Giter VIP logo

measure_oscillo_waveform's Introduction

オシロスコープの波形をUSBTMCで取得する

環境

  • オシロスコープ: Tektronix TDS2012B
  • MacBook Pro 2020

概要

基本的には dat:sou ch1 して dat:enc ribinary して curve? すれば、ch1のバイナリが降ってくる。データ構造は #42500 で始まり、その後はデータ長分(2500個?)バイナリが続く。

このバイナリ構造が厄介。

curve? の戻り値

curve? は基本的に画面座標系の値を返す(positionダイヤルに依存する)ため、プローブが測定した絶対値を求めるにはちょっとした計算が必要になる。

Digital Oscilloscope Series Programmer Manual によれば、時間軸 $X_n$ および電圧 $Y_n$$n$ 番目のデータ $y_n$ を用いて以下の式により算出できる:

$$ \begin{aligned} X_n & = X_0 + X_{inc} \cdot n \\ Y_n & = Y_0 + Y_{mul} (y_n - Y_{off}) \end{aligned} $$

定数 $X_0$ , $X_{inc}$ , $Y_0$ , $Y_{mul}$ , $Y_{off}$ は、波形情報を取得する wfmpre? から取得できる。 wfmp:xze?;xin?;yze?;ymu?;yof? でまとめてもってくることも可能。

これを代入して計算すればいい感じの時間軸と縦軸を算出できる。なお、時間軸は水平トリガをゼロとして左右に正負の値を取る点に注意。

License

This repository is published under MIT License.

measure_oscillo_waveform's People

Contributors

enchan1207 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.