rcosflt

Filter input signal using raised cosine filter

Syntax

y = rcosflt(x,Fd,Fs)
y = rcosflt(x,Fd,Fs,'filter_type',r,delay,tol)
y = rcosflt(x,Fd,Fs,'filter_type/Fs',r,delay,tol)
y = rcosflt(x,Fd,Fs,'filter_type/filter',num,den)
y = rcosflt(x,Fd,Fs,'filter_type/filter',num,den,delay)
y = rcosflt(x,Fd,Fs,'filter_type/filter/Fs',num,den...)
[y,t] = rcosflt(...)

Optional Inputs

InputDefault Value
filter_typefir/normal
r0.5
delay3
tol0.01
den1

Description

The function rcosflt passes an input signal through a raised cosine filter. You can either let rcosflt design a raised cosine filter automatically or you can specify the raised cosine filter yourself using input arguments.

Designing the Filter Automatically

y = rcosflt(x,Fd,Fs) designs a raised cosine FIR filter and then filters the input signal x using it. The sample frequency for the digital input signal x is Fd, and the sample frequency for the output signal y is Fs. The ratio Fs/Fd must be an integer. In the course of filtering, rcosflt upsamples the data by a factor of Fs/Fd, by inserting zeros between samples. The order of the filter is 1+2*delay*Fs/Fd, where delay is 3 by default. If x is a vector, then the sizes of x and y are related by this equation.

length(y) = (length(x) + 2 * delay)*Fs/Fd

Otherwise, y is a matrix, each of whose columns is the result of filtering the corresponding column of x.

y = rcosflt(x,Fd,Fs,'filter_type',r,delay,tol) designs a raised cosine FIR or IIR filter and then filters the input signal x using it. The ratio Fs/Fd must be an integer. r is the rolloff factor for the filter, a real number in the range [0, 1]. delay is the filter's group delay, measured in input samples. The actual group delay in the filter design is delay/Fd seconds. The input tol is the tolerance in the IIR filter design. FIR filter design does not use tol.

The characteristics of x, Fd, Fs, and y are as in the first syntax.

The fourth input argument, 'filter_type', is a string that determines the type of filter that rcosflt should design. Use one of the values in the table below.

Values of filter_type to Determine the Type of Filter

Type of FilterValue of filter_type
FIR raised cosine filter fir or fir/normal
IIR raised cosine filter iir or iir/normal
Square-root FIR raised cosine filter fir/sqrt
Square-root IIR raised cosine filter iir/sqrt

y = rcosflt(x,Fd,Fs,'filter_type/Fs',r,delay,tol) is the same as the previous syntax, except that it assumes that x has sample frequency Fs. This syntax does not upsample x any further. If x is a vector, then the relative sizes of x and y are related by this equation.

length(y) = length(x) + (2 * delay * Fs/Fd)

As before, if x is a nonvector matrix, then y is a matrix each of whose columns is the result of filtering the corresponding column of x.

Specifying the Filter Using Input Arguments

y = rcosflt(x,Fd,Fs,'filter_type/filter',num,den) filters the input signal x using a filter whose transfer function numerator and denominator are given in num and den, respectively. If filter_type includes fir, then omit den. This syntax uses the same arguments x, Fd, Fs, and filter_type as explained in the first and second syntaxes above.

y = rcosflt(x,Fd,Fs,'filter_type/filter',num,den,delay) uses delay in the same way that the rcosine function uses it. This syntax assumes that the filter described by num, den, and delay was designed using rcosine.

As before, if x is a nonvector matrix, then y is a matrix each of whose columns is the result of filtering the corresponding column of x.

y = rcosflt(x,Fd,Fs,'filter_type/filter/Fs',num,den...) is the same as the earlier syntaxes, except that it assumes that x has sample frequency Fs instead of Fd. This syntax does not upsample x any further. If x is a vector, then the relative sizes of x and y are related by this equation.

length(y) = length(x) + (2 * delay * Fs/Fd)

Additional Output

[y,t] = rcosflt(...) outputs t, a vector that contains the sampling time points of y.

See Also

rcosine, rcosfir, rcosiir, rcosdemo, Special Filters

References

[1] Korn, Israel, Digital Communications, New York, Van Nostrand Reinhold, 1985.


© 1994-2005 The MathWorks, Inc.