! o               ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = >?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ !!!!!!!!!!!!!!""""""""""""#######$%%&'()****+++++++++,,,-../0111111111111223333334555666666777889:::;;;;<=>?@ @ A A A AABBBBBBBBBBBBCDEFF F!F"F#F$F%F&F'F(F)F*F+F,F-F.G/G0G1G2G3G4G5G6H7I8I9I:I;I<I=I>I?I@IAIBICIDIEIFIGIHIIIJIKILIMINIOIPIQIRISITIUIVIWIXIYIZI[I\I]I^I_I`IaIbIcJdJeJfJgJhJiJjKkKlKmKnLoLpLqMrMsMtMuMvMwMxMyMzN{O|O}O~PPPPPPPPQRT(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafedspconv convolves two finite sequences(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafedspraw cross-correllationdspbiased cross-correllationdspunbiased cross-correllationdspraw auto-correllationdspbiased auto-correllationdspunbiased auto-correllationdspxdspydspkdspR_xy[k]dspxdspydspkdsp R_xy[k] / NdspxdspydspkdspR_xy[k] / (N-k)dspxdspkdspR_xx[k]dspxdspkdsp R_xx[k] / NdspxdspkdspR_xx[k] / (N-k)(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe ( dsp(Discrete frequency periodigram maximizer dspX[k]dspkdspw  (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe" dspThe Quinn-Fernandes algorithm dspydspinitial w estimatedspw  (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe$Q dspTHIS DOES NOT WORK  (c) Matthew Donadio 2002GPLm.p.donadio@ieee.org experimentalportableSafe&H dspComplex test data dspReal test data  (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe-@dsp8Implements the following function, which is a FIR filter y[n] = sum(k=0,M) h[k]*x[n-k]We implement the fir function with five helper functions, depending on the type of the filter. In the following functions, we use the O&S convention that m is the order of the filter, which is equal to the number of taps minus one.dsph[n]dspx[n]dspy[n](c) Matthew Donadio 1998GPLm.p.donadio@ieee.org experimentalportableSafe3dspLowpass filterdspHighpass filterdspBandpass filterdspBandstop filterdspMultiband filterdspRaised-cosine filterdspwcdspMdsph[n]dspwcdspMdsph[n]dspwldspwudspMdsph[n]dspwldspwudspMdsph[n]dsp magsdsp wdspMdsph[n]dspwsdspbetadspMdsph[n] (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeL dsp=This is an integrator when a==1, and a leaky integrator when  0 < a < 1. y[n] = a * y[n-1] + x[n]dspFirst order section, DF1 v[n] = b0 * x[n] + b1 * x[n-1] y[n] = v[n] - a1 * y[n-1]dspFirst order section, DF2 w[n] = -a1 * w[n-1] + x[n] y[n] = b0 * w[n] + b1 * w[n-1]dspFirst order section, DF2T v0[n] = b0 * x[n] + v1[n-1]  y[n] = v0[n] v1[n] = -a1 * y[n] + b1 * x[n]dsp(Direct Form I for a second order section ,v[n] = b0 * x[n] + b1 * x[n-1] + b2 * x[n-2] 'y[n] = v[n] - a1 * y[n-1] - a2 * y[n-2]dsp2Direct Form II for a second order section (biquad) (w[n] = -a1 * w[n-1] - a2 * w[n-2] + x[n] ,y[n] = b0 * w[n] + b1 * w[n-1] + b2 * w[n-2]dsp4Transposed Direct Form II for a second order section v0[n] = b0 * x[n] + v1[n-1]  y[n] = v0[n] (v1[n] = -a1 * y[n] + b1 * x[n] + v2[n-1] v2[n] = -a2 * y[n] + b2 * x[n]dspDirect Form I IIR v[n] = sum(k=0..M) b_k*x[n-k] $y[n] = v[n] - sum(k=1..N) a_k*y[n-k]v[n] is calculated with dspDirect Form II IIR $w[n] = x[n] - sum(k=1..N) a_k*w[n-k] y[n] = sum(k=0..M) b_k*w[n-k] dspadspx[n]dspy[n]dspa_1dspb_0dspb_1dspx[n]dspy[n]dspa_1dspb_0dspb_1dspx[n]dspy[n]dspa_1dspb_0dspb_1dspx[n]dspy[n]dspa_1dspa_2dspb_0dspb_1dspb_2dspx[n]dspy[n]dspa_1dspa_2dspb_0dspb_1dspb_2dspx[n]dspy[n]dspa_1dspa_2dspb_0dspb_1dspb_2dspx[n]dspy[n]dsp(b,a)dspx[n]dspy[n]dsp(b,a)dspx[n]dspy[n] !"#$% !"#$% (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeR&dspCascade of functions, eg ,cascade [ f1, f2, f3 ] x == (f3 . f2 . f1) x'dsp Gain node y[n] = a * x[n](dsp Bias node y[n] = x[n] + a)dsp Adder node z[n] = x[n] + y[n]&dsp f_n(x)dspx[n]dspy[n]'dspadspx[n]dspy[n](dspadspx[n]dspy[n])dspx[n]dspy[n]dspz[n]&'()&'() (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeUe*dspPolyphase interpolator*dspLdsph[n]dspx[n]dspy[n]** (c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeW+dsp all zeros,dspsingle impulse-dsp unit step.dspramp+,-.+,-. (c) Matthew Donadio 1998GPLm.p.donadio@ieee.org experimentalportableSafeoL /dsp/ generates a list of values linearly spaced between specified start and end values (array will include both start and end values). 2linspace 0.0 1.0 5 == [ 0.0, 0.25, 0.5, 0.75 1.0 ]0dsp0 generates a list of values logarithmically spaced between the values 10 ** start and 10 ** end (array will include both start and end values). 3logspace 0.0 1.0 4 == [ 1.0, 2.1544, 4.6416, 10.0 ]1dsp2 is the unit delay function, eg, $delay1 [ 1, 2, 3 ] == [ 0, 1, 2, 3 ]2dsp2$ is the n sample delay function, eg, +delay 3 [ 1, 2, 3 ] == [ 0, 0, 0, 1, 2, 3 ]3dsp downsample# throws away every n'th sample, eg, 0downsample 2 [ 1, 2, 3, 4, 5, 6 ] == [ 1, 3, 5 ]5dspupsample+ inserts n-1 zeros between each sample, eg, .upsample 2 [ 1, 2, 3 ] == [ 1, 0, 2, 0, 3, 0 ]7dspupsampleAndHold$ replicates each sample n times, eg, >upsampleAndHold 3 [ 1, 2, 3 ] == [ 1, 1, 1, 2, 2, 2, 3, 3, 3 ]8dspBmerges elements from two lists into one list in an alternating way ;interleave [0,1,2,3] [10,11,12,13] == [0,10,1,11,2,12,3,13]9dsp1split a list into two lists in an alternating way /uninterleave [1,2,3,4,5,6] == ([1,3,5],[2,4,6])It's a special case of .S.:dsp%pad a sequence with zeros to length n )pad [ 1, 2, 3 ] 6 == [ 1, 2, 3, 0, 0, 0 ];dsp generates a  if the given condition holds<dsp7Computes the square of the Euclidean norm of a 2D point=dspTPower with fixed exponent type. This eliminates warnings about using default types./0123456789:;<=/0123456789:;<==8(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafer>dspHalfband interpolator?dspHalfband decimator>dsph[n]dspx[n]dspy[n]?dsph[n]dspx[n]dspy[n]>?>?(c) Matthew Donadio 1998GPLm.p.donadio@ieee.org experimentalportableSafevU@dspCIC interpolatorAdspCIC interpolator@dspRdspMdspNdspx[n]dspy[n]AdspRdspMdspNdspx[n]dspy[n]@A@A(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafew BCDEFGHIJ BCDEFGHIJ(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafezKdspFilter shaprening routineKdsph[n]dsp-function that implements the sharpened filterKK(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeLdsp=The weighted linear predictor form of the frequency estimatorMdsp)WLP using Lank, Reed, and Pollon's windowNdspWLP using kay's windowOdsp(WLP using Lovell and Williamson's windowPdsp2WLP using Clarkson, Kootsookos, and Quinn's windowLdspwindowdspzdspwMdspzdspwNdspzdspwOdspzdspwPdspzdsprhodspsigmadspwLMNOPLMNOP(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeQdsp(Pisarenko's method for a single sinusoidQdspxdspwQQ(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeRdspQuinn's First Estimator (FCI1)SdspQuinn's Second Estimator (FCI2)TdspQuinn's Third Estimator (FCI3)UdspEric Jacobsen's EstimatorVdspMacLeod's Three Point EstimatorWdspMacLeod's Three Point EstimatorXdspRife and Vincent's EstimatorRdspX[k]dspkdspwSdspX[k]dspkdspwTdspX[k]dspkdspwUdspX[k]dspkdspwVdspX[k]dspkdspwWdspX[k]dspkdspwXdspX[k]dspkdspwRSTUVWXRSTUVWX(c) Matthew Donadio 1998,2003GPLm.p.donadio@ieee.org experimentalportableSafezYdspYk 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.ZdspZ mixes (multiplies) x by a real sine wave with normalized frequency wn. This is usually called an NCOM: Numerically Controlled Oscillator and Modulator.\dsp\a 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.]dsp] mixes the complex input x with a quardatue nco with normalized frequency wn radians/sample using complex multiplies (perform a complex spectral shift)^dsp^| mixes the complex input x with a quadrature nco with normalized frequency wn radians/sample in quadrature (I/Q modulation)YdspwdspphidspyZdspwdspphidspxdspy\dspwdspphidspy]dspwdspphidspxdspy^dspwdspphidspxdspyYZ[\]^YZ\]^[(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe_dspJThis is the simple phase unwrapping algorithm from Oppenheim and Schafer._dspepsilondspARGdsparg__(c) Matthew Donadio 1998GPLm.p.donadio@ieee.org experimentalportableSafe `dspApplys a window, w, to a sequence xadsprectangular windowbdspBartlett windowcdspHanning windowddspHamming windowedspBlackman windowfdspGeneralized Hamming windowgdsprectangular windowhdsprectangular window `dspw[n]dspx[n]dsp w[n] * x[n]adspMdspw[n]bdspMdspw[n]cdspMdspw[n]ddspMdspw[n]edspMdspw[n]fdspalphadspMdspw[n]gdspbetadspMdspw[n]hdspMdspw[n] `abcdefgh `abcdegfhTSafek `abcdefgh(c) Matthew Donadio 1998GPLm.p.donadio@ieee.org experimentalportableSafelidspDesigns a lowpass Kaiser filterjdsp Designs a highpass Kaiser filteridspwpdspwsdspdpdspdsdsph[n]jdspwpdspwsdspdpdspdsdsph[n]ijij(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe"kdspAdspbdspxkk(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeZldsplevinson takes an array, r, of autocorrelation values, and a model order, p, and returns an array, a, of the model estimate and rho, the noise power.ldsprdsppdsp(a,rho)ll(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe!mdspDComputes an AR(p) model estimate from x using the Yule-Walker methodndspCComputes an AR(p) model estimate from x using the covariance methododspLComputes an AR(p) model estimate from x using the modified covariance methodpdsp>Computes an AR(p) model estimate from x using the Burg' methodmdspxdsppdsp(a,rho)ndspxdsppdsp(a,rho)odspxdsppdsp(a,rho)pdspxdsppdsp(a,rho)mnopmnop(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe/qdspComputes an MA(q) model estimate from x using the Durbin's method where l is the order of the AR process used in the algorithmqdspxdspqdspldsp(a,rho)qq(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSaferdsp)Type for results of the simplex algorithmvdsp(The simplex algorithm for standard form: min c'xwhere Ax = b, x >= 0 a!(0,0) = -z a!(0,j) = c' a!(i,0) = ba!(i,j) = A_ijwdspThe two-phase simplex algorithmvdspstating tableaudspsolutionwdspstating tableaudspsolutionrstuvwrstuvwSafe`z{|}~z{|}~Safe Safe@dspThe decomposition routine is pretty simple. It does not try to minimize fill-up by a clever ordering of rotations. However, for banded matrices it will work as expected.dspBassumes that the first column is empty except the top-most elementdspThe argument must not be (0,0).dsp Assumes that > matrix is at least as high as wide and that it has full rank.dsp=Solve a sparse overconstrained linear problem, i.e. minimize ||Ax-b||. A must have dimensions m x n with m>=nA and it must have full-rank. None of these conditions is checked.dsp`Only sensible for square matrices, but the function does not check whether the matrix is square.dspNAbsolute value of the determinant. This is also sound for non-square matrices.dspAdspQR(A) !(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafedsp'Matrix-matrix multiplication: A x B = Cdsp'Matrix-vector multiplication: A x b = cdspTranspose of a matrixdsp5Hermitian transpose (conjugate transpose) of a matrixdsp<We need the bounds of the row indices for empty input lists.dspAdspBdspCdspAdspbdspcdspAdspA^TdspAdspA^H"Safedsp Assumes that > matrix is at least as high as wide and that it has full rank.dsp7Solve an overconstrained linear problem, i.e. minimize ||Ax-b||. A must have dimensions m x n with m>=nA and it must have full-rank. None of these conditions is checked.dsp`Only sensible for square matrices, but the function does not check whether the matrix is square.For non-square matrices the sign is not of much use. It depends on the implementation. It is not uniquely defined by requiring that the determinant of the orthogonal transformation has positive sign.dspNAbsolute value of the determinant. This is also sound for non-square matrices.dspAdspQR(A) #(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafedsp&LU decomposition via Crout's Algorithmdsp%Solution to Ax=b via LU decompositiondsp/Improve a solution to Ax=b via LU decompositiondsp%Matrix inversion via LU decompositiondsp,Determinant of a matrix via LU decompositiondspLU solver using original matrixdsp!determinant using original matrixdspGDeterminant computation by implicit LU decomposition with permutations.dspAdspLU(A)dspLU(A)dspbdspxdspAdspLU(A)dspbdspxdspx'dspAdspA^-1dspLU(A)dspdet(A)dspAdspbdspxdspAdspdet(A)dspAdspdet(A)$(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafetdsp Implementation of Prony's methoddsppdspqdspg[n]dsp(b,a)%(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeBdsp*Calculates the Chebyshev approximation to f(x) over [a,b]dsp)Evaluates the Chebyshev approximation to f(x) over [a,b] at xdspf(x)dspadspbdspNdspc_ndspc_ndspadspbdspxdspf(x)&(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeDdspFGenerates a list of binomial random variables from a list of uniformsdspndsppdspUdspX'(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafedspoGenerates a list of exponential random variables from a list of uniforms via the inverse transformation method  F(x) = 1 - exp(-lambda*x)  F^-1(x) = -log(1 - x) / lambdadsplambdadspUdspX((c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe^dspiGenerates a list of gamma random variables from a list of uniforms via the inverse transformation methoddspndsplambdadspUdspX)(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe >dspGGenerates a list of geometric random variables from a list of uniformsdsppdspUdspX*(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeJdspYNormal random variables via the Central Limit Theorm (not explicity given, but see Ross)FIf mu=0 and sigma=1, then this will generate numbers in the range [-n2,n2]dspMNormal random variables via the Box-Mueller Polar Method (Ross, pp 450--452)If mu=0 and sigma=1, then this will generate numbers in the range [-8.57,8.57] assuing that the uniform RNG is really giving full precision for doubles.dsp/Acceptance-Rejection Method (Ross, pp 448--450)If mu=0 and sigma=1, then this will generate numbers in the range [-36.74,36.74] assuming that the uniform RNG is really giving full precision for doubles.dsp>Ratio Method (Kinderman-Monahan) (Knuth, v2, 2ed, pp 125--127)CIf mu=0 and sigma=1, then this will generate numbers in the range  ? -1e15,1e15L assuming that the uniform RNG is really giving full precision for doubles.dspNumber of uniforms to sumdsp (mu,sigma)dspUdspXdsp (mu,sigma)dspUdspXdsp (mu,sigma)dspUdspXdsp (mu,sigma)dspUdspX+(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe"l dsp32 bits in [0,1]dsp32 bits in [0,1)dsp32 bits in (0,1]dsp32 bits in (0,1)dsp-53 bits in [0,1], ie 64-bit IEEE 754 in [0,1]dsp-53 bits in [0,1), ie 64-bit IEEE 754 in [0,1)dsp53 bits in (0,1]dsp53 bits in (0,1)dsp!transforms uniform [0,1] to [a,b] dspXdspUdspXdspUdspXdspUdspXdspUdspXdspUdspXdspUdspXdspUdspXdspUdspadspbdspUdspU' ,(c) Matt Harden 1999GPLm.p.donadio@ieee.org experimentalportableSafe#88-(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe%dspnoisedsp brown noise.(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe*dspKellet's filterdspVoss's algorithmMUNTESTED, but the algorithm looks like it is working based on my hand tests.dspnoisedsp pinked noisedspnumber of octaves to sumdspnoisedsp pinked noise/(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe,`dspnoisedsp purple noise0(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe.(dspnoisedsp white noise1Safe.f 2(c) Matthew Donadio 2002GPLm.p.donadio@ieee.org experimentalportableSafe2 dspCompute the median of a listdspXCompute the center of the list in a more lazy manner and thus halves memory requirement.3(c) Matthew Donadio 2002GPLm.p.donadio@ieee.org experimentalportableSafe:dspCompute the mean of a list Mean(X) = 1/N sum(i=1..N) x_idspCompute the variance of a list Var(X) = sigma^2 % = 1/N-1 sum(i=1..N) (x_i-mu)^2dsp(Compute the standard deviation of a list " StdDev(X) = sigma = sqrt (Var(X))dsp'Compute the average deviation of a list % AvgDev(X) = 1/N sum(i=1..N) |x_i-mu|dspCompute the skew of a list - Skew(X) = 1/N sum(i=1..N) ((x_i-mu)/sigma)^3dspCompute the kurtosis of a list 5 Kurt(X) = ( 1/N sum(i=1..N) ((x_i-mu)/sigma)^4 ) - 34(c) Matthew Donadio 2002GPLm.p.donadio@ieee.org experimentalportableSafe<_5(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeBdspEGenerates a list of poisson random variables from a list of uniforms.dsp7Split after every element that satisfies the predicate.!A candidate for a Utility module.dsp3lambda - expectation value, should be non-negative.dsp4uniformly distributed values from the interval [0,1]dspPoisson distributed outputs6(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeMdspraw cross-covariance-We define covariance in terms of correlation._Cxy(X,Y) = E[(X - E[X])(Y - E[Y])] = E[XY] - E[X]E[Y] = Rxy(X,Y) - E[X]E[Y]dspraw auto-covariance]Cxx(X,X) = E[(X - E[X])(X - E[X])] = E[XX] - E[X]E[X] = Rxy(X,X) - E[X]^2dspbiased cross-covariancedspunbiased cross-covariancedspbiased auto-covariancedspunbiased auto-covariancedspxdspydspkdspC_xy[k]dspxdspkdspC_xx[k]dspxdspydspkdsp C_xy[k] / NdspxdspydspkdspC_xy[k] / (N-k)dspxdspkdsp C_xx[k] / NdspxdspkdspC_xx[k] / (N-k)7(c) Matthew Donadio 2002GPLm.p.donadio@ieee.org experimentalportableSafePdspX1dspX2dsptdspX1dspX2dsptdspX1dspX2dspt8(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeUdsp8Cooley-Tukey algorithm doing row FFT's then column FFT'sdsp8Cooley-Tukey algorithm doing column FFT's then row FFT'sdspx[n]dspnrowsdspncolsdsp FFT functiondspX[k]dspx[n]dspnrowsdspncolsdsp fft functiondspX[k]9(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeW}dspx[n]dspX[k]:(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeZdsp Length 2 FFTdsp Length 3 FFTdsp Length 4 FFTdspx[n]dspX[k]dspx[n]dspX[k]dspx[n]dspX[k];(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeadsp'Goertzel's algorithm for complex inputsdsp1Power via Goertzel's algorithm for complex inputsdsp$Goertzel's algorithm for real inputsdsp.Power via Goertzel's algorithm for real inputsdspx[n]dspkdspX[k]dspx[n]dspkdsp|X[k]|^2dspx[n]dspkdspX[k]dspx[n]dspkdsp|X[k]|^2<(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafed`dsp8Prime Factor Algorithm doing row FFT's then column FFT'sdspx[n]dspnrowsdspncolsdsp FFT functiondspX[k]=(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafegdsp#Radix-2 Decimation in Frequency FFTdspx[n]dspNdsp FFT functiondspX[k]>(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeidspRadix-2 Decimation in Time FFTdspx[n]dspNdsp FFT functiondspX[k]?(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafelbdsp#Radix-4 Decimation in Frequency FFTdspx[n]dspNdsp FFT functiondspX[k]@(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafepYdsp*Rader's Algorithm using direct convolution dsp'Rader's Algorithm using FFT convolutiondspx[n]dspNdspX[k] dspx[n]dspNdsp FFT functiondspX[k]  A(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe| dsp{This is the driver routine for calculating FFT's. All of the recursion in the various algorithms are defined in terms of  . dsp;Inverse FFT, including scaling factor, defined in terms of   dsphThis is the algorithm for computing 2N-point real FFT with an N-point complex FFT, defined in terms of   dsprThis is the algorithm for computing a 2N-point real inverse FFT with an N-point complex FFT, defined in terms of  dsp[Algorithm for 2 N-point real FFT's computed with N-point complex FFT, defined in terms of   dspx[n]dspX[k] dspX[k]dspx[n] dspx[n]dspX[k] dspX[k]dspx[n]dspx1[n]dspx2[n]dsp (X1[k],X2[k])        B(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe}q  USafedspFor small values of narrowj (large width) it is faster to compute the spectrum of the Gaussian and apply the Fourier transform on it.dsp For small c: the convergence is slow, but the result will be close to recip (sqrt c).dsp array sizedspreciprocal of widthdspX[k]dsp array sizedsp6reciprocal of width, 1 is the width of the eigenvectordspX[k]C(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe|dsp fast_conv7 convolves two finite sequences using DFT relationshipsD(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe>dsp'Split-Radix Decimation in Frequency FFTdspx[n]dspNdsp FFT functiondspX[k]E(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeIdsp Sliding FFTdspNdspx[n]dsp X[k]F(c) Matthew Donadio 2002GPLm.p.donadio@ieee.org experimentalportableSafe dsp,Evaluate a polynomial using Horner's method.dspAdd two polynomials!dspSubtract two polynomials"dspScale a polynomial#dspMultiply two polynomials%dspDivide two polynomials&dsp2Modulus of two polynomials (remainder of division)'dsp2Raise a polynomial to a non-negative integer power(dsp&Polynomial substitution y(n) = x(w(n))*dspPolynomial substitution y(n) = x(w(n)) where the coefficients of x are also polynomials.+dspPolynomial derivative,dspPolynomial integration-dspConvert roots to a polynomial !"#$%&'()*+,- !"#$%&'()*+,-G(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe4dspPerforms the bilinear transform5dsp!Function for frequency prewarping4dspT_sdsp(b,a)dsp(b',a')5dspw_cdspT_sdspW_c./012345./012345H(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe16dspdesigns smooth FIR filters6dsppdspqdsph[n]66I(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe&7dsp7N takes the continuous impluse response function (one of the functions below, f-) and number of points in the interpolation, p, time shifts it by xh, samples it, and creates an array with the interpolation coeficients that can be used as a FIR filter.7dspfdsppdspxdsph[n],789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab,789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abJ(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeAcdspLowpass to lowpass:  s --> s/wcddspLowpass to highpass:  s --> wc/sedspLowpass to bandpass:  s --> (s^2 + wl*wu) / (s(wu-wl))fdspLowpass to bandstop:  s --> (s(wu-wl)) / (s^2 + wl*wu)cdspwcdsp(b,a)dsp(b',a')ddspwcdsp(b,a)dsp(b',a')edspwldspwudsp(b,a)dsp(b',a')fdspwldspwudsp(b,a)dsp(b',a')cdefghicdefghiK(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafejdspLowpass to lowpass:  z^-1 --> (z^-1 - a)/(1 - a*z^-1)kdspLowpass to Highpass: !z^-1 --> -(z^-1 + a)/(1 + a*z^-1)ldspLowpass to Bandpass: z^-1 -->mdspLowpass to Bandstop: z^-1 -->jdsptheta_pdspomega_pdsp(b,a)dsp(b',a')kdsptheta_pdspomega_pdsp(b,a)dsp(b',a')ldsptheta_pdspomega_p1dspomega_p2dsp(b,a)dsp(b',a')mdsptheta_pdspomega_p1dspomega_p2dsp(b,a)dsp(b',a')jklmjklmL(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe`ndsp&Generates Butterworth filter prototypeodsp$Generates Chebyshev filter prototypepdsp,Generates Inverse Chebyshev filter prototypendspNdsp(b,a)odspepsilondspNdsp(b,a)pdspepsilondspNdsp(b,a)nopnopM(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSaferdsp)Generates lowpass Butterworth IIR filtersudsp)Generates lowpass Butterworth IIR filtersvdsp'Generates lowpass Chebyshev IIR filterswdsp'Generates lowpass Chebyshev IIR filtersxdsp/Generates lowpass Inverse Chebyshev IIR filtersydsp/Generates lowpass Inverse Chebyshev IIR filtersrdsp(wp,dp)dsp(ws,ds)dsp(b,a)udsp(wp,dp)dsp(ws,ds)dsp(b,a)vdsp(wp,dp)dsp(ws,ds)dsp(b,a)wdsp(wp,dp)dsp(ws,ds)dsp(b,a)xdsp(wp,dp)dsp(ws,ds)dsp(b,a)ydsp(wp,dp)dsp(ws,ds)dsp(b,a) qrstuvwxy qrstvxuwyN(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafekzdspgenerates Chebyshev polynomialszdspNdspT_N(x)zzO(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafe{dsp$Butterworth filter response function|dsp"Chebyshev filter response function}dsp*Inverse Chebyshev filter response function Note that w_c. is a property of the stopband for this filter{dspNdspw_cdspwdsp |H_c(w)|^2|dspNdspepsilondspw_cdspwdsp |H_c(w)|^2}dspNdspepsilondspw_cdspwdsp |H_c(w)|^2{|}{|}P(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafeE~dspe^xdspln (1+x), 0 <= x <= 1dspcos xdspsin xdspatan x, -1 < x < 1dspcosh xdspsinh xdspatanh x~~Q0(c) 1998 Numeric Quest Inc., All rights reservedGPLm.p.donadio@ieee.org experimentalportableSafedsp#Root finder using Laguerre's methoddspepsilondspiteration limitdspthe polynomialdsp the rootsR(c) Matthew Donadio 2003GPLm.p.donadio@ieee.org experimentalportableSafecdsp Performs the matched-z transformdspT_sdsp(b,a)dsp(b',a')VWXYZ[\]W^_`abcWdefghi j k l m n o p q r s t u v w x y z { | } ~  de   !!!!!!!!!!!!!!""""""""""""#######$%%&'()**** + + + + +++++,,,W-../01111111 1!1"1#1$1%2&2'3(3)3*3+3,3-4.5/5W506162636465667778798:8;9<:=:>:?;@;A;B;C<D=E>F?G@H@IAJAKALAMANBOBPBQBRBSBTBUBVBWBXBYBZC[D\E]F^F_F`FaFbFcFdFeFfFgFhFiFjFkFlFmGnGoGpGqGrGsGtGuHvIwIxIyIzI{I|I}I~IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIJJJJJJJKKKKLLLMMMMMMMMMNOOOPPPPPPPPQR  #,,5UUUUUUUUUUUUUU"dsp-0.2.5.1-8kuwWlhbOFK8RFvz46REkfDSP.ConvolutionDSP.CorrelationDSP.Estimation.Frequency.PerMax'DSP.Estimation.Frequency.QuinnFernandesDSP.Estimation.Spectral.ARMADSP.Estimation.Spectral.KayDataDSP.Filter.FIR.FIRDSP.Filter.FIR.TapsDSP.Filter.IIR.IIR DSP.FlowgraphDSP.Multirate.PolyphaseDSP.Source.Basic DSP.BasicDSP.Multirate.HalfbandDSP.Multirate.CICDSP.Filter.IIR.CookbookDSP.Filter.FIR.SharpenDSP.Estimation.Frequency.WLP"DSP.Estimation.Frequency.PisarenkoDSP.Estimation.Frequency.FCIDSP.Source.Oscillator DSP.Unwrap DSP.WindowDSP.Filter.FIR.KaiserMatrix.CholeskyMatrix.LevinsonDSP.Estimation.Spectral.ARDSP.Estimation.Spectral.MAMatrix.Simplex Matrix.Vector Matrix.SparseMatrix.QR.Givens Matrix.MatrixMatrix.QR.Householder Matrix.LUDSP.Filter.IIR.PronyNumeric.Approximation.Chebyshev$Numeric.Random.Distribution.Binomial'Numeric.Random.Distribution.Exponential!Numeric.Random.Distribution.Gamma%Numeric.Random.Distribution.Geometric"Numeric.Random.Distribution.Normal#Numeric.Random.Distribution.Uniform Numeric.Random.Generator.MT19937Numeric.Random.Spectrum.BrownNumeric.Random.Spectrum.PinkNumeric.Random.Spectrum.PurpleNumeric.Random.Spectrum.WhiteNumeric.Special.TrigonometricNumeric.Statistics.MedianNumeric.Statistics.MomentNumeric.Statistics.Covariance#Numeric.Random.Distribution.PoissonDSP.CovarianceNumeric.Statistics.TTestNumeric.Transform.Fourier.CTNumeric.Transform.Fourier.DFT!Numeric.Transform.Fourier.FFTHard"Numeric.Transform.Fourier.GoertzelNumeric.Transform.Fourier.PFANumeric.Transform.Fourier.R2DIFNumeric.Transform.Fourier.R2DITNumeric.Transform.Fourier.R4DIFNumeric.Transform.Fourier.RaderNumeric.Transform.Fourier.FFT"Numeric.Transform.Fourier.FFTUtilsDSP.FastConvolutionNumeric.Transform.Fourier.SRDIF$Numeric.Transform.Fourier.SlidingFFTPolynomial.BasicDSP.Filter.IIR.BilinearDSP.Filter.FIR.SmoothDSP.Filter.FIR.PolyInterpDSP.Filter.Analog.TransformDSP.Filter.IIR.TransformDSP.Filter.Analog.PrototypeDSP.Filter.IIR.DesignPolynomial.ChebyshevDSP.Filter.Analog.ResponsePolynomial.MaclaurinPolynomial.RootsDSP.Filter.IIR.MatchedzsplitDSP.Filter.FIR.Window%Numeric.Transform.Fourier.Eigensystemconvtestrxyrxy_brxy_urxxrxx_brxx_upermaxqf arma_mywexcxrfirlpfhpfbpfbsfmbfrc integratorfos_df1fos_df2fos_df2t biquad_df1 biquad_df2 biquad_df2tiir_df1iir_df2xtytf1f2f3f4f5cascadegainbiasadder poly_interpzerosimpulsestepramplinspacelogspacedelay1delay downsample downsampleRecupsample upsampleRecupsampleAndHold interleave uninterleavepadtoMaybenorm2sqr^! hb_interphb_decimcic_interpolate cic_decimatebpf_csgbpf_cpgnotchapf peakingEQlowShelf highShelfsharpenwlplrpkaylwckq pisarenkoquinn1quinn2quinn3jacobsenmacleod3macleod5rvnconcomagcquadrature_nco complex_ncomquadrature_ncomunwrapwindow rectangularbartletthanninghammingblackman gen_hammingkaiserparzen kaiser_lpf kaiser_hpfcholeskylevinsonar_ywar_covar_mcovar_burg ma_durbinSimplex Unbounded InfeasibleOptimalsimplextwophase $fReadSimplex $fShowSimplexgeneratefromListtoListnormscalelift2addsubMatrixboundsfromMapfromRows fromColumns fromDensetoRows toColumnstoDensegetRow getColumn mulVector$fFunctorMatrix $fShowMatrixUpperRotation decompose rotateVector solveUppersolve leastSquaresdetUpperdetdetAbs$fShowRotation $fShowUppermm_multmv_multm_transm_hermit columnBounds rowBoundsouterinner ReflectionmatrixFromUpper reflectMatrix reflectVectorlulu_solveimproveinverselu_detprony cheby_approx cheby_evalbinomialexponential_invgamma geometric normal_clt normal_bm normal_arnormal_r uniform32cc uniform32co uniform32oc uniform32oo uniform53cc uniform53co uniform53oc uniform53oouniformWgenrandbrownkelletvosspurplewhitecscseccotacscasecacotcschsechcothacschasechacothmedian medianFastmeanvarstddevavgdevskewkurtosiscovpoissontestHeadcxycxxcxy_bcxy_ucxx_bcxx_uttesttutesttptestfft_ct1fft_ct2dftfft'2fft'3fft'4 cgoertzelcgoertzel_power rgoertzelrgoertzel_powerfft_pfa fft_r2dif fft_r2dit fft_r4dif fft_rader1 fft_rader2fftifftrfftirfftr2fftfft_magfft_db fft_phasefft_grdfft_inforfft_magrfft_db rfft_phaserfft_grd rfft_infowrite_fft_infowrite_rfft_info fast_conv fft_srdifsfftpolyevalpolyadd polyAddScalarpolysub polyscalepolymult polymultAltpolydivpolymodpolypow polysubst polysubstAlt polyPolySubst polyderiv polyinteg roots2polyzmzpstep1step2step3step4bilinearprewarp smoothfirmkcoef bspline_1p0o bspline_2p1o bspline_4p3o bspline_6p5o lagrange_4p3o lagrange_6p5o hermite_4p3o hermite_6p3o hermite_6p5o sndosc_4p5o sndosc_6p5o watte_4p2oparabolic2x_4p2ooptimal_2p3o2xoptimal_2p3o4xoptimal_2p3o8xoptimal_2p3o16xoptimal_2p3o32xoptimal_4p2o2xoptimal_4p2o4xoptimal_4p2o8xoptimal_4p2o16xoptimal_4p2o32xoptimal_4p3o2xoptimal_4p3o4xoptimal_4p3o8xoptimal_4p3o16xoptimal_4p3o32xoptimal_4p4o2xoptimal_4p4o4xoptimal_4p4o8xoptimal_4p4o16xoptimal_4p4o32xoptimal_6p4o2xoptimal_6p4o4xoptimal_6p4o8xoptimal_6p4o16xoptimal_6p4o32xoptimal_6p5o2xoptimal_6p5o4xoptimal_6p5o8xoptimal_6p5o16xoptimal_6p5o32xa_lp2lpa_lp2hpa_lp2bpa_lp2bs substitutepropSubstituteRecippropSubstituteAltd_lp2lpd_lp2hpd_lp2bpd_lp2bs butterworth chebyshev1 chebyshev2poly2iirbutterworthLowpassbutterworthHighpassbutterworthBandpass mkButterworthchebyshev1Lowpass mkChebyshev1chebyshev2Lowpass mkChebyshev2cheby butterworth_H chebyshev1_H chebyshev2_Hpolyexppolyln1polycospolysinpolyatanpolycoshpolysinh polyatanhrootsmatchedzbase GHC.MaybeJust submatrixrotationFromXY_det.<<..>>. segmentAftergaussianFourierwrappedGaussian gaussianPlainexample0example1exampleAlgebraicDoubleexampleAlgebraicQuadroexampleAlgebraicHalfexampleAlgebraicFourthexampleAlgebraic2exampleAlgebraic3exampleAlgebraic4exampleAlgebraic5