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

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 - am demodulator

⚠ Please read Expectations within this Organization before using it.

Go Reference Go Report Card




This section is empty.


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


This section is empty.


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.


Path Synopsis

Jump to

Keyboard shortcuts

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