예제 #1
0
 public void ZeroPad()
 {
     using (var vector1 = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(2, 2), 2))
     {
         vector1.ZeroPad(10, PaddingOption.End);
         vector1.Length.Should().Be(20);
     }
 }
예제 #2
0
 public void ApplyCustomWindow()
 {
     using (var vector1 = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(2, 2), 2))
     {
         var window = new TestWindowFunction();
         vector1.ApplyWindow(window);
         window.HasBeenCalled.Should().BeTrue();
     }
 }
예제 #3
0
 public void ComplexStatisticsSplitted()
 {
     using (var vector1 = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(2, 2), 2))
     {
         var result = vector1.ComplexStatisticsSplitted(2);
         result.Should().HaveCount(2);
         result[0].Count.Should().Be(1);
     }
 }
예제 #4
0
 public void ComplexStatistics()
 {
     using (var vector1 = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(2, 2), 2))
     {
         var result = vector1.ComplexStatistics();
         result.Average.Real.Should().BeApproximately(2.0f, (float)1e-6);
         result.Sum.Real.Should().BeApproximately(4.0f, (float)1e-6);
     }
 }
예제 #5
0
 public void ComplexDotProduct()
 {
     using (var vector1 = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(2, 2), 2))
         using (var vector2 = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(5, 5), 2))
         {
             var result = vector1.ComplexDotProduct(vector2);
             result.Real.Should().BeApproximately((float)(5 * 2 * 4), (float)1e-6);
         }
 }
예제 #6
0
 public void AddComplexValue()
 {
     using (var vector = DataVector32.NewComplexTimeVectorFromConstant(new Complex32(2, 2), 5))
     {
         vector.IsComplex.Should().BeTrue();
         vector.Length.Should().Be(10);
         vector.Points.Should().Be(5);
         vector.AllocatedLength.Should().Be(10);
         vector.Domain.Should().Be(VectorDomain.Time);
         vector[0].Should().BeApproximately(2.0f, 1e-15f);
         vector[1].Should().BeApproximately(2.0f, 1e-15f);
         vector.Add(3, 2);
         vector[0].Should().BeApproximately(5.0f, 1e-15f);
         vector[1].Should().BeApproximately(4.0f, 1e-15f);
     }
 }