Apply pulse shaping by interpolating signal using raised cosine filter


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

To interpolate the input signal:

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

  2. Call step to interpolate the input signal according to the properties of comm.RaisedCosineTransmitFilter. 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.RaisedCosineTransmitFilter returns a raised cosine transmit filter System object, H, which interpolates an input signal using a raised cosine FIR filter. The filter uses an efficient polyphase FIR interpolation structure and has unit energy.

H = comm.RaisedCosineTransmitFilter(PropertyName,PropertyValue, ...) returns a raised cosine transmit 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.


Output samples per symbol

Specify the number of output samples for each input symbol. The default is 8. This property accepts an integer-valued, positive scalar value. The raised cosine filter has (FilterSpanInSymbols x OutputSamplesPerSymbol + 1) taps.


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 interpolated values of input signal
Common to All System Objects

Allow System object property value changes


collapse all

This example shows how to interpolate a signal using the comm.RaisedCosineTransmitFilter System object and to display its spectrum.

Create a square root raised square root cosine transmit filter object. You can see that its default settings are such that the filter has a square root shape and that there are 8 samples per symbol.

txfilter = comm.RaisedCosineTransmitFilter
txfilter = 

  comm.RaisedCosineTransmitFilter with properties:

                     Shape: 'Square root'
             RolloffFactor: 0.2000
       FilterSpanInSymbols: 10
    OutputSamplesPerSymbol: 8
                      Gain: 1

Generate random bipolar data.

data = 2*randi([0 1],10000,1) - 1;

Filter the data by using the RRC filter.

filteredData = txfilter(data);

To view the spectrum of the filtered signal, create a spectrum analyzer object with a sample rate of 1000 Hz.

spectrumAnalyzer = dsp.SpectrumAnalyzer('SampleRate',1000);

View the spectrum of the filtered signal using the spectrum analyzer.


This example shows to create an interpolated signal from a square root raised cosine filter that is truncated to six symbol durations.

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

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

Launch the filter visualization tool to show the impulse response.


Generate random bipolar data and pass it through the filter.

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

Plot the interpolated signal.

grid on

This example shows how to create a raised cosine transmit filter with unity passband gain.

Generate a filter with unit energy. You can obtain the filter coefficients using the coeffs function.

txfilter = comm.RaisedCosineTransmitFilter;
b = coeffs(txfilter);

Plot the filter response. You can see that its gain is greater than unity (more than 0 dB).


A filter with unity passband gain has filter coefficients that sum to 1. Set the Gain property to the inverse of the sum of b.Numerator

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

Verify that the resulting filter coefficients sum to 1.

bNorm = coeffs(txfilter);
ans = 1.0000

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


Extended Capabilities

Introduced in R2013b