[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 24/57: digital: use FFT filters for the cor
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 24/57: digital: use FFT filters for the correlate_and_sync block. |
Date: |
Wed, 21 May 2014 03:10:26 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit 0b89872a91af16139a0ea7ea9a52723306209eff
Author: Tom Rondeau <address@hidden>
Date: Fri Apr 18 17:26:18 2014 -0400
digital: use FFT filters for the correlate_and_sync block.
The known word is interpolated by sps, so it will almost always be a fairly
large filter here. Using the FFT filter dramatically reduces the cost of this
block.
---
gr-digital/lib/correlate_and_sync_cc_impl.cc | 17 ++++++++++++-----
gr-digital/lib/correlate_and_sync_cc_impl.h | 16 +++++++---------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/gr-digital/lib/correlate_and_sync_cc_impl.cc
b/gr-digital/lib/correlate_and_sync_cc_impl.cc
index fb3b99c..80aee56 100644
--- a/gr-digital/lib/correlate_and_sync_cc_impl.cc
+++ b/gr-digital/lib/correlate_and_sync_cc_impl.cc
@@ -74,8 +74,7 @@ namespace gr {
d_center_first_symbol = (padding.size() + 0.5) * d_sps;
- //d_filter = new kernel::fft_filter_ccc(1, d_symbols);
- d_filter = new kernel::fir_filter_ccc(1, d_symbols);
+ d_filter = new kernel::fft_filter_ccc(1, d_symbols);
set_history(d_filter->ntaps());
@@ -118,8 +117,7 @@ namespace gr {
memcpy(out, in, sizeof(gr_complex)*noutput_items);
// Calculate the correlation with the known symbol
- //d_filter->filter(noutput_items, in, corr);
- d_filter->filterN(corr, in, noutput_items);
+ d_filter->filter(noutput_items, in, corr);
// Find the magnitude squared of the correlation
std::vector<float> corr_mag(noutput_items);
@@ -139,9 +137,18 @@ namespace gr {
double center = nom / den;
center = (center - 2.0);
- int index = i;
+ // Adjust the results of the fft filter by moving back the
+ // length of the filter offset by the number of sps.
+ int index = i - d_symbols.size() + d_sps + 1;
+ // Calculate the phase offset of the incoming signal; always
+ // adjust it based on the proper rotation of the expected
+ // known word; rotate by pi is the real part is < 0 since
+ // the atan doesn't understand the ambiguity.
float phase = fast_atan2f(corr[index].imag(), corr[index].real());
+ if(corr[index].real() < 0.0)
+ phase += M_PI;
+
add_item_tag(0, nitems_written(0) + index, pmt::intern("phase_est"),
pmt::from_double(phase), pmt::intern(alias()));
add_item_tag(0, nitems_written(0) + index, pmt::intern("time_est"),
diff --git a/gr-digital/lib/correlate_and_sync_cc_impl.h
b/gr-digital/lib/correlate_and_sync_cc_impl.h
index e9cc983..d95ec51 100644
--- a/gr-digital/lib/correlate_and_sync_cc_impl.h
+++ b/gr-digital/lib/correlate_and_sync_cc_impl.h
@@ -1,19 +1,19 @@
/* -*- c++ -*- */
-/*
+/*
* Copyright 2013 Free Software Foundation, Inc.
- *
+ *
* This file is part of GNU Radio
- *
+ *
* GNU Radio is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
- *
+ *
* GNU Radio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with GNU Radio; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -24,7 +24,6 @@
#define INCLUDED_DIGITAL_CORRELATE_AND_SYNC_CC_IMPL_H
#include <gnuradio/digital/correlate_and_sync_cc.h>
-#include <gnuradio/filter/fir_filter.h>
#include <gnuradio/filter/fft_filter.h>
using namespace gr::filter;
@@ -39,11 +38,10 @@ namespace gr {
unsigned int d_sps;
float d_center_first_symbol;
float d_thresh;
- kernel::fir_filter_ccc *d_filter;
- //kernel::fft_filter_ccc *d_filter;
+ kernel::fft_filter_ccc *d_filter;
int d_last_index;
-
+
public:
correlate_and_sync_cc_impl(const std::vector<gr_complex> &symbols,
const std::vector<float> &filter,
- [Commit-gnuradio] [gnuradio] 03/57: controlport: adding a 'toggle' interface for ControlPort., (continued)
- [Commit-gnuradio] [gnuradio] 03/57: controlport: adding a 'toggle' interface for ControlPort., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 20/57: digital: correlate_access_code_tag d_mask was set improperly when access code len = 64., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 09/57: documentation - fix example in case anyone gets confused, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 08/57: Corrected codec2 encoder documentation., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 15/57: tests for block mode, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 19/57: volk: missing updates for volk qa and profile from last checkin., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 25/57: fec: encoder now outputs bytes to make it more easily integratable with modulators., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 21/57: fec: improved fecapi stuff., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 23/57: fec: wip: allowing ber block to be used as a streaming block., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 17/57: adding ber sink to qt gui, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 24/57: digital: use FFT filters for the correlate_and_sync block.,
git <=
- [Commit-gnuradio] [gnuradio] 27/57: grc: adding advanced tab feature to set a block's alias., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 29/57: grc: fixes bug with controlport monitors where true/false enable parameter is not respected., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 02/57: runtime: white space removal., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 31/57: fec: use logger to explain exception when using threading with history., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 26/57: fec: changed puncture block for easier to use API., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 18/57: volk: added conv kernel puppet and added to QA and profile., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 34/57: qtgui: work on ber sink for fecapi, git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 35/57: runtime: don't add the log appender --> adds to C++, too., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 43/57: digital: added option to packet_utils.unmake_packet to check or not check the CRC., git, 2014/05/20
- [Commit-gnuradio] [gnuradio] 44/57: blocks: adds kernels for pack_k_bits and unpack_k_bits., git, 2014/05/20