Skip to content

ratheesk/SDRSharp-TimeDomainScope

Repository files navigation

SDR# Time Domain Scope Plugin

A real-time time domain oscilloscope plugin for SDRSharp that visualizes signal waveforms with interactive zoom, pan, matched filtering, and built-in signal generation capabilities.

Frozen Display

Features

Core Visualization

  • Real-time waveform visualization with professional oscilloscope-style display
  • Multiple display modes (I/Q components, Envelope, Both)
  • Auto-scaling amplitude with envelope detection
  • Professional axes with tick marks and labels
  • Interactive grid overlay
  • Mouse wheel zoom (1x to 100x)
  • Click-and-drag pan functionality
  • Adjustable time window (10ms to 200ms)
  • Freeze and save snapshot functionality (PNG, JPG, BMP)

Matched Filter System

  • Real-time correlation-based signal detection
  • Configurable pulse parameters:
    • Pulse width: 0.1ms to 1000ms
    • Duty cycle: 1% to 99%
    • Automatic period calculation
  • Multiple envelope shapes: Square, Raised Cosine, Gaussian
  • Carrier waveform support: None (envelope only), Sine, Square, Triangle, Sawtooth
  • Carrier frequency control: 0 Hz to 10 MHz
  • OOK pattern mode: Generate full ON-OFF cycle templates
  • Two filtering modes:
    • Filter Input Signal: Apply filter to raw carrier
    • Filter Envelope Only: Apply filter to amplitude envelope
  • Quality settings: Fast (optimized) and High Quality (full resolution)
  • Separate filtered output display panel
  • Real-time template visualization
  • Toggle buttons for panel visibility

Signal Generator (Test Mode)

  • Built-in signal generator for testing and development
  • Switchable source: SDR Input or Signal Generator
  • Frequency range: 1 Hz to 10 MHz
  • Four waveform types: Sine, Square, Triangle, Sawtooth
  • Amplitude control: 0% to 100%
  • On-Off Keying (OOK) modulation:
    • Pulse width: 0.1ms to 10000ms
    • Duty cycle: 1% to 99%
    • Real-time period and repetition rate display
  • Nyquist frequency validation with color-coded status:
    • Green: Frequency OK
    • Yellow: Near Nyquist limit
    • Orange/Red: Above Nyquist or aliasing warning
  • Reset functionality

Requirements

  • SDRSharp
  • .NET Framework 4.x
  • Visual Studio 2022/2025 (for building)
  • SDR# SDK for Plugin Developers

Compiling Instructions

  1. Download SDR# SDK

  2. Clone the Repository

   cd path/to/sdrsharp-sdk/SDRSharp
   git clone https://github.com/ratheesk/SDRSharp-TimeDomainScope.git

Note: Clone the repository inside the sdrplugins solution folder

  1. Open and Build

    • Open SDRSharp.sln with Visual Studio 2022/2025
    • Add the SDRSharp.TimeDomainScope project to the solution (if not auto-detected)
    • Set build configuration to Release (or Debug)
    • Build the project (Ctrl+Shift+B)
  2. Locate the DLL

    • The compiled DLL will be in:
      • SDRSharp.TimeDomainScope/bin/Release/SDRSharp.TimeDomainScope.dll
      • or SDRSharp.TimeDomainScope/bin/Debug/SDRSharp.TimeDomainScope.dll

Installation

  1. Copy SDRSharp.TimeDomainScope.dll to your SDRSharp installation directory (where SDRSharp.exe is located)

  2. Edit Plugins.xml in the SDRSharp directory and add the following entry:

<Plugin>
  <Type>SDRSharp.TimeDomainScope.TimeDomainScopePlugin,SDRSharp.TimeDomainScope</Type>
</Plugin>
  1. Restart SDRSharp

Usage

