def NRZ_bits2(data,Ns,pulse='<STR_LIT>',alpha = <NUM_LIT>,M=<NUM_LIT:6>):
N_bits = len(data)<EOL>n_zeros = np.zeros((N_bits,int(Ns)-<NUM_LIT:1>))<EOL>x = np.hstack((<NUM_LIT:2>*data.reshape(N_bits,<NUM_LIT:1>)-<NUM_LIT:1>,n_zeros))<EOL>x = x.flatten()<EOL>if pulse.lower() == '<STR_LIT>':<EOL><INDENT>b = np.ones(int(Ns))<EOL><DEDENT>elif pulse.lower() == '<STR_LIT>':<EOL><INDENT>b = rc_imp(Ns,alpha,M)<EOL><DEDENT>elif pulse.lower() == '<STR_LIT:src>':<EOL><INDENT>b = sqrt_rc_imp(Ns,alpha,M)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>x = signal.lfilter(b,<NUM_LIT:1>,x)<EOL>return x,b/float(Ns)<EOL>
Generate non-return-to-zero (NRZ) data bits with pulse shaping with user data

A baseband digital data signal using +/-1 amplitude signal values
and including pulse shaping. The data sequence is user supplied.

Parameters
----------
data : ndarray of the data bits as 0/1 values
Ns : the number of samples per bit,
pulse_type : 'rect' , 'rc', 'src' (default 'rect')
alpha : excess bandwidth factor(default 0.25)
M : single sided pulse duration (default = 6) 

Returns
-------
x : ndarray of the NRZ signal values
b : ndarray of the pulse shape

Notes
-----
Pulse shapes include 'rect' (rectangular), 'rc' (raised cosine), 
'src' (root raised cosine). The actual pulse length is 2*M+1 samples.

Examples
--------
>>> import matplotlib.pyplot as plt
>>> from sk_dsp_comm.sigsys import NRZ_bits2
>>> from sk_dsp_comm.sigsys import m_seq
>>> from numpy import arange
>>> x,b = NRZ_bits2(m_seq(5),10)
>>> t = arange(len(x))
>>> plt.ylim([-1.01, 1.01])
>>> plt.plot(t,x)