Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: da157f7b91fa
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 65a68b9f99ae
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 6, 2020

  1. Copy the full SHA
    ddc0f7f View commit details
  2. After egg's review.

    pleroy committed Jul 6, 2020
    Copy the full SHA
    b7d15f0 View commit details
  3. Merge pull request #2631 from pleroy/Corrigendum

    ISO 18431-2:2004/Cor.1:2008(en)
    pleroy authored Jul 6, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    65a68b9 View commit details
Showing with 23 additions and 20 deletions.
  1. +2 −2 numerics/apodization.hpp
  2. +17 −14 numerics/apodization_body.hpp
  3. +4 −4 numerics/apodization_test.cpp
4 changes: 2 additions & 2 deletions numerics/apodization.hpp
Original file line number Diff line number Diff line change
@@ -53,8 +53,8 @@ PoissonSeries<double, 0, Evaluator> BlackmanHarris(Instant const& t_min,
Instant const& t_max);

// The flat-top window in Wikipedia is not normalized and comes from Matlab (?).
// We use the normalized ISO 18431-2:2004, section 5.3 instead, which is very
// close.
// We use the normalized function from ISO 18431-2:2004/Cor.1:2008, section 5.3
// instead.
template<template<typename, typename, int> class Evaluator>
PoissonSeries<double, 0, Evaluator> ISO18431_2(Instant const& t_min,
Instant const& t_max);
31 changes: 17 additions & 14 deletions numerics/apodization_body.hpp
Original file line number Diff line number Diff line change
@@ -143,20 +143,23 @@ PoissonSeries<double, 0, Evaluator> ISO18431_2(Instant const& t_min,
Instant const& t_max) {
using Result = PoissonSeries<double, 0, Evaluator>;
AngularFrequency const ω = 2 * π * Radian / (t_max - t_min);
return Result(
typename Result::Polynomial({1.0 / 4.6392}, t_min),
{{ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial({-1.933 / 4.6392}, t_min)}},
{2 * ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial({1.286 / 4.6392}, t_min)}},
{3 * ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial({-0.388 / 4.6392}, t_min)}},
{4 * ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial({0.0322 / 4.6392}, t_min)}}});
return Result(typename Result::Polynomial({1.0 / 4.63867187}, t_min),
{{ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial(
{-1.93261719 / 4.63867187}, t_min)}},
{2 * ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial(
{1.28613281 / 4.63867187}, t_min)}},
{3 * ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial(
{-0.38769531 / 4.63867187}, t_min)}},
{4 * ω,
{/*sin=*/typename Result::Polynomial({0}, t_min),
/*cos=*/typename Result::Polynomial(
{0.03222656 / 4.63867187}, t_min)}}});
}

} // namespace internal_apodization
8 changes: 4 additions & 4 deletions numerics/apodization_test.cpp
Original file line number Diff line number Diff line change
@@ -106,10 +106,10 @@ TEST_F(ApodizationTest, BlackmanHarris) {

TEST_F(ApodizationTest, ISO18431_2) {
auto a = apodization::ISO18431_2<HornerEvaluator>(t1_, t2_);
EXPECT_THAT(a.Evaluate(t1_), AlmostEquals(-0.0028 / 4.6392, 224));
EXPECT_THAT(a.Evaluate(t0_), AlmostEquals(0.9194 / 4.6392, 6));
EXPECT_THAT(a.Evaluate(mid_), AlmostEquals(1, 0));
EXPECT_THAT(a.Evaluate(t2_), AlmostEquals(-0.0028 / 4.6392, 224));
EXPECT_THAT(a.Evaluate(t1_), AlmostEquals(-0.00195313 / 4.63867187, 440));
EXPECT_THAT(a.Evaluate(t0_), AlmostEquals(0.9194336 / 4.63867187, 6));
EXPECT_THAT(a.Evaluate(mid_), AlmostEquals(1, 1));
EXPECT_THAT(a.Evaluate(t2_), AlmostEquals(-0.00195313 / 4.63867187, 440));
}

} // namespace numerics