itpp::Raised_Cosine< T1 > Class Template Reference

Raised Cosine (RC) Pulse Shaper. More...

`#include <itpp/comm/pulse_shape.h>`

Inheritance diagram for itpp::Raised_Cosine< T1 >:

## Public Member Functions

| Raised_Cosine ()
| Constructor.
| Raised_Cosine (double roll_off, int filter_length=6, int upsampling_factor=8)
| Constructor.
virtual | ~Raised_Cosine ()
| Destructor.
void | set_pulse_shape (double roll_off_factor, int filter_length=6, int upsampling_factor=8)
| Set pulse shape (roll_off_factor between 0 and 1, filter_length even)
double | get_roll_off (void) const
| Get the roll-off factor.
void | set_pulse_shape (const Vec< double > &impulse_response, int upsampling_factor)
| Set the general impulse response of the FIR filter.
Vec< double > | get_pulse_shape (void) const
| Get the pulse shape.
int | get_upsampling_factor () const
| Get the over sampling factor.
int | get_pulse_length () const
| Get the length of the pulse in number of symbols.
int | get_filter_length () const
| Get the length of the internal FIR filter.
void | shape_symbols (const Vec< T1 > &input, Vec< T1 > &output)
| Shape the input symbols performing upsampling.
Vec< T1 > | shape_symbols (const Vec< T1 > &input)
| Shape the input symbols performing upsampling.
void | shape_samples (const Vec< T1 > &input, Vec< T1 > &output)
| Shape the input samples already upsampled.
Vec< T1 > | shape_samples (const Vec< T1 > &input)
| Shape the input symbols already upsampled.
void | clear (void)
| Clear internal states.

## Protected Attributes

double | roll_off_factor
| The roll off factor (i.e. alpha)
Vec< double > | impulse_response
| The impulse resounse of the pulse shaping filter.
MA_Filter< T1, double, T1 > | shaping_filter
| The pulse shaping filter.
int | pulse_length
| Length in symbols.
int | upsampling_factor
| Samples per input symbol.
bool | setup_done
| Ensures that setup is called before any other member function.

## Detailed Description

template<class T1>
class itpp::Raised_Cosine< T1 >

Raised Cosine (RC) Pulse Shaper.

Upsamples and shapes symbols as raised cosine pulses with a given roll-off factor . The raised cosine pulse shape is defined as:

For more details see e.g. Lee & Messerschmitt, p. 190. Observe that the shaping is done with a FIR filter where the size is given by filter_length * over_sample_factor + 1. The first samples in the output will therefore be zero or small before the memory of the filter is filled.

What is important, when using RC shaping in a transmission system with the AWGN channel, the mean power of the output samples is not normalised, so the channel noise variance (or shaped signal) should be scaled appropriately.

The class is templated as follows: `T1` is the type of the input and the output samples. An example of usage is:

#include "itpp/itcomm.h"
Raised_Cosine<double> rc(0.5, 6, 8);
BPSK bpsk;
vec symbols, samples;
symbols = bpsk.modulate_bits(randb(20));
samples = rc.shape_symbols(symbols);
itpp::Array
General array class.
Definition array.h:105
itpp::BPSK
BPSK modulator with real symbols.
Definition modulator.h:877
itpp::BPSK::modulate_bits
void modulate_bits(const bvec &bits, vec &output) const
Modulate bits into BPSK symbols in complex domain.
Definition modulator.cpp:310
itpp::randb
bin randb(void)
Generates a random bit (equally likely 0s and 1s)
Definition random.h:793
itcomm.h
Include file for the IT++ communications module.

Definition at line 162 of file pulse_shape.h.

## Constructor & Destructor Documentation

## Raised_Cosine() [1/2]

template<class T1 >

itpp::Raised_Cosine< T1 >::Raised_Cosine | ( |  | ) |

inline

Constructor.

Definition at line 166 of file pulse_shape.h.

## Raised_Cosine() [2/2]

template<class T1 >

itpp::Raised_Cosine< T1 >::Raised_Cosine | ( | double | roll_off,
|  | int | filter_length = `6`,
|  | int | upsampling_factor = `8`
| ) |  |

Constructor.

Definition at line 359 of file pulse_shape.h.

## ~Raised_Cosine()

template<class T1 >

virtual itpp::Raised_Cosine< T1 >::~Raised_Cosine | ( |  | ) |

inlinevirtual

Destructor.

Definition at line 170 of file pulse_shape.h.

## Member Function Documentation

## set_pulse_shape() [1/2]

template<class T1 >

void itpp::Raised_Cosine< T1 >::set_pulse_shape | ( | double | roll_off_factor,
|  | int | filter_length = `6`,
|  | int | upsampling_factor = `8`
| ) |  |

