npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

sdrjs

v0.0.6

Published

librtlsdr wrapper for node

Downloads

31

Readme

sdrjs

A wrapper around librtlsdr for node.js

This module depends on librtlsdr, which you can install with most package managers.

Currently only tested on Linux

sdrjs

sdrjs has the following functions:

getDevices()

  • Returns: deviceArray Array Queries and returns the available Devices that are compatible with librtlsdr

Device: Emitter

Properties

Device has the following properties:

Device.deviceName String readonly

The name of the device, for example: Generic RTL2832U OEM

Device.productName String readonly

The product name of the device, for example: RTL2838UHIDIR

Device.manufacturer String readonly

The name of the product's manufacturer, for example: Realtek

Device.serialNumber String readonly

The serial number of the device, for example: 00000001

Device.tunerType String readonly

The tuner's type, possible values: Unknown, R828D, R820T, FC2580, FC0013, FC0012, E4000

Device.validGains Array readonly

An array of valid gain values that the device will accept in manual gain mode.

Device.sampleRate Integer

The device's sample rate in Hz. Also sets the baseband filters according to the requested sample rate for tuners where this is possible. Possible values: 225001 - 300000 Hz, 900001 - 3200000 Hz.

Note form librtlsdr: Sample loss is to be expected for rates > 2400000 Hz.

Device.centerFrequency Integer

The device's center frequency in Hz (the frequency the device is tuned to).

Device.frequencyCorrection Integer

The device's frequency correction value in parts per million (ppm).

Device.rtlOscillatorFrequency Integer

The device's oscillator frequency in Hz.

Device.tunerOscillatorFrequency Integer

The tuner's oscillator frequency in Hz.

Note from librtlsdr: Usually both ICs use the same clock. Changing the clock may make sense if you are applying an external clock to the tuner or to compensate the frequency (and samplerate) error caused by the original (cheap) crystal.

Device.bufferNumber Integer

The buffer number parameter that is used when reading from the device. Set to 0 to reset to default (15).

Device.bufferLength Integer

The buffer length parameter that is used when reading from the device. Must be a multiple of 512, should be a multiple of 16384 (URB size). Set to 0 to reset to default (16 * 32 * 512).

Note from librtlsdr: bufferNumber * bufferLength = overall buffer size

Device.tunerGain Integer

The tuner's gain in tenths of a dB (115 means 11.5 dB). Manual gain mode must be enabled for this to work. Valid values can be read from Device.validGains.

Device.directSampling Enum (String)

Enable or disable the direct sampling mode. When enabled, the IF mode of the RTL2832 is activated, and rtlsdr_set_center_freq() will control the IF-frequency of the DDC, which can be used to tune from 0 to 28.8 MHz (oscillator frequency of the RTL2832). Possible values: disabled, I-ADC, Q-ADC.

Device.offsetTuning Boolean

Enable or disable offset tuning for zero-IF tuners, which allows to avoid problems caused by the DC offset of the ADCs and 1/f noise.

Methods

Device has the following methods:

Device.open() Device

Opens and initializes the device for usage.

Device.close() Device

Closes the device, which is now no longer usable.

Device.start() Device

Starts the thread that reads from the device. While the device is started, setting parameters might not take effect.

Device.stop() Device

Stops the thread that reads from the device.

Device.enableManualTunerGain() Device

Enables the manual tuner gain mode.

Device.disableManualTunerGain() Device

Disables the manual tuner gain mode.

Device.enableTestMode() Device

Enables the test mode. In this mode, an internal counter's value is returned in the buffer instead of real data.

Device.disableTestMode() Device

Disables the test mode.

Device.enableAGC() Device

Enables the internal digital AGC of the RTL2832.

Device.disableAGC() Device

Disables the internal digital AGC of the RTL2832.

Device.setIntermediateFrequencyGain(gain) Device

  • gain Integer - the gain in tenths of a dB. (-30 means -3.0 dB)

Sets the intermediate frequency gain for the device.

Events

Device emits the following events:

Event: 'data'

Returns:

  • bufferData Object
  • buffer Buffer - the raw data read by librtlsdr
  • length Integer - the length of the buffer

Emitted when data is read from the device

Event: 'stopped'

Emitted when the thread that reads from the device stops