-
sdr.raised_cosine(alpha: float, span: int, sps: int, norm: 'power' | 'energy' | 'passband' =
'energy'
) NDArray[float_] Returns a raised cosine (RC) pulse shape.
- Parameters:¶
- alpha: float¶
The excess bandwidth \(0 \le \alpha \le 1\) of the filter.
- span: int¶
The length of the filter in symbols. The length of the filter is
span * sps + 1
samples. The filter orderspan * sps
must be even.- sps: int¶
The number of samples per symbol.
- norm: 'power' | 'energy' | 'passband' =
'energy'
¶ Indicates how to normalize the pulse shape.
"power"
: The pulse shape is normalized so that the maximum power is 1."energy"
: The pulse shape is normalized so that the total energy is 1."passband"
: The pulse shape is normalized so that the passband gain is 1.
- Returns:¶
The raised cosine pulse shape.
References¶
Michael Rice, Digital Communications: A Discrete Time Approach, Appendix A.
Examples¶
The excess bandwidth \(\alpha\) controls bandwidth of the filter. A smaller \(\alpha\) results in a narrower bandwidth at the expense of higher sidelobes.
In [1]: h_0p1 = sdr.raised_cosine(0.1, 8, 10); \ ...: h_0p5 = sdr.raised_cosine(0.5, 8, 10); \ ...: h_0p9 = sdr.raised_cosine(0.9, 8, 10) ...: In [2]: plt.figure(figsize=(8, 4)); \ ...: sdr.plot.impulse_response(h_0p1, label=r"$\alpha = 0.1$"); \ ...: sdr.plot.impulse_response(h_0p5, label=r"$\alpha = 0.5$"); \ ...: sdr.plot.impulse_response(h_0p9, label=r"$\alpha = 0.9$") ...: In [3]: plt.figure(figsize=(8, 4)); \ ...: sdr.plot.magnitude_response(h_0p1, label=r"$\alpha = 0.1$"); \ ...: sdr.plot.magnitude_response(h_0p5, label=r"$\alpha = 0.5$"); \ ...: sdr.plot.magnitude_response(h_0p9, label=r"$\alpha = 0.9$") ...:
The span of the filter affects the stopband attenuation. A longer span results in greater stopband attenuation and lower sidelobes.
In [4]: h_4 = sdr.raised_cosine(0.1, 4, 10); \ ...: h_8 = sdr.raised_cosine(0.1, 8, 10); \ ...: h_16 = sdr.raised_cosine(0.1, 16, 10) ...: In [5]: plt.figure(figsize=(8, 4)); \ ...: sdr.plot.impulse_response(h_4, label="span = 4"); \ ...: sdr.plot.impulse_response(h_8, label="span = 8"); \ ...: sdr.plot.impulse_response(h_16, label="span = 16") ...: In [6]: plt.figure(figsize=(8, 4)); \ ...: sdr.plot.magnitude_response(h_4, label="span = 4"); \ ...: sdr.plot.magnitude_response(h_8, label="span = 8"); \ ...: sdr.plot.magnitude_response(h_16, label="span = 16") ...:
See the Pulse shapes example.