Set pulse shape (roll_off_factor between 0 and 1, filter_length even)

Definition at line 365 of file pulse_shape.h.

References itpp::is_even(), it_assert, it_error_if, itpp::pi, itpp::Array< T >::set_size(), itpp::sinc(), itpp::Array< T >::size(), and itpp::sqr().

## get_roll_off()

template<class T1 >

double itpp::Raised_Cosine< T1 >::get_roll_off | ( | void |  | ) | const

Get the roll-off factor.

Definition at line 408 of file pulse_shape.h.

References it_assert.

## set_pulse_shape() [2/2]

void itpp::Pulse_Shape< T1, double , T1 >::set_pulse_shape | ( | const Vec< double > & | impulse_response,
|  | int | upsampling_factor
| ) |  |

inherited

Set the general impulse response of the FIR filter.

Observe that the pulse shape must have a duration of an integer number of symbols. Thus the length of the impulse response-1 modulo over sampling is an integer.

Definition at line 89 of file pulse_shape.h.

## get_pulse_shape()

Vec< double > itpp::Pulse_Shape< T1, double , T1 >::get_pulse_shape | ( | void |  | ) | const

inherited

Get the pulse shape.

Definition at line 91 of file pulse_shape.h.

## get_upsampling_factor()

int itpp::Pulse_Shape< T1, double , T1 >::get_upsampling_factor | ( | void |  | ) | const

inherited

Get the over sampling factor.

Definition at line 93 of file pulse_shape.h.

## get_pulse_length()

int itpp::Pulse_Shape< T1, double , T1 >::get_pulse_length | ( | void |  | ) | const

inherited

Get the length of the pulse in number of symbols.

Definition at line 95 of file pulse_shape.h.

## get_filter_length()

int itpp::Pulse_Shape< T1, double , T1 >::get_filter_length | ( | void |  | ) | const

inherited

Get the length of the internal FIR filter.

Definition at line 97 of file pulse_shape.h.

## shape_symbols() [1/2]

void itpp::Pulse_Shape< T1, double , T1 >::shape_symbols | ( | const Vec< T1 > & | input,
|  | Vec< T1 > & | output
| ) |  |

inherited

Shape the input symbols performing upsampling.

Definition at line 100 of file pulse_shape.h.

## shape_symbols() [2/2]

Vec< T1 > itpp::Pulse_Shape< T1, double , T1 >::shape_symbols | ( | const Vec< T1 > & | input | ) |

inherited

Shape the input symbols performing upsampling.

Definition at line 102 of file pulse_shape.h.

## shape_samples() [1/2]

void itpp::Pulse_Shape< T1, double , T1 >::shape_samples | ( | const Vec< T1 > & | input,
|  | Vec< T1 > & | output
| ) |  |

inherited

Shape the input samples already upsampled.

Definition at line 105 of file pulse_shape.h.

## shape_samples() [2/2]

Vec< T1 > itpp::Pulse_Shape< T1, double , T1 >::shape_samples | ( | const Vec< T1 > & | input | ) |

inherited

Shape the input symbols already upsampled.

Definition at line 107 of file pulse_shape.h.

## clear()

void itpp::Pulse_Shape< T1, double , T1 >::clear | ( | void |  | ) |

inherited

Clear internal states.

Definition at line 110 of file pulse_shape.h.

## Member Data Documentation

## roll_off_factor

template<class T1 >

double itpp::Raised_Cosine< T1 >::roll_off_factor

protected

The roll off factor (i.e. alpha)

Definition at line 178 of file pulse_shape.h.

## impulse_response

Vec<double > itpp::Pulse_Shape< T1, double , T1 >::impulse_response

protectedinherited

The impulse resounse of the pulse shaping filter.

Definition at line 114 of file pulse_shape.h.

## shaping_filter

MA_Filter<T1, double , T1 > itpp::Pulse_Shape< T1, double , T1 >::shaping_filter

protectedinherited

The pulse shaping filter.

Definition at line 116 of file pulse_shape.h.

## pulse_length

int itpp::Pulse_Shape< T1, double , T1 >::pulse_length

protectedinherited

Length in symbols.

Definition at line 118 of file pulse_shape.h.

## upsampling_factor

int itpp::Pulse_Shape< T1, double , T1 >::upsampling_factor

protectedinherited

Samples per input symbol.

Definition at line 120 of file pulse_shape.h.

## setup_done

bool itpp::Pulse_Shape< T1, double , T1 >::setup_done

protectedinherited

Ensures that setup is called before any other member function.

Definition at line 122 of file pulse_shape.h.

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

- itpp/comm/pulse_shape.h

Generated on Mon Jun 10 2024 11:49:39 for IT++ by Doxygen 1.9.8