Basic Operation

  1. Open SDRSharp
  2. Click on "Time Domain Scope" in the left panel (under Analysis category)
  3. The plugin will display the real-time waveform of the IQ baseband signal
  4. Tune to your desired frequency and the waveform will update automatically

Display Mode Selection

Use the Display Mode dropdown to choose what to visualize:

  • I Component (Carrier): Shows the In-phase component - you'll see the actual carrier waveform
  • Q Component (Carrier): Shows the Quadrature component
  • Envelope (Magnitude): Shows only the amplitude envelope (ideal for OOK/ASK)
  • Both I & Q: Displays both I (green) and Q (cyan) components overlaid

Time Window Control

  • Use the Time Window slider to adjust the visible time span (10ms to 200ms)
  • Longer windows show more pulses but less detail
  • Shorter windows show fewer pulses but more detail per pulse
  • The time window automatically calculates buffer size based on sample rate

Zoom and Pan Controls

  • Zoom In: Scroll mouse wheel up over the waveform display
  • Zoom Out: Scroll mouse wheel down
  • Pan: Click and hold left mouse button, then drag to pan across the signal
  • Reset View: Double-click anywhere on the display to reset zoom to 1x and center the view

The current zoom level is displayed in the top-right corner of the display

Freeze and Save

  • Click Freeze to pause the live display and capture the current waveform
  • When frozen, the Save Image button becomes enabled
  • Save snapshots in PNG, JPG, or BMP format
  • Timestamps are automatically added to frozen captures
  • Click Unfreeze to resume live display

Matched Filter Operation

The matched filter uses correlation to detect and enhance specific signal patterns.

Basic Setup

  1. Enable the filter: Check the Enable checkbox in the Matched Filter section

  2. Configure pulse parameters:

    • PW (Pulse Width): Set to match your signal's ON duration (in milliseconds)
    • Duty Cycle: Set to match your signal's ON/OFF ratio (percentage)
    • Period: Automatically calculated and displayed
  3. Select envelope shape:

    • Square: Sharp rectangular pulses (most common for OOK)
    • Raised Cosine: Smoother transitions, less ringing
    • Gaussian: Softest edges, best for bandwidth-limited signals
  4. Configure carrier (if your signal has a carrier frequency):

    • Carrier: Select waveform type (None/Sine/Square/Triangle/Sawtooth)
    • Freq: Set carrier frequency in kHz (enabled when carrier is not "None")
  5. Choose filter mode:

    • Filter Input Signal: Apply to raw I/Q data (shows carrier correlation)
    • Filter Envelope Only: Apply to amplitude envelope (best for OOK detection)
  6. View results:

    • Click F button to show/hide filtered output panel
    • Click T button to show/hide template panel
    • Filtered output shows correlation peaks where signal matches template

Advanced Settings

  • HQ (High Quality): Enable for full-resolution filtering (slower but more accurate)
  • OOK Pattern: Generate template with full ON-OFF cycle instead of single pulse

Matched Filter Examples

Example 1: Simple OOK Detection

Signal: 433 MHz remote control
Pulse Width: 0.5 ms
Duty Cycle: 50%
Envelope: Square
Carrier: None (Envelope)
Mode: Filter Envelope Only

Example 2: Carrier-Based Detection

Signal: 1 kHz OOK tone
Pulse Width: 10 ms
Duty Cycle: 50%
Envelope: Square
Carrier: Sine
Freq: 1.0 kHz
Mode: Filter Input Signal

Example 3: Long Pulse Detection

Signal: Weather station
Pulse Width: 100 ms
Duty Cycle: 25%
Envelope: Raised Cosine
Carrier: None
Mode: Filter Envelope Only

Signal Generator (Test Mode)

The built-in signal generator allows testing without external signals.

Basic Operation

  1. Switch source: Change Source dropdown from "SDR Input" to "Signal Generator"
  2. Set frequency: Adjust Freq control (1 Hz to 10 MHz)
  3. Select waveform: Choose Type (Sine/Square/Triangle/Sawtooth)
  4. Adjust amplitude: Use the Amp slider (0-100%)

