FIR Digital Filter Design
FIR Fractional Delay Filter Design
Example 1: Fractionally Iterated DelaySearch Spectral Audio Signal Processing
Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?
Figure B.25a shows the phase response of
when
computed using the matlab code shown in Fig.B.26. (The plot
utility is listed separately in Fig.B.27.) The fractional delay
of 4.5 samples is decomposed as
so that the transfer
function can be computed as
, i.e., as a fractionally
iterated convolution of
with itself.
![]() |
power = 1.5; % z^{-3} will be raised to this power
N = 64; % FFT size (power of 2)
fs = 1; % Sampling frequency
T = 1/fs; % Sampling period
f = (0:N-1)/N; % Frequency axis
w = 2*pi*f; % rad/sec
S = exp(-j*3*w*T); % Starting spectrum (3-sample delay)
Stp = S .^ power; % Go for it
Stpp = angle(Stp);
plottitle = sprintf(['angle(S^{%0.1f}), ',...
'where S = exp(-j*3*w*T)',...
'= spectrum of 3-sample delay'],power);
phasesubplot(Stpp,plottitle,1,4);
|
function [ph] = phasesubplot(phase,ptitle,iplot,nplots) % PHASESUBPLOT - Plot phase data in subplot iplot/nplots % % Phase data assumed to be in "FFT buffer format", \ie, % ordered from bin 0 to N-1 where N = FFT size. subplot(nplots,1,iplot); N = length(phase); f = (0:N-1)/N; % Frequency axis ph = stem(f-0.5,fftshift(phase),'k'); pic = chop(pi,3); % pi to three digits % place Y grid on multiples of pi/2: set(gca,'YTick',[-pic -pic/2 0 pic/2 pic]); set(gca,'XTick',-0.5:0.1:0.5); grid on; title(ptitle); axis([-0.5 0.5, -4, 4]); if (iplot == nplots) xlabel('Normalized Frequency (cycles per sample)'); end ylabel('Phase (rad)'); if (nplots>1) yl=get(gca,'YLim'); th=text(-0.6,yl(2),['(','a'+iplot-1,')']); set(th,'FontWeight','bold'); end |
We see that everything looks good between
and
(
), but outside of these
limits the phase response jumps by
radians. (For
reference, the correct phase response is shown in Fig.B.25d.)
A phase jump of
radians corresponds to a sign inversion.
Thus, the entire high-frequency band above
has been
negated! We are trying to design a fractional delay filter here, not
a ``high-frequency inverting fractional delay filter''! Something went
wrong.
To analyze this failure, let's look analytically at the expected phase
response. The phase response of a unit delay
is
angle(exp(-j*3*omega*T))It is more typical that the computed phase response will be wrapped into the range
Figure B.28 depicts the phase spectrum of S = exp(-j*3*w*T),
while Fig.B.25a shows the phase spectrum of S^1.5.
Consider now what happens when each sample of the complex array
S is raised to the power 1.5 in matlab by the expression
S .^ 1.5. Let
denote an arbitrary complex number.
Then we need to know how matlab computes
. This can be
thought of as fractionally iterated multiplication. In
general, we are asking how to compute
, where
is a
real exponent and
is any complex number.
One method for computing exponentiation by a real number,
,
is to approximate
by a rational number
[243]. We try out this approach in Example 2 of the next
section.
Another method for computing exponentiation
is by means of
logarithms. Expressing
in polar notation as
,
the natural logarithm of
can be written as
From Fig.B.25a, we can deduce that Matlab computes
by the logarithm method. This is because Fig.B.25a is clearly
angle()
call sees (B.7), as shown in Fig.B.25a.
