sdr-0.1.0.5: A software defined radio library

Safe HaskellNone
LanguageHaskell2010

SDR.Util

Contents

Description

Various utiliy signal processing functions

Synopsis

Classes

class Mult a b where Source

A class for things that can be multiplied by a scalar.

Methods

mult :: a -> b -> a Source

Instances

Num a => Mult a a Source 
Num a => Mult (Complex a) a Source 

Conversion to Floating Point

interleavedIQUnsigned256ToFloat :: (Num a, Integral a, Num b, Fractional b, Vector v1 a, Vector v2 (Complex b)) => v1 a -> v2 (Complex b) Source

Create a vector of complex floating samples from a vector of interleaved I Q components. Each input element ranges from 0 to 255. This is the format that RTLSDR devices use.

interleavedIQUnsignedByteToFloat :: Vector CUChar -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but written in C and specialized for unsigned byte inputs and Float outputs.

interleavedIQUnsignedByteToFloatSSE :: Vector CUChar -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but written in C using SSE intrinsics and specialized for unsigned byte inputs and Float outputs.

interleavedIQUnsignedByteToFloatAVX :: Vector CUChar -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but written in C using AVX intrinsics and specialized for unsigned byte inputs and Float outputs.

interleavedIQUnsignedByteToFloatFast :: CPUInfo -> Vector CUChar -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but uses the fastest SIMD instruction set your processor supports and specialized for unsigned byte inputs and Float outputs.

interleavedIQSigned2048ToFloat :: (Num a, Integral a, Num b, Fractional b, Vector v1 a, Vector v2 (Complex b)) => v1 a -> v2 (Complex b) Source

Create a vector of complex float samples from a vector of interleaved I Q components. Each input element ranges from -2048 to 2047. This is the format that the BladeRF uses.

interleavedIQSignedWordToFloat :: Vector CShort -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but written in C and specialized for unsigned byte inputs and Float outputs.

interleavedIQSignedWordToFloatSSE :: Vector CShort -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but written in C using SSE intrinsics and specialized for unsigned byte inputs and Float outputs.

interleavedIQSignedWordToFloatAVX :: Vector CShort -> Vector (Complex Float) Source

Same as interleavedIQUnsigned256ToFloat but written in C using AVX intrinsics and specialized for unsigned byte inputs and Float outputs.

Scaling

scaleC Source

Arguments

:: Float

Scale factor

-> Vector Float

Input vector

-> MVector RealWorld Float

Output vector

-> IO () 

Scale a vector, written in C

scaleCSSE Source

Arguments

:: Float

Scale factor

-> Vector Float

Input vector

-> MVector RealWorld Float

Output vector

-> IO () 

Scale a vector, written in C using SSE intrinsics

scaleCAVX Source

Arguments

:: Float

Scale factor

-> Vector Float

Input vector

-> MVector RealWorld Float

Output vector

-> IO () 

Scale a vector, written in C using AVX intrinsics

scaleFast :: CPUInfo -> Float -> Vector Float -> MVector RealWorld Float -> IO () Source

Scale a vector. Uses the fastest SIMD instruction set your processor supports.

Misc Utils

cplxMap Source

Arguments

:: (a -> b)

The function

-> Complex a

Input complex number

-> Complex b

Output complex number

Apply a function to both parts of a complex number

quarterBandUp Source

Arguments

:: (Vector v (Complex n), Num n) 
=> Int

The length of the Vector

-> v (Complex n) 

Multiplication by this vector shifts all frequencies up by 1/4 of the sampling frequency