testutils

package
v0.0.0-...-9809d57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2023 License: MIT Imports: 8 Imported by: 0

README

hz.tools/sdr/testutils

testutils contains some helpers for use in the test suites around the hz.tools ecosystem, as well as places that implement interfaces, such as sdr.Reader, sdr.Writer or fft.Planner.

Documentation

Overview

Package testutils contains some helpers for testing SDR code and other implementations. This can be imported by implementations to ensure that the standard interfaces work as expected.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkFFT

func BenchmarkFFT(b *testing.B, planner fft.Planner)

BenchmarkFFT will run the FFT repeatedly to understand how it performs.

func CW

func CW(buf sdr.SamplesC64, freq rf.Hz, sampleRate int, phase float64)

CW will generate a Carrier Wave at a specific frequency.

func TestFFT

func TestFFT(t *testing.T, planner fft.Planner)

TestFFT will run the standard FFT tests against the provided Planner.

func TestReadWriteSamples

func TestReadWriteSamples(t *testing.T, name string, r sdr.Reader, w sdr.Writer)

TestReadWriteSamples will test that writing a specific number of samples comes out the Reader on the other end.

func TestReader

func TestReader(t *testing.T, name string, r sdr.Reader)

TestReader will check that sample mismatches trigger the correct SDR Errors.

func TestWriter

func TestWriter(t *testing.T, name string, w sdr.Writer)

TestWriter will check that sample format mismatches will trigger the correct sdr errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL