Apply pulse shaping by decimating signal using raised cosine filter


The Raised Cosine Receive Filter System object™ applies pulse-shaping by decimating an input signal using a raised cosine FIR filter.

To decimate the input signal:

  1. Define and set up your raised cosine receive filter object. See Construction.

  2. Call step to decimate the input signal according to the properties of comm.RaisedCosineReceiveFilter. The behavior of step is specific to each object in the toolbox.


Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


H = comm.RaisedCosineReceiveFilter returns a raised cosine receive filter System object, H, which decimates the input signal. The filter uses an efficient polyphase FIR decimation structure and has unit energy.

H = comm.RaisedCosineReceiveFilter(PropertyName,PropertyValue, ...) returns a raised cosine receive filter object, H, with each specified property set to the specified value.



Filter shape

Specify the filter shape as one of Normal or Square root. The default is Square root.


Rolloff factor

Specify the rolloff factor as a scalar between 0 and 1. The default is 0.2.


Filter span in symbols

Specify the number of symbols the filter spans as an integer-valued positive scalar. The default is 10. Because the ideal raised cosine filter has an infinite impulse response, the object truncates the impulse response to the value you specify for this property.


Input samples per symbol

Specify the number of input samples that represent a symbol. The default is 8. This property accepts an integer-valued, positive double or single scalar value. The raised cosine filter has (FilterSpanInSymbols x InputSamplesPerSymbol + 1) taps.


Decimation factor

Specify the factor by which the object reduces the sampling rate of the input signal. The default value is 8. This property accepts a positive integer scalar value between 1 and InputSamplesPerSymbol. The value must evenly divide into InputSamplesPerSymbol. The number of input rows must be a multiple of the decimation factor. If you set DecimationFactor to 1, then the object only applies filtering without downsampling.


Specify the number of filtered samples the System object discards before downsampling. The default is 0. This property accepts an integer valued scalar between 0 and DecimationFactor − 1.


Linear filter gain

Specify the linear gain of the filter as a positive numeric scalar. The default is 1. The object designs a raised cosine filter that has unit energy, and then applies the linear gain to obtain final tap values.


coeffsReturns coefficients for filters
resetReset internal states of System object
stepOutput decimated values of input signal
Common to All System Objects

Allow System object property value changes


collapse all

Filter the output of a square root raised cosine transmit filter using a matched square root raised cosine receive filter. The input signal has eight samples per symbol.

Create a raised cosine transmit filter and set the OutputSamplesPerSymbol property to 8.

 txfilter = comm.RaisedCosineTransmitFilter('OutputSamplesPerSymbol',8);

Create a raised cosine receive filter and set the InputSamplesPerSymbol property to 8 and the DecimationFactor property to 8.

rxfilter = comm.RaisedCosineReceiveFilter('InputSamplesPerSymbol',8, ...

Use the coeffs function to determine the filter coefficients for both filters.

txCoef = coeffs(txfilter);
rxCoef = coeffs(rxfilter);

Launch the filter visualization tool and display the magnitude responses of the two filters. Observe that they have identical responses.

 legend('Tx Filter','Rx Filter')

Generate a random bipolar signal and then interpolate.

 preTx = 2*randi([0 1],100,1) - 1;
 y = txfilter(preTx);

Decimate the signal using the raised cosine receive filter System object.

 postRx = rxfilter(y);

The filter delay is equal to the FilterSpanInSymbols property. Adjust for the delay to compare the pre-Tx filter signal with the post-Rx filter signal.

delay = txfilter.FilterSpanInSymbols;
x = (1:(length(preTx)-delay));
legend('Pre-Tx Filter','Post-Rx Filter')

You can see that the two signals overlap one another since the receive filter is matched to the transmit filter.

Decimate a bipolar signal using a square root raised cosine filter whose impulse response is truncated to six symbol durations.

Create a raised cosine transmit filter and set the FilterSpanInSymbols property to 6. The object truncates the impulse response to six symbols.

txfilter = comm.RaisedCosineTransmitFilter('FilterSpanInSymbols',6);

Generate a random bipolar signal and filter it using txfilter.

x = 2*randi([0 1],25,1) - 1;
y = txfilter(x);

Create a matched raised cosine receive filter System object.

rxfilter = comm.RaisedCosineReceiveFilter('FilterSpanInSymbols',6);

Launch the filter visualization tool to show the impulse response of the receive filter.


Filter the output signal from the transmit filter using the matched receive filter object, rxfilter.

r = rxfilter(y);

Plot the interpolated signal. Because of the filter span, there is a delay of six symbols before data passes through the filter.


Create a raised cosine receive filter with unity passband gain.

Create a raised cosine receive filter System object™. Obtain the filter coefficients using the coeffs function.

rxfilter = comm.RaisedCosineReceiveFilter;
b = coeffs(rxfilter);

A filter with unity passband gain has filter coefficients such that the sum of coefficients is 1. Therefore, set the Gain property to the inverse of the sum of b.Numerator.

rxfilter.Gain = 1/sum(b.Numerator);

Verify that the sum of the coefficients from the resulting filter equal 1.

bNorm = coeffs(rxfilter);
ans = 1.0000

Plot the frequency response of the filter. Note that it shows a passband gain of 0 dB, which is unity gain.


Extended Capabilities

Introduced in R2013b