sah
Sample and hold oversampling.
Namespace: dsp::telecom
Prototype
Vector<T> sah(const Vector<T> &x, int R)
Parameters
x | Input vector. |
R | Number of samples to hold (e.g. oversampling factor). |
Returns
Oversampled signal.
Description
Each sample of the input signal is repeated \(R\) times. For instance, if \(R = 2\), and \(x = x_0, x_1, \dots\), then \(y = x_0, x_0, x_1, x_1, \dots\)
This function can be used to generate NRZ sequence.
Example 1: duplicating values
Example 2: generating a pseudo-random NRZ sequence
int nsymbs = 5; // Number of symbol to generate
int osf = 10; // Over-sampling ratio
Vecf y = sah(randb(nsymbs), osf);
// Will generate nsymbs * osf samples (each symbol is repeated osf times)