by
84k 17
0
4
31k
0
Top 1% !
Tagged
Specified
Refined
Popularity: 139659th place

Published on:

Architecturex86_64
InputName0from
InputName1to
InputType0Int16[][]
InputType1double[][]
LanguageC#
MethodNameConvert
OutputTypevoid
Windows VersionWindows7

Convert: Converts a matrix of signed 16-bit integer samples            into a matrix of 64-bit floating point samples.

Converts a matrix of signed 16-bit integer samples
  into a matrix of 64-bit floating point samples.

 
<param name="from">The original sample.</param>
<param name="to">The resulting sample.</param>
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1382829/Convert--Converts-a-matrix-of-signed-16-?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
private const float const_1_div_32768_ = 1f / 32768f; #endregion #region From Int16 (short) to Single (float) /// <summary> /// Converts a matrix of signed 16-bit integer samples /// into a matrix of 64-bit floating point samples. /// </summary> /// /// <param name="from">The original sample.</param> /// <param name="to">The resulting sample.</param> /// public static void Convert(Int16[][] from, double[][] to) { for (int i = 0; i < from.Length; i++) for (int j = 0; j < from[0].Length; j++) to[i][j] = (double)(from[i][j] * const_1_div_32768_); }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus