Controlling the Group Delay

If rcosflt designs the filter automatically, then you can control the group delay of the filter, as described below. If you specify your own FIR filter, then rcosflt does not need to know its group delay.

The filter's group delay is the time between the filter's initial response and its peak response. The default group delay in the implementation is three input samples. To specify a different value, measure it in input symbol periods and provide it as the sixth input argument. For example, the command below specifies a group delay of six input samples, which is equivalent to 6 *8 /1 output samples.

y = rcosflt([1;0;0],1,8,'fir',.2,6); % Delay is 6 input samples.

The group delay influences the size of the output, as well as the order of the filter if rcosflt designs the filter automatically. See the reference page for rcosflt for details that relate to the syntax you want to use.

Example: Raised Cosine Filter Delays

The code below filters a signal using two different group delays. A larger delay results in a smaller error in the frequency response of the filter. The plot shows how the two filtered signals differ, and the output pt indicates that the first peak occurs at different times for the two filtered signals. In the plot, the solid line corresponds to a delay of six samples, while the dashed line corresponds to a delay of eight samples.

[y,t] = rcosflt(ones(10,1),1,8,'fir',.5,6); % Delay = 6 samples
[y1,t1] = rcosflt(ones(10,1),1,8,'fir',.5,8); % Delay = 8 samples
plot(t,y,t1,y1,'--') % Two curves indicate the different delays.
legend('Delay = 6 samples','Delay = 8 samples','Location','NorthOutside');
peak = t(find(y == max(y))); % Times where first curve peaks
peak1 = t1(find(y1 == max(y1))); % Times where second curve peaks
pt = [min(peak), min(peak1)] % First peak time for both curves

The output is below.

pt =

   14.6250   16.6250

If Fs/Fd is at least 4, then a group delay value of at least 8 works well in many cases. In the examples of this section, Fs/Fd is 8.

Delays of Six Samples (Solid) and Eight Samples (Dashed)


© 1994-2005 The MathWorks, Inc.