Skip to content

Commit edd0253

Browse files
committed
digital: add deprecation warnings to appropriate OFDM blocks
1 parent 722113e commit edd0253

5 files changed

+110
-100
lines changed

gr-digital/lib/ofdm_frame_acquisition_impl.cc

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/* -*- c++ -*- */
22
/*
33
* Copyright 2006-2008,2010,2011 Free Software Foundation, Inc.
4-
*
4+
*
55
* This file is part of GNU Radio
6-
*
6+
*
77
* GNU Radio is free software; you can redistribute it and/or modify
88
* it under the terms of the GNU General Public License as published by
99
* the Free Software Foundation; either version 3, or (at your option)
1010
* any later version.
11-
*
11+
*
1212
* GNU Radio is distributed in the hope that it will be useful,
1313
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1414
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1515
* GNU General Public License for more details.
16-
*
16+
*
1717
* You should have received a copy of the GNU General Public License
1818
* along with GNU Radio; see the file COPYING. If not, write to
1919
* the Free Software Foundation, Inc., 51 Franklin Street,
@@ -32,14 +32,14 @@
3232

3333
namespace gr {
3434
namespace digital {
35-
35+
3636
#define VERBOSE 0
3737
#define M_TWOPI (2*M_PI)
3838
#define MAX_NUM_SYMBOLS 1000
3939

4040
ofdm_frame_acquisition::sptr
4141
ofdm_frame_acquisition::make(unsigned int occupied_carriers,
42-
unsigned int fft_length,
42+
unsigned int fft_length,
4343
unsigned int cplen,
4444
const std::vector<gr_complex> &known_symbol,
4545
unsigned int max_fft_shift_len)
@@ -50,7 +50,7 @@ namespace gr {
5050
}
5151

5252
ofdm_frame_acquisition_impl::ofdm_frame_acquisition_impl(unsigned occupied_carriers,
53-
unsigned int fft_length,
53+
unsigned int fft_length,
5454
unsigned int cplen,
5555
const std::vector<gr_complex> &known_symbol,
5656
unsigned int max_fft_shift_len)
@@ -65,6 +65,8 @@ namespace gr {
6565
d_coarse_freq(0),
6666
d_phase_count(0)
6767
{
68+
GR_LOG_WARN(d_logger, "The gr::digital::ofdm_frame_acquisition block has been deprecated.");
69+
6870
d_symbol_phase_diff.resize(d_fft_length);
6971
d_known_phase_diff.resize(d_occupied_carriers);
7072
d_hestimate.resize(d_occupied_carriers);
@@ -75,7 +77,7 @@ namespace gr {
7577
for(i = 0; i < d_known_symbol.size()-2; i+=2) {
7678
d_known_phase_diff[i] = norm(d_known_symbol[i] - d_known_symbol[i+2]);
7779
}
78-
80+
7981
d_phase_lut = new gr_complex[(2*d_freq_shift_len+1) * MAX_NUM_SYMBOLS];
8082
for(i = 0; i <= 2*d_freq_shift_len; i++) {
8183
for(j = 0; j < MAX_NUM_SYMBOLS; j++) {
@@ -112,7 +114,7 @@ namespace gr {
112114
ofdm_frame_acquisition_impl::correlate(const gr_complex *symbol, int zeros_on_left)
113115
{
114116
unsigned int i,j;
115-
117+
116118
std::fill(d_symbol_phase_diff.begin(), d_symbol_phase_diff.end(), 0);
117119
for(i = 0; i < d_fft_length-2; i++) {
118120
d_symbol_phase_diff[i] = norm(symbol[i] - symbol[i+2]);
@@ -142,16 +144,16 @@ namespace gr {
142144
unsigned int i=0;
143145

144146
// Set first tap of equalizer
145-
d_hestimate[0] = d_known_symbol[0] /
147+
d_hestimate[0] = d_known_symbol[0] /
146148
(coarse_freq_comp(d_coarse_freq,1)*symbol[zeros_on_left+d_coarse_freq]);
147149

148150
// set every even tap based on known symbol
149151
// linearly interpolate between set carriers to set zero-filled carriers
150152
// FIXME: is this the best way to set this?
151153
for(i = 2; i < d_occupied_carriers; i+=2) {
152-
d_hestimate[i] = d_known_symbol[i] /
154+
d_hestimate[i] = d_known_symbol[i] /
153155
(coarse_freq_comp(d_coarse_freq,1)*(symbol[i+zeros_on_left+d_coarse_freq]));
154-
d_hestimate[i-1] = (d_hestimate[i] + d_hestimate[i-2]) / gr_complex(2.0, 0.0);
156+
d_hestimate[i-1] = (d_hestimate[i] + d_hestimate[i-2]) / gr_complex(2.0, 0.0);
155157
}
156158

157159
// with even number of carriers; last equalizer tap is wrong
@@ -164,7 +166,7 @@ namespace gr {
164166
for(i = 0; i < d_occupied_carriers; i++) {
165167
gr_complex sym = coarse_freq_comp(d_coarse_freq,1)*symbol[i+zeros_on_left+d_coarse_freq];
166168
gr_complex output = sym * d_hestimate[i];
167-
fprintf(stderr, "sym: %+.4f + j%+.4f ks: %+.4f + j%+.4f eq: %+.4f + j%+.4f ==> %+.4f + j%+.4f\n",
169+
fprintf(stderr, "sym: %+.4f + j%+.4f ks: %+.4f + j%+.4f eq: %+.4f + j%+.4f ==> %+.4f + j%+.4f\n",
168170
sym .real(), sym.imag(),
169171
d_known_symbol[i].real(), d_known_symbol[i].imag(),
170172
d_hestimate[i].real(), d_hestimate[i].imag(),
@@ -185,7 +187,7 @@ namespace gr {
185187

186188
gr_complex *out = (gr_complex *) output_items[0];
187189
char *signal_out = (char *) output_items[1];
188-
190+
189191
int unoccupied_carriers = d_fft_length - d_occupied_carriers;
190192
int zeros_on_left = (int)ceil(unoccupied_carriers/2.0);
191193

@@ -203,7 +205,7 @@ namespace gr {
203205
out[i] = d_hestimate[i]*coarse_freq_comp(d_coarse_freq,d_phase_count)
204206
*symbol[i+zeros_on_left+d_coarse_freq];
205207
}
206-
208+
207209
d_phase_count++;
208210
if(d_phase_count == MAX_NUM_SYMBOLS) {
209211
d_phase_count = 1;

0 commit comments

Comments
 (0)