fun_ofdm  1.0
802.11a Physical Layer for USRP
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
fun::channel_est Class Reference

The channel_est block. More...

#include <channel_est.h>

Inheritance diagram for fun::channel_est:
fun::block< tagged_vector< 64 >, tagged_vector< 64 > > fun::block_base

Public Member Functions

 channel_est ()
 Construct for Channel Estimate block. More...
 
virtual void work ()
 Signal Processing happens here. More...
 
- Public Member Functions inherited from fun::block< tagged_vector< 64 >, tagged_vector< 64 > >
 block (std::string block_name)
 constructor More...
 
- Public Member Functions inherited from fun::block_base
 block_base (std::string block_name)
 block_base constructor More...
 

Private Attributes

std::vector< std::complex
< double > > 
m_chan_est
 Current channel estimate for each subcarrier. More...
 
int m_lts_flag
 Flag to indicate whether the current symbols are part of the LTS or not. More...
 
bool m_frame_start
 Flag to indicate whether the current symbol is the first symbol in the frame, or in other words the first symbol after the second LTS symbol. More...
 

Additional Inherited Members

- Public Attributes inherited from fun::block< tagged_vector< 64 >, tagged_vector< 64 > >
std::vector< tagged_vector< 64 > > input_buffer
 input_buffer contains new input items to be consumed More...
 
std::vector< tagged_vector< 64 > > output_buffer
 output_buffer is where the output items of the block should be placed More...
 

Detailed Description

The channel_est block.

Inputs tagged_vector<64> from the fft_symbols block.

Outputs tagged_vector<64> to the phase_tracker block.

The Channel Estimate block is in charge of estimating the current channel conditions using the two known LTS symbols and equalizing the channel affect by applying the inverse of the channel attenuation & phase rotation to each of the subcarriers.

Definition at line 32 of file channel_est.h.

Constructor & Destructor Documentation

fun::channel_est::channel_est ( )

Construct for Channel Estimate block.

Definition at line 22 of file channel_est.cpp.

22  :
23  block("channel_est"),
24  m_chan_est(64, std::complex<double>(1, 0)),
25  m_lts_flag(0),
26  m_frame_start(false)
27  {
28  }

Member Function Documentation

void fun::channel_est::work ( )
virtual

Signal Processing happens here.

This block constantly looks for the LTS_START flag to indicate the first LTS symbol. Once this symbol is found it then compares each sample in the two LTS symbols with the known transmitted sample and calculates the inverse channel effect. It then applies this channel correction to the rest of the symbol.

Implements fun::block< tagged_vector< 64 >, tagged_vector< 64 > >.

Definition at line 36 of file channel_est.cpp.

References fun::block< tagged_vector< 64 >, tagged_vector< 64 > >::input_buffer, fun::LTS_FREQ_DOMAIN, fun::LTS_START, m_chan_est, m_frame_start, m_lts_flag, fun::block< tagged_vector< 64 >, tagged_vector< 64 > >::output_buffer, fun::tagged_vector< N >::samples, fun::START_OF_FRAME, and fun::tagged_vector< N >::tag.

36  {
37 
38  if(input_buffer.size() == 0) return;
39  output_buffer.resize(0);
40 
41  for(int i = 0; i < input_buffer.size(); i++)
42  {
43  // Start of LTS found
44  if(input_buffer[i].tag == LTS_START)
45  {
46  m_lts_flag = 1;
47  for(int j = 0; j < 64; j++) m_chan_est[j] = std::complex<double>(0.0,0.0);
48  }
49 
50  if(m_lts_flag > 0) // This is a LTS symbol
51  {
52  // Calculate channel correction
53  for(int j = 0; j < 64; j++)
54  {
55  std::complex<double> ref_lts_sample = LTS_FREQ_DOMAIN[j];
56  std::complex<double> rec_lts_sample = input_buffer[i].samples[j];
57  m_chan_est[j] += ref_lts_sample / rec_lts_sample / 2.0;
58  }
59 
60  m_lts_flag++;
61  if(m_lts_flag == 3) // No more LTS symbols
62  {
63  m_lts_flag = 0;
64  m_frame_start = true; // Next symbol is the start of frame
65  }
66  }
67  else
68  {
69  tagged_vector<64> symbol;
70  if(m_frame_start)
71  {
72  symbol.tag = START_OF_FRAME;
73  m_frame_start = false;
74  }
75 
76  // Apply channel correction
77  for(int j = 0; j < 64; j++)
78  {
79  std::complex<double> out_sample = m_chan_est[j] * input_buffer[i].samples[j];
80  symbol.samples[j] = out_sample;
81  }
82  output_buffer.push_back(symbol);
83  }
84  }
85  }

Member Data Documentation

std::vector<std::complex<double> > fun::channel_est::m_chan_est
private

Current channel estimate for each subcarrier.

Definition at line 44 of file channel_est.h.

Referenced by work().

bool fun::channel_est::m_frame_start
private

Flag to indicate whether the current symbol is the first symbol in the frame, or in other words the first symbol after the second LTS symbol.

Definition at line 60 of file channel_est.h.

Referenced by work().

int fun::channel_est::m_lts_flag
private

Flag to indicate whether the current symbols are part of the LTS or not.

  • Usage
    • 0: Not in the LTS
    • 1: Current symbol is the first LTS symbol
    • 2: Current symbol is the second LTS symbol

Definition at line 54 of file channel_est.h.

Referenced by work().


The documentation for this class was generated from the following files: