diff options
author | Tom Rondeau <tom@trondeau.com> | 2016-01-06 18:01:30 -0500 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2016-01-06 18:01:30 -0500 |
commit | e7f5c67154a0573b1118498346c65f23e0a7340f (patch) | |
tree | a54e9c10c224d75b0297cae8e8a3d567564cf349 | |
parent | dec480ab3f0809677ba3ef2a3a64d402d742b5ec (diff) |
digital: Addresses issue #812.
If the taps are all the same value, the differential taps become NaNs
during create_diff_taps. Having this type of filter doesn't make sense
in this algorithm, so there's nothing to fix. But now, we check to see
if the diff taps are NaN and throw a runtime_error if detected.
-rw-r--r-- | gr-digital/lib/pfb_clock_sync_ccf_impl.cc | 3 | ||||
-rw-r--r-- | gr-digital/lib/pfb_clock_sync_fff_impl.cc | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc index 60ee02aea5..c8e1221c90 100644 --- a/gr-digital/lib/pfb_clock_sync_ccf_impl.cc +++ b/gr-digital/lib/pfb_clock_sync_ccf_impl.cc @@ -308,6 +308,9 @@ namespace gr { // Normalize the taps for(unsigned int i = 0; i < difftaps.size(); i++) { difftaps[i] *= d_nfilters/pwr; + if(difftaps[i] != difftaps[i]) { + throw std::runtime_error("pfb_clock_sync_ccf::create_diff_taps produced NaN."); + } } } diff --git a/gr-digital/lib/pfb_clock_sync_fff_impl.cc b/gr-digital/lib/pfb_clock_sync_fff_impl.cc index 2b73aed699..beb6bf5579 100644 --- a/gr-digital/lib/pfb_clock_sync_fff_impl.cc +++ b/gr-digital/lib/pfb_clock_sync_fff_impl.cc @@ -287,6 +287,9 @@ namespace gr { // Normalize the taps for(unsigned int i = 0; i < difftaps.size(); i++) { difftaps[i] *= d_nfilters/pwr; + if(difftaps[i] != difftaps[i]) { + throw std::runtime_error("pfb_clock_sync_fff::create_diff_taps produced NaN."); + } } } |