Advertisement
Guest User

Untitled

a guest
Feb 16th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. diff --git a/gr-analog/lib/quadrature_demod_cf_impl.cc b/gr-analog/lib/quadrature_demod_cf_impl.cc
  2. index 059cc89..4c29b1b 100644
  3. --- a/gr-analog/lib/quadrature_demod_cf_impl.cc
  4. +++ b/gr-analog/lib/quadrature_demod_cf_impl.cc
  5. @@ -28,6 +28,7 @@
  6. #include <gnuradio/io_signature.h>
  7. #include <gnuradio/math.h>
  8. #include <volk/volk.h>
  9. +#include <math.h>
  10.  
  11. namespace gr {
  12. namespace analog {
  13. @@ -67,7 +68,11 @@ namespace gr {
  14. std::vector<gr_complex> tmp(noutput_items);
  15. volk_32fc_x2_multiply_conjugate_32fc(&tmp[0], &in[1], &in[0], noutput_items);
  16. for(int i = 0; i < noutput_items; i++) {
  17. - out[i] = d_gain * gr::fast_atan2f(imag(tmp[i]), real(tmp[i]));
  18. + if((float)real(tmp[i]) != INFINITY && (float)imag(tmp[i]) != INFINITY && (float)real(tmp[i]) != -INFINITY && (float)imag(tmp[i]) != -INFINITY){
  19. + out[i] = d_gain * gr::fast_atan2f(imag(tmp[i]), real(tmp[i]));
  20. + }else{
  21. + out[i] = 0.0;
  22. + }
  23. }
  24.  
  25. return noutput_items;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement