-
Notifications
You must be signed in to change notification settings - Fork 7
/
oregondsputil.ts
51 lines (51 loc) · 2.58 KB
/
oregondsputil.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import * as OregonDSPTop from "oregondsp";
export const OregonDSP = OregonDSPTop.com.oregondsp.signalProcessing;
const fft = OregonDSP.fft;
const equiripple = OregonDSP.filter.fir.equiripple;
const fir = OregonDSP.filter.fir;
const iir = OregonDSP.filter.iir;
export const CDFT = fft.CDFT;
export const RDFT = fft.RDFT;
export const CenteredDifferentiator = equiripple.CenteredDifferentiator;
export const CenteredHilbertTransform = equiripple.CenteredHilbertTransform;
export const EquirippleBandpass = equiripple.EquirippleBandpass;
export const EquirippleFIRFilter = equiripple.EquirippleFIRFilter;
export const EquirippleHalfBand = equiripple.EquirippleHalfBand;
export const EquirippleHighpass = equiripple.EquirippleHighpass;
export const EquirippleLowpass = equiripple.EquirippleLowpass;
export const FIRTypeI = equiripple.FIRTypeI;
export const FIRTypeII = equiripple.FIRTypeII;
export const FIRTypeIII = equiripple.FIRTypeIII;
export const StaggeredDifferentiator = equiripple.StaggeredDifferentiator;
export const StaggeredHilbertTranform = equiripple.StaggeredHilbertTranform;
export const ComplexAnalyticSignal = fir.ComplexAnalyticSignal;
export const Interpolator = fir.Interpolator;
export const OverlapAdd = fir.OverlapAdd;
export const Allpass = iir.Allpass;
export const AnalogPrototype = iir.AnalogPrototype;
export const Butterworth = iir.Butterworth;
export const ChebyshevI = iir.ChebyshevI;
export const ChebyshevII = iir.ChebyshevII;
export const Complex = iir.Complex;
//export {com.oregondsp.signalProcessing.filter.iir.Complex as Complex} from "./kotlin/oregondsp.js";
export const IIRFilter = iir.IIRFilter;
export const PassbandType = iir.PassbandType;
export const ThiranAllpass = iir.ThiranAllpass;
export const LOWPASS = iir.PassbandType.LOWPASS;
export const BANDPASS = iir.PassbandType.BANDPASS;
export const HIGHPASS = iir.PassbandType.HIGHPASS;
export const LagrangePolynomial = OregonDSP.filter.LagrangePolynomial;
export const Polynomial = OregonDSP.filter.Polynomial;
export const Rational = OregonDSP.filter.Rational;
export const HammingWindow = OregonDSP.HammingWindow;
export const HanningWindow = OregonDSP.HanningWindow;
export const Sequence = OregonDSP.Sequence;
export const Window = OregonDSP.Window;
export function complexFromPolar(amp: number, phase: number) {
const real = amp * Math.cos(phase);
const imag = amp * Math.sin(phase);
return new OregonDSPTop.com.oregondsp.signalProcessing.filter.iir.Complex(real, imag);
}
export function createComplex(real: number, imag: number) {
return new OregonDSPTop.com.oregondsp.signalProcessing.filter.iir.Complex(real, imag);
}