FDF1
FDF1
Contents:
1. Introduction
2. Filters
3. System with simple delay
4. Fractional delay filters
5. Design method for fractional delay filters
6. Results
7. Conclusion
8. References
1. Introduction
A fractional delay filter is a digital filter which delays the input signal by a fraction of
sampling period. Such filters can be used in many areas of digital signal processing. For
example, time delay estimation, timing adjustment of digital modems, speech coding, speech
synthesis, arbitrary sampling rate conversion, echo cancellation... Design of a fractional delay
filter should meet two specifications: first the filter magnitude response must have an all-pass
behaviour in wide frequency range and it’s the phase response must be linear. Two main design
approaches are time domain approach and frequency domain approach. In time domain approach
filter coefficients are obtained through interpolation formula. Frequency domain approach is
based on frequency optimization.
One way to accomplish fractional delay is to convert the discrete time signal into
continuous time signal, then delay the analog signal by required time interval and then resample
the delayed analog signal to get a new discrete time signal. But this method is inefficient as one
need to design a continuous time system and conversion of the discrete time signal to an analog
signal and back to digital signal is also inefficient and unnecessary. We can design a discrete
time LTI system that delays a discrete time signal by a fractional number of samples.
2. Filters
Filters are the frequency selective circuits which passes only desired band of frequencies
and blocks or attenuates signals of frequencies outside this band. Filters can be classified in
number of ways:
1. Analog or Digital
2. Active or Passive
3. Audio (AF) or Radio frequency (RF)
4. Low pass , high pass, band pass , band reject and all pass filters
Depending on the type of the signal to be processed the filters are classified as analog
filters and digital filters. Analog filters are designed to process analog or actual signals while
digital filters process sampled values of analog signals using digital techniques. Depending on
the type of elements used in their construction, the filters are classified as passive or active
filters. Elements used in passive filters are resisters, capacitors and inductors. Active filters
employ transistors or op-amps in addition to resisters and capacitors. The type of the elements
used dictates the operating frequency range of the filter. For example, RC filters are commonly
used for audio or low frequency operations whereas, LC or crystal filters are used for RF or high
frequency operations. A low-pass filter is a filter that passes signals with a frequency lower than
a certain cutoff frequency and attenuates signals with frequencies higher than cutoff frequency.
A high-pass filter is a filter that passes signals with a frequency higher than a certain cutoff
frequency and attenuates signals with frequencies lower than cutoff frequency. A band-pass filter
passes frequencies within certain range and rejects (attenuates) frequencies outside that range.
Band reject filter passes most frequencies unaltered, but attenuates those in a specific range to
very low levels. An all-pass filter passes all frequencies equally in gain, but changes the phase
relationship among various frequencies.
Time delay is very common phenomenon in the engineering world. The system which
introduces delay to the signal is called delay element. The output of such system will be delayed
version of the input signal.
y ( t ) =x (t−x) (1)
x
X ( x )=∫ x ( t ) e
− j xt
dt (2)
−x
The Fourier transform Y() of the delayed signal y(t) can be written in terms of X()
−j xx
Y ( x )=e X ( x) (3)
The transfer function Hid() of the delay element can be expressed by means of Fourier
transforms X() and Y().
Y ( x ) − jx x
H id ( x )= =e (4)
X (x )
The term e-j corresponds to the Fourier transform of the delay of.
The continuous-time signal x(t) may be expressed by its samples x(nT), where n is the sample
index and T is the sample interval which is inverse of the sampling rate. The discrete-time
version of the delay operation for a sampled signal x(n) can simply be written as,
where D=/T is the desired delay as multiples of the unit delay. The samples of the output
sequence y(n) are equal to the delayed samples of the input sequence x(n), and the delay element
is called a digital delay line. The spectrum of a discrete-time signal can be expressed by means of
the discrete- time Fourier transform (DTFT),
x
X ( ω )=∑ x (n)e− jωn ;∨ω∨≤ x (6)
−x
− jωD
Y ( ω )=e X ( ω) (7)
The transfer function of an ideal discrete-time delay element can be given as,
Y ( ω ) − jωD
H ( ω )= =e ;∨ω∨≤ x (8)
X ( ω)
Y ( z) −D
H ( z )= =z (9)
X (z )
In digital signal processing it is easy to implement constant delay. If D is real, the delay
operation would not be simple, since the output value would lie somewhere between the known
samples of x(n). The sample values of y(n) would then have to be obtained by way of
interpolation from the sequence x(n). However this is different than the sampling rate
conversion. In fractional delay (FD) processing only one new sample per sampling interval needs
to be computed, whereas in interpolation for increasing the sampling rate, several new samples
per original sample interval may be needed and in the FD problem the fractional interval d to be
approximated is in general irrational, whereas in sample-rate conversions, simple rational ratios
are often used.
D=D∫ ¿+d ¿ ( 10 )
where, Dint is integer part of the delay and 0 < d < 1 is the fractional delay.
FDF provide useful building blocks that can be used for fine-tuning the sampling instants.
They can be utilized in many areas of digital signal processing. Synchronization in digital
modems, sampling rate conversion (irrational ratio), speech coding, speech synthesis, tuning the
music, time delay estimation, image re-sampling are some applications where FD filters are
useful.
In digital data transmission, the transmitter transmits data symbols using analog
waveforms which carry one or more bits of information each. The main task of the receiver is
to detect these symbols as reliably as possible. Hence the receiver must be synchronized to
the symbols of the incoming data signal. Even though the receiver usually knows the nominal
symbol rate of the transmitter, the analog oscillators that are used to generate the frequency
in practice have a limited precision and the frequency tends to vary with temperature and
aging. Further in mobile communications there will be frequency shifts due to the Doppler
effects. Hence, in practice the synchronization requires constant monitoring and adjustment.
Timing can be fine tuned by controlling appropriate FD filters. Low order FD filters are
sufficient for this application.
Changing the sampling rate is one of the standard problems in digital signal processing.
In many situations there is need for conversion between the different sampling frequencies
used in digital audio, which include 44.1 kHz (used in the CD-quality audio), 48 kHz (used
by the recorders), 32 kHz, 22.05 kHz, 11.025 kHz and 8 kHz among others. The sampling-
rate conversion is straightforward if the ratio of the input and output sampling rates is an
integer or a ratio of small integers. The sampling rate conversion for irrational ratios is more
difficult. In practice, the situation is often made even harder by the fact that the sampling rate
ratios are not only irrational but also time-varying. A conceptually simple solution can be
obtained using fractional delay filters, where every output sample is obtained from the input
sample by applying an FD filter approximating an appropriate delay.
3. Speech coding
Linear predictive coding is based on two processing steps: modelling the vocal tract
system and modelling the acoustic source or excitation. Here new samples are predicted by
forming a linear combination of past samples. Since shape of the vocal tract and accordingly
its resonance are varying relatively slowly, the weights called the prediction coefficients have
to be determined every 20-40ms. FD filters are very useful in improving speech coding
process. For example, to estimate pitch period a conventional pitch detector uses delay line
which approximates the pitch period and 3 tap FIR filter to improve prediction. Hence 4
parameters have to be encoded: length of the delay line and 3 predictor coefficients. With
fractional delay filter only two parameters have to be encoded: length of the delay line and
one predictor coefficient. This results in improved gain and quality with fewer bits for
encoding compared to the conventional method.
4. Speech synthesis
Fractional delay waveguide filters can be used to model variable sections of the vocal
tract in articulatory speech synthesis. They are also useful in adjusting the length of a vocal
tract model based on the transmission-line, which is very similar to the digital waveguide
approach.
5. Music synthesis
− jωD
H id ( ω ) =e ;∨ω∨≤ x ( 11 )
¿ H id ( ω ) ∨¿ 1 ( 12 )
Therefore the delay element is a linear-phase all-pass system. Its phase delay and the group delay
are,
id ( )
p ,id ( ) D ( 14 )
and
M.Tech., Digital Communications, Dept. of ECE, BEC, Bagalkot. Page 7
Fractional Delay Filters
id ( )
g ,id ( ) D
( 15 )
respectively.
Therefore impulse response of an ideal fractional delay filter is a shifted and sampled sinc
function, that is,
h ( n )=sinc (n−D) ( 16 )
Like the ideal low pass filter, the ideal fractional delay system cannot be exactly realized.
Because its impulse response is infinitely long, non-causal and not BIBO stable. To produce
realizable fractional delay filter we need to use some finite length approximation for the sinc
function.
Two approaches are FIR approximation of fractional delay and IIR (All pass) approximation of
Fractional Delay.
Here fractional delay filter implemented by method of windowing the ideal impulse response and
general least squares FIR approximation of a complex frequency response.
The impulse response of an FIR filter designed by the windowing method can be written in the
form,
1 ; ( M 1) n ( M 1)
w( n) 2 2
0 ; otherwise ( 18 )
where,
{
N
round ( D )− ; for even N
M= 2
( 19 )
N −1
floor ( D ) − ; for odd N
2
where, N is window length. The midpoint of the window function w(n) has been shifted by D so
that the shifted sinc function will be windowed symmetrically with respect to its centre. The
windowing method is suitable for real-time systems where the fractional delay is changed, since
the coefficients can be updated quickly. The samples of the sinc and the window function can be
stored in memory for several values of D. The approximation error will be larger with a window
function than without it. Thus, this design method does not minimize the LS error measure, but it
is an ad hoc modification of the LS technique. In general, the frequency response of an FD FIR
filter designed using this technique has a lower ripple but also a wider transition band than a
M.Tech., Digital Communications, Dept. of ECE, BEC, Bagalkot. Page 9
Fractional Delay Filters
corresponding LS filter. A drawback is that the control of the magnitude error is difficult when
changing the parameters of window.
In principle, the FIR fractional delay filter with the smallest LS error in the defined
approximation band is accomplished by defining the response only in that part of the frequency
band and by leaving the rest out of the error measure as a ‘don’t care’ band. This scheme also
enables frequency-domain weighting of the LS error. This technique is called general least
squares (GLS) FIR filter approximation and it results in the following error function,
xx xx
1 1
EGLS = ∫ W ( ω ) ¿ E ( e ) ∨¿ dω= ∫ W ( ω ) ¿ H ( e )−H id ( e )∨¿ dω ¿ ¿
jω 2 jω jω 2
( 20 )
x 0 x 0
Where, the error is defined in the low-pass frequency band [0, ] only and W(ω) is the
nonnegative frequency-domain weighting function. The DTFT of the FIR filter can be written as,
H ( e jω )=h T e ( 21 )
T
h=[h ( 0 ) h ( 1 ) ⋯ h ( N ) ] ( 22 )
− jω − jNω T
e=[1 e ⋯e ] ( 23 )
xx
1
EGLS = ∫
x 0
jω jω x
W ( ω ) [¿ h e−H id ( e ) ][h¿¿ T e−H id ( e ) ] dω ¿ ¿
T
( 24 )
xx
1
EGLS = ∫ W ( ω ) ¿ ¿ ( 25 )
x 0
where,
C=ℜ { e e H } ( 26 )
Here the superscript ‘H’ stands for the Hermitian operation, i.e., transposition with conjugation.
Then the error function can be expressed as,
T T
EGLS =h Ph−2h p 1+ p 0 ( 27 )
where ,
xx
1
P= ∫ W ( ω ) Cdω ( 28 )
x 0
xx
1
p1= ∫ W ( ω ) [¿ ℜ { H id ( e ) } c−ℑ { H id ( e ) } s ]dω ¿
jω jω
( 29 )
x 0
1
p0
W ( ) |H
0
id (e j ) |2 d
( 30 )
T ( 31 )
c=[1cos ( ω ) … cos (N ω)]
T
s=[0 sin ( ω ) … sin(N ω)] ( 32 )
The optimal solution is obtained by solving for the minimum of the error measure. The unique
minimum-error solution is found by setting its derivative with respect to h to zero. This results in
the following normal equation
2 Ph−2 p 1=0 ( 33 )
which yields,
−1
h=P p 1 ( 34 )
The design is much easier if the weighting function is not used, i.e., W(ω) = 1, since the solution
can be given in closed form. Then elements of P and p1 can be expressed as
1
Pk ,l
cos[( k l ) ]d sin c[ (k 1)]
0
( 35 )
and
1
p1, k
cos[( k
0
D) ]d sin c[ (k D)]
( 36 )
Here matrix P is independent of the delay parameter D and only needs to be inverted once. The
resulting FIR filter coefficients depend on the choice of frequency band parameter and the
weighting function.
6. Results
Figure 1 and 2 present magnitude and phase delay response for third-order GLS filter with unity
weighting function W(ω) = 1 and = 0.5 (i.e., half-band approximation) respectively. At high
frequencies the error has slightly increased since the approximation error outside the pass-band
[0, 0.5] has not been considered in the design.
Figure 3: The curves plotted for 11 fractional delay values between 1.0 and 2.0
Figure 3 shows output curves plotted for 11 fractional delay values between 1.0 and 2.0. Figure
4 and 5 show delayed signal with delay D=1.2 and D=1.9 respectively.
7. Conclusion
General least square’s approximation for fractional delay filter design is implemented in
Matlab for arbitrary fractional delay D and the results are analysed. It is seen that maximum error
in both magnitude and phase delay has been reduced in the approximation band. At high
frequencies error has slightly increased, since approximation error outside the pass band is not
considered in the design.
8. References
[1]. V. Valimaki and T. I. Laakso, “Fractional delay filters—design and applications,” in Theory
and Applications of Nonuniform Sampling, F. Marvasti, ed. New York: Plenum/Kluwer, April
2000
[2]. M.Lang. “Allpass filter design and applications” IEEE Trans. Signal Process., vol.46, no.9,
pp. 2505-2514, September 1998
[3]. T. I. Laakso, V. Valimaki, M. Karjalainen, and U. K. Laine, “Split- ting the unit delay—
tools for fractional delay filter design,” IEEE Signal Process. Mag., vol. 13, no. 1, pp. 30–60,
January 1996.
[4]. H.W.Schubler and P.Steffen. “On the design of allpass with the prescribed group delay”. In
Proc. IEEE Int. Conf. Acoust., Speech, Signal Processing (ICASSP), vol. 3, pp. 1313-1316,
Albuquerque, April 1990
[5]. J.P.Thiran. “Recursive digital filters with maximally flat group delay” IEEE Trans. on
Circuit Theory, vol.18, no.6, pp. 659-664, November 1971