Java Array Multiply multiply(final double[] inout, final double[] in)

Here you can find the source of multiply(final double[] inout, final double[] in)

Description

Multiplies two FIR filters.

License

Apache License

Parameter

Parameter Description
inout In and output FIR filter.
in Second FIR filter.

Return

inout.

Declaration

public final static double[] multiply(final double[] inout,
        final double[] in) 

Method Source Code

//package com.java2s;
/*/* w  w w  . j  a  v  a  2s  . c  om*/
 * Copyright (C) 2012 Ren? Jeschke <rene_jeschke@yahoo.de>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    /**
     * Multiplies two FIR filters.
     *
     * @param inout
     *            In and output FIR filter.
     * @param in
     *            Second FIR filter.
     * @return inout.
     */
    public final static double[] multiply(final double[] inout,
            final double[] in) {
        if (inout.length != in.length)
            throw new RuntimeException("Filter lengths do not match!");
        for (int i = 0; i < inout.length; i++)
            inout[i] *= in[i];
        return inout;
    }
}

Related

  1. multiply(double[] array, double multiplier)
  2. multiply(double[] multiplicand, double[] factor, double multiplicandAdjustment, double factorAdjustment)
  3. multiply(double[] source, double num)
  4. multiply(double[] values, int offset, int stride, int length, double multiplier)
  5. multiply(final double[] a, double b, final double[] dest, int n)
  6. multiply(final double[] lhs, final double[] rhs)
  7. multiply(final double[] v1, final double[] v2)
  8. multiply(final double[] x, final double[] y)
  9. multiply(final float[] complexA, final float[] complexB, final boolean overwriteA)