Back to project page renderScriptFFT.
The source code is released under:
Copyright (c) 2013 The Regents of the University of California. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided...
If you think the Android project renderScriptFFT listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.android.rs.utils; /*from www. j a v a 2s .c om*/ import org.apache.commons.math3.util.FastMath; public class ArrayConversion { private ArrayConversion() { } public static float[] bytesToFloat(byte[] in){ float[] out = new float[in.length]; for (int i = 0; i < in.length; ++i) { out[i] = (float) in[i]; } return out; } public static float[] doublesToFloats(double[] in) { float[] out = new float[in.length]; for (int i = 0; i < in.length; ++i) { out[i] = (float) in[i]; } return out; } public static float[] createRealImag(float[] in, int frameSize) { int dataLength = in.length; int numFrames = (int) FastMath.ceil((double) dataLength / (double) frameSize); float[] out = new float[numFrames * frameSize * 2]; for (int i = 0; i < in.length; ++i) { out[i * 2] = in[i]; } return out; } }