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:
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.
Specify the filter shape as one of Normal or Square root. The default is Square root.
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.
|clone||Create RaisedCosineTransmitFilter object with same property values|
|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 fitler has a square root shape and that there are 8 samples per symbol.
hFilt = comm.RaisedCosineTransmitFilter
hFilt = System: comm.RaisedCosineTransmitFilter Properties: Shape: 'Square root' RolloffFactor: 0.2 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, hFilt.
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 coeffs method.
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 b.Numerator
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.