This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace InertialNavigationSystem | |
{ | |
public class Sample | |
{ | |
public Sample(double time, double value) | |
{ | |
Time = time; | |
Value = value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace InertialNavigationSystem | |
{ | |
public class Integrator | |
{ | |
public Integrator() | |
{ | |
Samples = new List<Sample>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace InertialNavigationSystem_Test | |
{ | |
[TestFixture] | |
public class IntegratorTest | |
{ | |
[Test] | |
public void IntegrateSamples() | |
{ | |
List<Sample> samples = new List<Sample>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assert.AreEqual( Oczekiwany, Aktualny ); //Czy oba parametry sa jednakowe | |
Assert.AreSame( Obiekt1, Obiekt2 ); //Czy oba parametry odwoluja sie do tego samego obiektu | |
Assert.Greater( Liczba1, Liczba2 ); //Czy x>y | |
Assert.Less( Liczba1, Liczba2 ); //Czy y<x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace InertialNavigationSystem | |
{ | |
public class FIRFilter: IFilter | |
{ | |
private List<Sample> Memory { get; set; } | |
private List<double> Coefficients { get; set; } | |
public FIRFilter(List<double> FilterCoefficients) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FIRFilter filter = new FIRFilter(new List<double>() { 0.25, 0.25, 0.25, 0.25 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace InertialNavigationSystem_Test | |
{ | |
[TestFixture] | |
class FIRFilter_Test | |
{ | |
[TestCase] | |
public void FIRFilter_CreateNewObject() | |
{ | |
FIRFilter Filter = new FIRFilter(new List<double>() { 0.25, 0.25, 0.25, 0.25 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AlphaBetaFilter: IFilter | |
{ | |
private double Alpha { get; set; } | |
private double Beta { get; set; } | |
private Sample LastSample { get; set; } | |
double LastDerivative { get; set; } = 0; | |
public AlphaBetaFilter(double alpha, double beta, double InitialTime = 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cv = new ChartValues<double>(); | |
for (var i = 0; i < 100000; i++) | |
{ | |
cv.Add(Math.Sin(i)); | |
} |
OlderNewer