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

The fft_symbols block. More...

#include <fft_symbols.h>

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

Public Member Functions

 fft_symbols ()
 Constructor for fft_symbols block. More...
 
virtual void work ()
 Signal processing happens here. More...
 
- Public Member Functions inherited from fun::block< tagged_sample, 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

tagged_vector< 64 > m_current_vector
 Current vector being filled. More...
 
int m_offset
 Offset into the current vector being filled. More...
 
fft m_ffft
 Forward FFT. More...
 

Additional Inherited Members

- Public Attributes inherited from fun::block< tagged_sample, tagged_vector< 64 > >
std::vector< tagged_sampleinput_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 fft_symbols block.

Inputs tagged_samples from timing_sync block (time domain samples). Outputs tagged_vectors to channel estimator block (frequency domain samples).

This FFT Symbols aligns the input samples into symbols, chops off the cyclic prefixes, and performs a forward FFT on vectorized samples to convert them from time domain to frequency domain symbols.

Definition at line 32 of file fft_symbols.h.

Constructor & Destructor Documentation

fun::fft_symbols::fft_symbols ( )

Constructor for fft_symbols block.

  • Initializations:

Definition at line 21 of file fft_symbols.cpp.

21  :
22  block("fft_symbols"),
23  m_offset(0),
24  m_ffft(64)
25  {
26  }

Member Function Documentation

void fun::fft_symbols::work ( )
virtual

Signal processing happens here.

This block removes the cyclic prefix and vectorizes the samples into 64 sample symbols based on the tags marking the frame boundaries. It then performs a 64 point forward fft on each symbol to convert it from time domain to frequency domain.

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

Definition at line 33 of file fft_symbols.cpp.

References fun::fft::forward(), fun::block< tagged_sample, tagged_vector< 64 > >::input_buffer, fun::LTS1, fun::LTS2, fun::LTS_START, m_current_vector, m_ffft, m_offset, fun::NONE, fun::block< tagged_sample, tagged_vector< 64 > >::output_buffer, fun::tagged_vector< N >::samples, and fun::tagged_vector< N >::tag.

34  {
35  if(input_buffer.size() == 0) return;
36  output_buffer.resize(0);
37 
38  // Step through the input samples
39  for(int x = 0; x < input_buffer.size(); x++)
40  {
41  // Check if this is the start of a new frame
42  if(input_buffer[x].tag == LTS1)
43  {
44  // Push the current vector to the output buffer if
45  // we've written any data to it
46  if(m_offset > 15) output_buffer.push_back(m_current_vector);
47 
48  // Start a new vector
50  m_offset = 16;
51  }
52 
53  if(input_buffer[x].tag == LTS2)
54  {
55  m_offset = 16;
56  }
57 
58  // Copy over samples past the cyclic prefix
59  if(m_offset > 15)
60  {
62  }
63 
64  // Increment the offset and reset if we're at the end of the symbol
65  m_offset++;
66  if(m_offset == 80)
67  {
70  m_offset = 0;
71  }
72  }
73 
74  // Perform forward FFT
75  for(int x = 0; x < output_buffer.size(); x++)
76  {
77  m_ffft.forward(output_buffer[x].samples);
78 
79  }
80  }

Member Data Documentation

tagged_vector<64> fun::fft_symbols::m_current_vector
private

Current vector being filled.

Definition at line 45 of file fft_symbols.h.

Referenced by work().

fft fun::fft_symbols::m_ffft
private

Forward FFT.

Definition at line 55 of file fft_symbols.h.

Referenced by work().

int fun::fft_symbols::m_offset
private

Offset into the current vector being filled.

Definition at line 50 of file fft_symbols.h.

Referenced by work().


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