- sdr.raised_cosine(alpha: float, span: int, sps: int) ndarray
Returns a raised cosine (RC) 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.