packer

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(iniq, outpacked []int16) (int, error)

Compress will write the IQ samples in the "iniq" buffer, and smear every fourth int16 (really int12) into the other 3 int12 values. The output will be written to the output buffer.

func CompressI16

func CompressI16(in, out sdr.SamplesI16) (int, error)

CompressI16 will take our sdr.SamplesI16 type, and take every other imaginary value, and smear the 12 bits of goodness across the other 3 values. This is then repackaged and sent out as if everything is totally normal, totally fine.

func CompressReader

func CompressReader(in sdr.Reader) (sdr.Reader, error)

CompressReader will read an int16 stream of packed 12 bit ints and unpack them into real IQ data.

func CompressWriter

func CompressWriter(out sdr.Writer) (sdr.Writer, error)

CompressWriter will write out int16 (really int12) values packed into int16 values.

func Decompress

func Decompress(inpacked, outiq []int16) (int, error)

Decompress will read the input packed int12 values (packed as per the 'Compress' routine in this same package) and unpack the 4th int16 (really int12) value as its own phasor.

func DecompressI16

func DecompressI16(in, out sdr.SamplesI16) (int, error)

DecompressI16 will take our sdr.SamplesI16 type (under the hood it's a [2]int16 since it contains both the real and imaginary components) and perform a decompression. Every 4th IQ value (which is to say, the last imaginary part) is smeared across the LSB of the other values (assuming this is an int12). This will unpack that last component and re-create well-formed IQ data.

func DecompressReader

func DecompressReader(in sdr.Reader) (sdr.Reader, error)

DecompressReader will unpack 12bit values into i16 values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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