dsp-0.2.2: Haskell Digital Signal Processing

Portabilityportable
Stabilityexperimental
Maintainerm.p.donadio@ieee.org
Safe HaskellSafe-Inferred

DSP.Source.Oscillator

Description

NCO and NCOM functions

Synopsis

Documentation

ncoSource

Arguments

:: RealFloat a 
=> a

w

-> a

phi

-> [a]

y

nco creates a sine wave with normalized frequency wn (numerically controlled oscillator, or NCO) using the recurrence relation y[n] = 2cos(wn)*y[n-1] - y[n-2]. Eventually, cumulative errors will creep into the data. This is unavoidable since performing AGC on this type of real data is hard. The good news is that the error is small with floating point data.

ncomSource

Arguments

:: RealFloat a 
=> a

w

-> a

phi

-> [a]

x

-> [a]

y

ncom mixes (multiplies) x by a real sine wave with normalized frequency wn. This is usually called an NCOM: Numerically Controlled Oscillator and Modulator.

quadrature_ncoSource

Arguments

:: RealFloat a 
=> a

w

-> a

phi

-> [Complex a]

y

quadrature_nco returns an infinite list representing a complex phasor with a phase step of wn radians, ie a quadrature nco with normalized frequency wn radians/sample. Since Haskell uses lazy evaluation, rotate will only be computed once, so this NCO uses only one sin and one cos for the entire list, at the expense of 4 mults, 1 add, and 1 subtract per point.

complex_ncomSource

Arguments

:: RealFloat a 
=> a

w

-> a

phi

-> [Complex a]

x

-> [Complex a]

y

complex_ncom mixes the complex input x with a quardatue nco with normalized frequency wn radians/sample using complex multiplies (perform a complex spectral shift)

quadrature_ncomSource

Arguments

:: RealFloat a 
=> a

w

-> a

phi

-> [Complex a]

x

-> [a]

y

quadrature_ncom mixes the complex input x with a quadrature nco with normalized frequency wn radians/sample in quadrature (I/Q modulation)