function [y, t] = rcosflt(x, Fd, Fs, type_flag, R, Delay, tol)
%RCOSFLT Filter the input signal using a raised cosine filter.
%
%   WARNING: RCOSFLT has been removed. Use RCOSDESIGN instead.
%
%   Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG, R, DELAY) filters the input signal X
%   using a raised cosine FIR filter. The sample frequency for the input, X,
%   is Fd (Hz).  The sample frequency for the output, Y, is Fs (Hz).  Fs must be
%   an integer multiple of Fd.  The TYPE_FLAG gives specific filter design
%   or filtering options.  The roll-off factor, R, determines the width of the
%   transition band of the filter.  DELAY is the time delay from the beginning
%   of the filter to the peak of the impulse response.
%
%   R, the roll-off factor specifies the excess bandwidth of the filter.  R must
%   be in the range [0, 1]. For example, R = .5 means that the bandwidth of the
%   filter is 1.5 times the input sampling frequency, Fd.  This also means that
%   the transition band of the filter extends from .5 * Fd and 1.5 * Fd.  Since
%   R is normalized to the input sampling frequency, Fd, it has no units.
%   Typical values for R are between 0.2 to 0.5.
%
%   DELAY determines the group delay of the filter.  The group delay is the
%   opposite of the change in filter phase with respect to frequency.  For linear
%   phase filters, the group delay is also the time delay between the input
%   signal and the peak response of the filter.  DELAY also determines the
%   length of the filter impulse response used to filter X.  This delay is
%       Fs/Fd * 2 * DELAY + 1.
%
%   Y is the output of the upsampled, filtered input stream X.  The length of
%   vector Y is
%       Fs/Fd * (length(X) + 2 * DELAY).
%
%   TYPE_FLAG is a string which may contain any of the option strings listed
%   below delimited by a '/'  For example, the 'iir' and 'Fs' flags may
%   be combined as 'iir/Fs'.  While some of the pairs of option substrings
%   are mutually exclusive, they are not mutually exclusive in general.
%
%   'fir'    Design an FIR filter and use it to filter X.  When the 'filter'
%            TYPE_FLAG is not used, an FIR filter is designed and used to
%            filter X.  See the 'filter' TYPE_FLAG description for the behavior
%            when the 'fir' and 'filter' TYPE_FLAGs are used together.  This
%            option is exclusive of the 'iir' substring.
%
%   'iir'    Design an IIR filter and use it to filter X.  When the 'filter'
%            TYPE_FLAG is not used, an IIR approximation to the equivalent FIR
%            filter is designed and used to filter X.  See the 'filter'
%            TYPE_FLAG description for the behavior when the 'iir' and 'filter'
%            TYPE_FLAGs are used together.  This option is exclusive of the
%            'fir' substring.
%
%   'normal' Design a normal raised cosine filter and use it to filter X.  The
%            filter coefficients are normalized so the peak coefficient is one.
%            This option is exclusive of the 'sqrt' substring.
%
%   'sqrt'   Design a square root raised cosine filter and use it to filter X.
%            The filter coefficients are normalized so that the impulse
%            response of this filter when convolved with itself will result
%            in an impulse response that is approximately equal to the 'normal'
%            raised cosine filter.  The difference in this approximation is due
%            to finite filter length.  This is a useful option when the raised
%            cosine filtering is split between transmitter and receiver by
%            using the 'sqrt' filter in each device. This option is exclusive
%            of the 'normal' substring.
%
%   'Fs'     X is input with sample frequency Fs (i.e., the input signal has
%            Fs/Fd samples per symbol). In this case the input signal is not
%            upsampled from Fd to Fs but is simply filtered by the raised
%            cosine filter.  This is useful for filtering an oversampled data
%            stream at the receiver.  When using the 'Fs' substring, the length
%            of vector, Y is
%               length(X) + Fs/Fd * 2 * DELAY.
%
%   'filter' Means the filter is provided by the user.  When using the 'filter'
%            TYPE_FLAG, the input parameters are:
%
%            Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG, NUM) - filters with a user-
%            supplied FIR filter.  When the TYPE_FLAG contains 'filter' and
%            the 'fir' type substrings, the FIR filter indicated by NUM is
%            used to filter X.
%
%            Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG, NUM, DEN, DELAY) - filters with
%            a user-supplied IIR filter.  When TYPE_FLAG contains both 'filter'
%            and 'iir' type substrings, the IIR filter defined by numerator,
%            NUM, and denominator, DEN, is used as to filter X.  The DELAY
%            parameter is used to force RCOSFLT to behave as if the filter were
%            designed by RCOSFLT using the same DELAY parameter.  The DELAY
%            parameter should match the DELAY parameter used to design the
%            filter defined by NUM and DEN in the RCOSINE function.  The default
%            value of DELAY is 3.
%
%            The raised cosine filter should be designed using the RCOSINE
%            function.
%
%   Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG, R) filters the input signal X
%   using a raised cosine filter and default DELAY parameter, 3.
%
%   Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG) filters the input signal X using a
%   raised cosine filter and the following default parameters
%       DELAY = 3
%       R = .5
%
%   Y = RCOSFLT(X, Fd, Fs) filters the input signal X using a raised cosine
%   filter and the following default parameters
%       DELAY = 3
%       R = .5
%       TYPE_FLAG = 'fir/normal'
%
%   Y = RCOSFLT(X, Fd, Fs, TYPE_FLAG, R, DELAY, TOL) specifies the
%   tolerance in IIR filter design. The default value for TOL is .01.
%
%   [Y, T] = RCOSFLT(...) returns the time vector in T.
%
%   See also RCOSDESIGN, RCOSDEMO, GAUSSDESIGN.

%   Copyright 1996-2023 The MathWorks, Inc.

error(message('comm:rcosfir:willBeRemoved', 'rcosflt', 'rcosdesign'));
