def rc_imp(Ns,alpha,M=<NUM_LIT:6>):
<EOL>n = np.arange(-M*Ns,M*Ns+<NUM_LIT:1>)<EOL>b = np.zeros(len(n))<EOL>a = alpha<EOL>Ns *= <NUM_LIT:1.0><EOL>for i in range(len(n)):<EOL><INDENT>if (<NUM_LIT:1> - <NUM_LIT:4>*(a*n[i]/Ns)**<NUM_LIT:2>) == <NUM_LIT:0>:<EOL><INDENT>b[i] = np.pi/<NUM_LIT:4>*np.sinc(<NUM_LIT:1>/(<NUM_LIT>*a))<EOL><DEDENT>else:<EOL><INDENT>b[i] = np.sinc(n[i]/Ns)*np.cos(np.pi*a*n[i]/Ns)/(<NUM_LIT:1> - <NUM_LIT:4>*(a*n[i]/Ns)**<NUM_LIT:2>)<EOL><DEDENT><DEDENT>return b<EOL>
A truncated raised cosine pulse used in digital communications.

The pulse shaping factor :math:`0 < \\alpha < 1` is required as well as the
truncation factor M which sets the pulse duration to be :math:`2*M*T_{symbol}`.

Parameters
----------
Ns : number of samples per symbol
alpha : excess bandwidth factor on (0, 1), e.g., 0.35
M : equals RC one-sided symbol truncation factor

Returns
-------
b : ndarray containing the pulse shape

See Also
--------
sqrt_rc_imp

Notes
-----
The pulse shape b is typically used as the FIR filter coefficients
when forming a pulse shaped digital communications waveform.

Examples
--------
Ten samples per symbol and :math:`\\alpha = 0.35`.

>>> import matplotlib.pyplot as plt
>>> from sk_dsp_comm.digitalcom import rc_imp
>>> from numpy import arange
>>> b = rc_imp(10,0.35)
>>> n = arange(-10*6,10*6+1)
>>> plt.stem(n,b)
>>> plt.show()