Accord.Audio.ComplexSignal.SetChannel C# (CSharp) Method

SetChannel() private method

Copies an array of samples to a signal's channel.
private SetChannel ( int channel, Complex samples ) : void
channel int
samples Complex
return void
        private void SetChannel(int channel, Complex[] samples)
        {
            int channels = Channels;
            int length = Length;

            unsafe
            {
                fixed (Complex* ptrArray = samples)
                {
                    var dst = (Complex*)Data + channel;
                    var src = ptrArray;

                    for (int i = 0; i < length; i++, src++, dst += channels)
                        *dst = *src;
                }
            }
        }