Simple AWGN digital transmission with pulse shaping

Firts we creat the modulated signal using "modem" class and "modulate" command.
Suppose the vector "modulated" is available that contains the TX symbols.

Pulse shaping filter design

Suppose that we use a raised cosine filter to pulse shape. First of all this filter must be designed.
The comman "fdesign" can be used to design several filter types (bandpass, lowpass, pulseshaping, notch, cic, etc). We use the pulse shaping option:
fdesign.pulseshaping(parameters)
This is just an object containing the filter caracteristics. The design will be done later. For example the command
rCosSpec =  fdesign.pulseshaping(8,'Raised Cosine','Nsym,Beta',6,0.25);
will design a raides cosine filter with an over sampling factor 8 samples/symbol, a length of 6 times symbol-duration (filter order = 6 times 8 samples= 48, it means 49 samples) and a roll-off of 0.25.

To design the filter we use the command "designe" : rCosFlt = design ( rCosSpec );
The numerator cofficients can be accessed by : rCosFlt.Numerator
We may normalize the filter to obtain the biggest sample to one : rCosFlt.Numerator = rCosFlt.Numerator / max(rCosFlt.Numerator)

Create transmitting shaped signal
First we zero pad the symbols using "upsample" function :
upsampled = upsample ( modulated , 8) because we used 8 samples/symbol in the filter sepc
and now filtering (or creating the pulses) using the command "filter"
x = filter (rCosFlt , upsampled);
Since the delay of the filter is (its length-1)/2, for obtaining the last symbol, it is necessary to add some zeros at the end of the sequence
FltDelay = (6*8)/2
x = filter (rCosFlt , [ upsampled , zeros (FltDelay,1) ] );

Add noise
noise =  sigma * ( randn ( length(x) , 1) + 1i * randn( length(x) ,1) );
r = x + noise;

Down sampling
The command is "downsample" with a few parameters
downsample( x , N ) downsamples input signal X by keeping every N-th sample starting with the first.
downsample( x, N , Phase ) specifies an optional sample offset "Phase" that must be an integer in the range [0, N-1].

z = downsample (r , 8 , dT);  for our example dT=0

Démodulation
As seen in "simple digital transmission".