From db5d130bff3e5f9676af6bdbcc4301afa6a5c373 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Sat, 4 Aug 2012 08:41:32 +0000 Subject: [PATCH] added phase initialization that removes warning when compiling git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@226 64b25241-fba3-4117-9849-534c7e92360d --- src/algorithms/libs/gnss_signal_processing.cc | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/algorithms/libs/gnss_signal_processing.cc b/src/algorithms/libs/gnss_signal_processing.cc index 738bb3eda..8c566460f 100644 --- a/src/algorithms/libs/gnss_signal_processing.cc +++ b/src/algorithms/libs/gnss_signal_processing.cc @@ -35,19 +35,15 @@ -void complex_exp_gen(std::complex* _dest, double _f, double _fs, unsigned int _samps) { - - double phase, phase_step; - - phase_step = (GPS_TWO_PI*_f)/_fs; - - for(unsigned int i = 0; i < _samps; i++) { - +void complex_exp_gen(std::complex* _dest, double _f, double _fs, unsigned int _samps) +{ + double phase = 0; + double phase_step = (GPS_TWO_PI*_f)/_fs; + for(unsigned int i = 0; i < _samps; i++) + { _dest[i] = std::complex(cos(phase),sin(phase)); - phase += phase_step; } - }