| Communications Toolbox | ![]() |
The basic rcosflt syntax
y = rcosflt(x,Fd,Fs...) % Basic syntax
assumes by default that you want to apply the filter to a digital signal x whose sampling rate is Fd. The filter's sampling rate is Fs. The ratio of Fs to Fd must be an integer. By default, the function upsamples the input data by a factor of Fs/Fd before filtering. It upsamples by inserting Fs/Fd-1 zeros between consecutive input data samples. The upsampled data consists of Fs/Fd samples per symbol and has sampling rate Fs.
An example using this syntax is below. The output sampling rate is four times the input sampling rate.
y1 = rcosflt([1;0;0],1,4,'fir'); % Upsample by factor of 4/1.
You can also override the default upsampling behavior. In this case, the function assumes that the input signal already has sampling rate Fs and consists of Fs/Fd samples per symbol. You might want to maintain the sampling rate in a receiver's filter if the corresponding transmitter's filter has already upsampled sufficiently.
To maintain the sampling rate, modify the fourth input argument in rcosflt to include the string Fs. For example, in the first command below, rcosflt uses its default upsampling behavior and the output sampling rate is four times the input sampling rate. By contrast, the second command below uses Fs in the string argument and thus maintains the sampling rate throughout.
y1 = rcosflt([1;0;0],1,4,'fir'); % Upsample by factor of 4/1. y2 = rcosflt([1;0;0],1,4,'fir/Fs'); % Maintain sampling rate.
The second command assumes that the sampling rate of the input signal is 4, and that the input signal contains 4/1 samples per symbol.
An example that uses the 'Fs' option at the receiver is in Combining Two Square-Root Raised Cosine Filters.
| Filtering with Raised Cosine Filters | Designing Filters Automatically | ![]() |
© 1994-2005 The MathWorks, Inc.