Apply pulse shaping by interpolating signal using raised cosine filter
Raised Cosine Transmit Filter System object™ applies
pulse-shaping by interpolating an input signal using a raised cosine
To interpolate the input signal:
H = comm.RaisedCosineTransmitFilter returns
a raised cosine transmit filter System object,
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( returns a raised cosine transmit filter object,
with each specified property set to the specified value.
Specify the filter shape as one of
Specify the rolloff factor as a scalar between
Filter span in symbols
Specify the number of symbols the filter spans as an integer-valued,
positive scalar. The default is
Output samples per symbol
Specify the number of output samples for each input symbol.
The default is
Linear filter gain
Specify the linear gain of the filter as a positive numeric
scalar. The default is
|coeffs||Returns coefficients for filters|
|isLocked||Locked status for input attributes and nontunable properties|
|release||Allow property value and input characteristics changes|
|reset||Reset internal states of System object|
|step||Output interpolated values of input signal|
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.
hFilt = comm.RaisedCosineTransmitFilter
hFilt = 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
step function of the filter object,
filteredData = step(hFilt,data);
To view the spectrum of the filtered signal, create a spectrum analyzer object with a sample rate of 1000 Hz.
hSA = 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.
hTxFilt = comm.RaisedCosineTransmitFilter('FilterSpanInSymbols',6);
Launch the filter visualization tool to show the impulse response.
Generate a random bipolar signal and then interpolate.
x = 2*randi([0 1],96,1) - 1; y = step(hTxFilt,x);
Plot the interpolated signal.
plot(y) 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
h = comm.RaisedCosineTransmitFilter; b = coeffs(h);
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
h.Gain = 1/sum(b.Numerator);
Verify that the resulting filter coefficients sum to 1.
bNorm = coeffs(h); sum(bNorm.Numerator)
ans = 1.0000
Plot the filter frequency response. Note that it shows a passband gain of 0 dB.