dsp-0.2.4: Haskell Digital Signal Processing

Copyright(c) Matthew Donadio 19982003
LicenseGPL
Maintainerm.p.donadio@ieee.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

DSP.Source.Oscillator

Description

NCO and NCOM functions

Synopsis

Documentation

nco Source #

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.

ncom Source #

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_nco Source #

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_ncom Source #

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_ncom Source #

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)