Frequency Status Indicators

The generator shows color-coded frequency validation:

  • Green (OK): Frequency is well below Nyquist limit
  • Yellow (Near Nyquist): Approaching limit, may see some distortion
  • Orange (Above Nyquist): Frequency exceeds Nyquist limit, will alias
  • Red (Aliasing): Severe aliasing will occur

OOK Modulation

  1. Enable OOK: Check the OOK checkbox
  2. Set pulse width: PW control (in milliseconds)
  3. Set duty cycle: Duty control (1-99%)
  4. Monitor period: Period display shows total pulse period and repetition rate

Example: 10 Hz pulse train

OOK: ✓
PW: 50.0 ms
Duty: 50%
Period: 100.0ms (10Hz)

Testing Matched Filter

Use the signal generator to test your matched filter:

  1. Set signal generator parameters:

    • Frequency: 1000 Hz
    • Type: Sine
    • Amplitude: 80%
    • OOK: ✓
    • PW: 10 ms
    • Duty: 50%
  2. Configure matched filter with identical parameters:

    • PW: 10 ms
    • Duty: 50%
    • Carrier: Sine
    • Freq: 1.0 kHz
    • Envelope: Square
  3. Enable matched filter and observe strong correlation peaks

  4. Click Reset to reinitialize the generator

Clear Buffer

  • Click the Clear button to reset the sample buffer and start fresh

Understanding the Display

Three-Panel Layout

When using matched filtering, the plugin displays up to three panels:

  1. Top Panel: Original signal (I/Q or Envelope)
  2. Middle Panel: Filtered output (correlation result) - toggle with F button
  3. Bottom Panel: Template waveform - toggle with T button

Why You See Lower Frequency Than Transmitted

When viewing carrier signals, you might notice the frequency appears much lower than what you transmitted. This is normal and here's why:

  1. SDR# Downconverts to Baseband:

    • You tune SDR# to your carrier frequency (e.g., 123 kHz)
    • SDR# mixes this with a local oscillator to bring it down to baseband (0 Hz)
    • The IQ samples you're seeing are the baseband signal, not the original carrier
  2. What You're Actually Seeing:

    • If you tuned exactly to 123 kHz → You see DC (0 Hz) or very low frequency
    • If you tuned slightly off (e.g., 123.5 kHz when signal is 123 kHz) → You see a 500 Hz beat frequency
    • The frequency offset = |Tuned Frequency - Signal Frequency|

Example:

  • Signal transmitted at: 123.000 kHz
  • SDR# tuned to: 123.500 kHz
  • Frequency you see: 500 Hz (the difference)

Viewing Options

Option 1: View Baseband Signal (Default - Decimated IQ)

  • Lower sample rate, easier to visualize
  • Shows modulation clearly
  • Default mode, good for most applications
  • See the beat frequency by tuning slightly off-frequency

Option 2: View Actual Carrier (Raw IQ Mode)

To see the actual transmitted carrier frequency, you need to modify the plugin to use Raw IQ:

In TimeDomainScopePlugin.cs, change:

_control.RegisterStreamHook(_processor, ProcessorType.DecimatedAndFilteredIQ);

to:

_control.RegisterStreamHook(_processor, ProcessorType.RawIQ);

Note: Raw IQ mode uses the SDR's full sample rate (e.g., 2.4 MHz), so:

  • You'll need to increase the time window slider range
  • The display will be much faster/denser
  • You'll see the actual carrier frequency (e.g., 123 kHz)

Recommended Settings for Different Applications

For OOK Signal Analysis

Display Settings:

  • Display Mode: Envelope (Magnitude)
  • Time Window: 50-100ms
  • SDR# Mode: AM or RAW
  • Filter Bandwidth: 150-200 kHz

