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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@rfkit/spectrum-analyzer

v0.1.48

Published

A high-performance spectrum analyzer library for RF signal processing, supporting real-time spectrum analysis, waterfall display, and multi-segment frequency scanning

Downloads

637

Readme

@rfkit/spectrum-analyzer

高性能 RF 频谱分析库,支持实时频谱分析、瀑布图显示和多段频率扫描。

提供 JS 版本WASM 高性能版本 两种选择。

安装

pnpm add @rfkit/spectrum-analyzer

使用

JS 版本(默认)

import {
  SpectrumAnalyzer,
  LevelStreamAnalyzer,
  type SpectrumConfig,
  type SpectrumOutputData,
} from '@rfkit/spectrum-analyzer';

const analyzer = new SpectrumAnalyzer({
  maxPoints: 2048,
  outputPoints: 1024,
  enableStatistics: true,
  onSpectrumUpdate: (data) => {
    console.log(data.realData);
  },
});

// 处理频谱数据
analyzer.process({ data: Float32Array, timestamp: Date.now() });

WASM 高性能版本

WASM 版本 API 与 JS 版本完全一致,仅需在应用启动时初始化一次。

import {
  initWasm,
  SpectrumAnalyzer,
  LevelStreamAnalyzer,
} from '@rfkit/spectrum-analyzer/wasm';

// 应用启动时初始化(仅需一次)
await initWasm();

// 之后使用方式与 JS 版本完全一致
const analyzer = new SpectrumAnalyzer({
  maxPoints: 2048,
  outputPoints: 1024,
  enableStatistics: true,
  onSpectrumUpdate: (data) => {
    console.log(data.realData);
  },
});

analyzer.process({ data: Float32Array, timestamp: Date.now() });

性能对比

| 场景 | JS 版本 | WASM 版本 | 提升 | |------|---------|-----------|------| | 8192 点数据 | 0.032 ms | 0.020 ms | 35% | | 2000 点 / 300Hz | 0.023 ms | 0.020 ms | 13% |

两个版本在 300Hz 更新频率下都能轻松满足,CPU 占用 < 1%。

核心组件

SpectrumAnalyzer

频谱分析器,支持:

  • 实时数据处理与重采样
  • 最大值/最小值/平均值统计
  • 瀑布图数据管理
  • 天线因子补偿
  • 模板超限检测
  • 多段频率扫描

LevelStreamAnalyzer

电平流分析器,支持:

  • 电平概率分布统计
  • 时间/点数缓存模式

构建命令

pnpm build          # 构建 JS 版本
pnpm build:wasm     # 构建 WASM 版本
pnpm build:all      # 构建全部

License

MIT