am

package module
v0.0.0-...-1fb86d9 Latest Latest
Warning

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

Go to latest
Published: May 14, 2023 License: MIT Imports: 6 Imported by: 0

README

hz.tools/am - am demodulator

⚠ Please read Expectations within this Organization before using it.

Go Reference Go Report Card

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BroadcastDeviation is the max deviation for AM Broadcast
	// which is 5 KHz (10 KHz bandwidth).
	BroadcastDeviation rf.Hz = 5 * rf.KHz
)

Functions

This section is empty.

Types

type Demodulator

type Demodulator struct {
	// contains filtered or unexported fields
}

Demodulator contains info about

func Demodulate

func Demodulate(reader sdr.Reader, cfg DemodulatorConfig) (*Demodulator, error)

Demodulate will create a new Demodulator, to read FM audio from an IQ stream.

func (Demodulator) Read

func (d Demodulator) Read(audio []float32) (int, error)

Read will (partially?) fill the buffer with audio samples.

func (Demodulator) Reader

func (d Demodulator) Reader() sdr.Reader

Reader will return the underlying reader (TODO: Remove this)

func (Demodulator) SampleRate

func (d Demodulator) SampleRate() uint

SampleRate will return the *audio* sample rate.

type DemodulatorConfig

type DemodulatorConfig struct {
	// Center frequency of the signal in the IQ data.
	CenterFrequency rf.Hz

	// Deviation is the maximum difference between modulated and carrier
	// frequencies. This is half of the total bandwidth.
	Deviation rf.Hz

	// Downsample will define rate to downsample the samples to bring it to
	// a sensible audio sample rate.
	Downsample uint

	// Planner will be used to perform the FFTs used to filter the FM signal.
	Planner fft.Planner
}

DemodulatorConfig will define how the demodulator should decode audio from the iq data.

type Reader

type Reader interface {
	Read([]float32) (int, error)
}

Reader will allow for the reading of AM demodulated audio samples from an IQ stream.

Directories

Path Synopsis
cmd
am

Jump to

Keyboard shortcuts

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