Matched Filter Settings:

  • Enable: ✓
  • PW: Match your signal's pulse width
  • Duty: Match your signal's duty cycle
  • Envelope: Square
  • Carrier: None (Envelope)
  • Mode: Filter Envelope Only

For Carrier Waveform Analysis

Display Settings:

  • Display Mode: I Component (Carrier)
  • Time Window: 10-50ms
  • Tuning: Slightly off-frequency (1-10 Hz)

Matched Filter Settings:

  • Enable: ✓
  • Carrier: Sine (or match your signal)
  • Freq: Set to baseband beat frequency
  • Mode: Filter Input Signal

For FSK/PSK Analysis

Display Settings:

  • Display Mode: Both I & Q
  • Time Window: Adjust based on symbol rate
  • Use Zoom: Focus on symbol transitions

For Signal Generator Testing

Generator Settings:

  • Source: Signal Generator
  • Frequency: 1-10 kHz (good range for testing)
  • Type: Sine
  • Amplitude: 60-80%
  • OOK: ✓ (for pulse testing)

Matched Filter Settings:

  • Match all generator parameters exactly
  • Enable: ✓
  • Observe strong correlation peaks

Signal Types

The plugin can visualize and detect:

  • On-Off Keyed (OOK) signals
  • Amplitude Shift Keying (ASK)
  • Frequency Shift Keying (FSK) - use I&Q mode
  • Phase Shift Keying (PSK) - use I&Q mode
  • Pulse analysis and timing measurements
  • Carrier waveforms (with proper tuning offset)
  • Noise floor visualization
  • Custom pulse patterns with matched filtering

Troubleshooting

General Issues

  • No waveform displayed: Check that SDRSharp is receiving a signal and the plugin is enabled
  • Signal too small: Increase RF gain in SDRSharp or use the auto-scaling feature
  • Plugin not appearing: Verify the DLL is in the correct directory and Plugins.xml is properly configured
  • Build errors: Ensure you have the correct SDR# SDK version and all references are properly set
  • Display too fast/slow: Adjust the time window slider
  • Can't see individual cycles: Switch to I or Q component mode and zoom in

Matched Filter Issues

  • No correlation peaks: Verify filter parameters match your signal exactly
  • Weak correlation: Try enabling High Quality mode or adjusting envelope shape
  • Filter too slow: Disable High Quality mode or reduce time window
  • Template not updating: Check that parameters have actually changed

Signal Generator Issues

  • No output: Verify "Signal Generator" is selected in Source dropdown
  • Frequency warnings: Check Nyquist limit - reduce frequency or switch SDR modes
  • OOK not working: Ensure OOK checkbox is enabled
  • Generator locked up: Click Reset button

Frequency Issues

  • Frequency looks wrong: Remember you're seeing baseband - tune slightly off-frequency to see beat patterns
  • Aliasing in generator: Reduce frequency or increase sample rate

Performance Tips

  • Reduce time window for better frame rate
  • Use Envelope mode for fastest performance
  • Use Fast quality mode for matched filter (default)
  • Raw IQ mode requires more processing power
  • Close other plugins if experiencing lag
  • Disable filtered/template panels when not needed (F/T buttons)

Keyboard Shortcuts

  • Double-click: Reset zoom and pan
  • Mouse wheel: Zoom in/out
  • Click-drag: Pan view
  • F button: Toggle filtered waveform panel
  • T button: Toggle template panel

Author

Rathees Koneswaran

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details.

Acknowledgments

  • Built for SDRSharp by Airspy
  • Inspired by the need for real-time signal analysis tools
  • Matched filtering algorithms based on standard correlation techniques

Version History

See CHANGELOG.md for detailed version history.

Support

For issues, questions, or feature requests, please open an issue on the GitHub repository.


Enjoy your real-time signal analysis with matched filtering capabilities! 📡🔬

About

Real-time time domain oscilloscope plugin for SDRSharp

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages