Skip to content

feat: add real-time FM RDS decoder and visualization panel#10

Open
jLynx wants to merge 5 commits into
mainfrom
rds
Open

feat: add real-time FM RDS decoder and visualization panel#10
jLynx wants to merge 5 commits into
mainfrom
rds

Conversation

@jLynx
Copy link
Copy Markdown
Owner

@jLynx jLynx commented Mar 16, 2026

Description

Summary

This PR implements a full Radio Data System (RDS) decoding stack for WFM (Wideband FM) signals. It allows users to view station information such as Program Service (PS) name, RadioText (RT), Program Identification (PI) codes, and Program Type (PTY) directly within the web interface.

Key Changes

1. DSP & Decoding Logic

  • New RDSDecoder class: A high-performance TypeScript implementation of the RDS stack.

  • Uses a Pilot PLL with phasor rotation (complex multiplication) for efficient 19 kHz locking without constant trigonometric calls.

  • Implements a 4th-order Butterworth low-pass filter for RDS baseband (I/Q) to ensure signal integrity.

  • Features a sync state machine for block synchronization and CRC error correction using standard RDS generator polynomials.

  • Worker Integration: The decoding is performed within the dsp-worker to prevent UI thread blocking. It extracts the MPX signal and processes the 57 kHz subcarrier coherently.

2. Frontend & UI

  • RDS Panel: Added a new split-view panel:

  • Station Cards (Left): Shows active station metadata (PS, Frequency, PI, PTY, and Traffic flags like TP/TA).

  • Live Log (Right): A scrollable history of received RDS groups/messages.

  • Export/Clear: Added functionality to clear the session log or export the RDS data as a .txt file with timestamps.

  • Icons & Styling: Integrated a new RDS icon in the header and defined specific styles for RDS data types in style.css.

3. State Management

  • Updated VfoParams and VfoState to track RDS toggle status and regional settings (EU vs. NA/RBDS).
  • Modified the connection and rx-stream logic to bridge decoded messages from the worker back to the main application state.

Technical Notes

  • RDS Region Support: Includes support for both European (RDS) and North American (RBDS) PTY labels.
  • Resource Management: Decoders are initialized/destroyed dynamically based on the "Decode RDS" checkbox in the VFO settings to save CPU cycles when not in use.

How to Test

  1. Launch the application and connect to a source (e.g., HackRF).
  2. Open a WFM VFO and tune to a local FM radio station.
  3. Check the "Decode RDS" box in the VFO settings.
  4. Click the RDS icon in the top navigation bar to open the decoder panel and observe the incoming data.

jLynx added 5 commits March 16, 2026 20:44
- Added RDS methods for toggling the panel, handling messages, clearing data, and exporting logs in `rds.ts`.
- Updated application state to include RDS properties in `state.ts`.
- Enhanced DSP worker to process RDS signals and extract relevant data in `dsp-worker.ts`.
- Introduced RDS panel in the UI with controls for clearing and exporting data in `index.html`.
- Styled RDS components in `style.css` for better user experience.
- Implemented RDS decoder logic in a new `rds.ts` file within the worker directory.
- Updated backend to manage RDS decoder instances and handle RDS-related parameters in `backend.ts`.
- Integrated RDS decoding into the RX stream processing in `rx-stream.ts`.
- Updated types to include RDS message structure and decoder state in `types.ts`.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
browsdr 802c3c3 Commit Preview URL

Branch Preview URL
Mar 16 2026, 08:36 AM

@jLynx jLynx changed the title Rds feat: add real-time FM RDS decoder and visualization panel Mar 16, 2026
@jLynx
Copy link
Copy Markdown
Owner Author

jLynx commented Mar 16, 2026

Before I merge this, I would like to fix the lag issue that happens when we open up console

@jLynx
Copy link
Copy Markdown
Owner Author

jLynx commented Mar 16, 2026

Does this work on the client side for a hosted HackRF?

@doubleailes doubleailes mentioned this pull request Apr 15, 2026
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant