dsp-0.1: Haskell Digital Signal ProcessingContentsIndex
DSP.Source.Oscillator
Portabilityportable
Stabilityexperimental
Maintainerm.p.donadio@ieee.org
Description
NCO and NCOM functions
Synopsis
nco :: RealFloat a => a -> a -> [a]
ncom :: RealFloat a => a -> a -> [a] -> [a]
quadrature_nco :: RealFloat a => a -> a -> [Complex a]
complex_ncom :: RealFloat a => a -> a -> [Complex a] -> [Complex a]
quadrature_ncom :: RealFloat a => a -> a -> [Complex a] -> [a]
Documentation
nco
:: RealFloat a
=> aw
-> aphi
-> [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, cumlative 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.
ncom
:: RealFloat a
=> aw
-> aphi
-> [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_nco
:: RealFloat a
=> aw
-> aphi
-> [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_ncom
:: RealFloat a
=> aw
-> aphi
-> [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_ncom
:: RealFloat a
=> aw
-> aphi
-> [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)
Produced by Haddock version 0.8