Coder Social home page Coder Social logo

Comments (2)

erikkaashoek avatar erikkaashoek commented on July 28, 2024

See TinySA.org/wiki

from tinysa.

Ho-Ro avatar Ho-Ro commented on July 28, 2024

This is a python snippet that reads raw data from tiny, scaling is done in the last line:

    with serial.Serial( port='/dev/ttyACM0', baudrate=115200 ) as tinySA:
        scan_command = f'scanraw {int(f_low)} {int(f_high)} {N_points}\r'.encode()
        tinySA.write( scan_command )
        echoes = tinySA.read_until( b'{' ) # skip command echoes
        # print( echoes )
        raw_data = tinySA.read_until( b'}ch> ' )

    raw_data = unpack( '<' + 'xH'*N_points, raw_data[:-5] ) # cut trailing '}ch> '
    raw_data = np.array( raw_data, dtype=np.uint16 )
    dBm_power = raw_data / 32 - 128 # scale 0..4095 -> -128..-0.03 dBm

With your value = 1405 -> 1405/32 = 43.9, 43,9 - 128 = -84.1

from tinysa.

Related Issues (20)

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.