72template<
class T1,
class T2,
class T3>
251template<
class T1,
class T2,
class T3>
260template<
class T1,
class T2,
class T3>
266template<
class T1,
class T2,
class T3>
269 it_error_if(impulse_response_in.
size() == 0,
"Pulse_Shape: impulse response is zero length");
270 it_error_if(upsampling_factor_in < 1,
"Pulse_Shape: incorrect upsampling factor");
281template<
class T1,
class T2,
class T3>
287template<
class T1,
class T2,
class T3>
293template<
class T1,
class T2,
class T3>
299template<
class T1,
class T2,
class T3>
305template<
class T1,
class T2,
class T3>
318template<
class T1,
class T2,
class T3>
327template<
class T1,
class T2,
class T3>
340template<
class T1,
class T2,
class T3>
349template<
class T1,
class T2,
class T3>
367 it_error_if(roll_off_factor_in < 0 || roll_off_factor_in > 1,
"Raised_Cosine: roll-off out of range");
381 t = (double)(i - filter_length * upsampling_factor_in / 2)
382 / upsampling_factor_in;
425 it_error_if(roll_off_factor_in <= 0 || roll_off_factor_in > 1,
426 "Root_Raised_Cosine: roll-off out of range");
430 "Root_Raised_Cosine: Filter length not even");
433 double t, num, den, tmp_arg;
441 t = (double)(i - filter_length * upsampling_factor_in / 2)
442 / upsampling_factor_in;
451 * ((1 + 2 /
pi) * std::sin(tmp_arg) + (1 - 2 /
pi) * std::cos(tmp_arg));
480ITPP_EXPORT_TEMPLATE
template class ITPP_EXPORT Pulse_Shape < std::complex<double>, double,
481 std::complex<double> >;
482ITPP_EXPORT_TEMPLATE
template class ITPP_EXPORT Pulse_Shape < std::complex<double>, std::complex<double>,
483 std::complex<double> >;
Moving Average Filter Base Class.
Vec< T3 > shape_samples(const Vec< T1 > &input)
Shape the input symbols already upsampled.
Vec< T2 > get_pulse_shape(void) const
Get the pulse shape.
void set_pulse_shape(const Vec< T2 > &impulse_response, int upsampling_factor)
Set the general impulse response of the FIR filter.
void shape_samples(const Vec< T1 > &input, Vec< T3 > &output)
Shape the input samples already upsampled.
Pulse_Shape()
Constructor.
int get_filter_length() const
Get the length of the internal FIR filter.
int get_upsampling_factor() const
Get the over sampling factor.
void shape_symbols(const Vec< T1 > &input, Vec< T3 > &output)
Shape the input symbols performing upsampling.
MA_Filter< T1, T2, T3 > shaping_filter
The pulse shaping filter.
int get_pulse_length() const
Get the length of the pulse in number of symbols.
virtual ~Pulse_Shape()
Destructor.
Pulse_Shape(const Vec< T2 > &impulse_response, int upsampling_factor)
Constructor.
int pulse_length
Length in symbols.
Vec< double > impulse_response
Vec< T3 > shape_symbols(const Vec< T1 > &input)
Shape the input symbols performing upsampling.
bool setup_done
Ensures that setup is called before any other member function.
void clear(void)
Clear internal states.
Raised Cosine (RC) Pulse Shaper.
Raised_Cosine()
Constructor.
double roll_off_factor
The roll off factor (i.e. alpha)
double get_roll_off(void) const
Get the roll-off factor.
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)
(Square) Root Raised Cosine (RRC) Pulse Shaper
virtual ~Root_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 roll_off_factor
The roll off factor (i.e. alpha)
double get_roll_off(void) const
Get the Roll-off factor.
Root_Raised_Cosine()
Constructor.
int size() const
The size of the vector.
Definitions of Filter classes and functions.
#define it_error_if(t, s)
Abort if t is true.
#define it_assert(t, s)
Abort if t is not true.
bool is_even(int x)
Return true if x is an even integer.
vec sqr(const cvec &data)
Absolute square of elements.
double sinc(double x)
Sinc function: sinc(x) = sin(pi*x)/pi*x.
Various functions on vectors and matrices - header file.
const double pi
Constant Pi.
Resampling functions - header file.
Trigonometric and hyperbolic functions - header file.
Templated Vector Class Definitions.