/** Multiplies both samples returning a new sample with the results */ public static ComplexSample multiply(ComplexSample sample1, ComplexSample sample2) { float inphase = (sample1.inphase() * sample2.inphase()) - (sample1.quadrature() * sample2.quadrature()); float quadrature = (sample1.quadrature() * sample2.inphase()) + (sample1.inphase() * sample2.quadrature()); return new ComplexSample(inphase, quadrature); }
/** Multiplies this sample by the multiplier sample */ public void multiply(ComplexSample multiplier) { float inphase = (inphase() * multiplier.inphase()) - (quadrature() * multiplier.quadrature()); float quadrature = (quadrature() * multiplier.inphase()) + (inphase() * multiplier.quadrature()); mLeft = inphase; mRight = quadrature; }
public static ComplexSample multiply(ComplexSample sample, Float inphase, Float quadrature) { float i = (sample.inphase() * inphase) - (sample.quadrature() * quadrature); float q = (sample.quadrature() * inphase) + (sample.inphase() * quadrature); return new ComplexSample(i, q); }