0% found this document useful (0 votes)
37 views14 pages

S32104006W+Likando Mubita+DSP2022

The document discusses two research papers on the application of FIR and IIR digital filters. The first paper describes designing FIR and IIR Hilbert transformers using least squares and minimax fitting. The second paper describes a method called ELiS for identifying linear systems from noisy input/output amplitude measurements, which can be used to design FIR and IIR Hilbert transformers by approximating the desired transfer function in a least squares sense. Examples are provided of designing a 30th order FIR Hilbert transformer using least squares fitting and the results are comparable to existing methods.

Uploaded by

kaviyelu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views14 pages

S32104006W+Likando Mubita+DSP2022

The document discusses two research papers on the application of FIR and IIR digital filters. The first paper describes designing FIR and IIR Hilbert transformers using least squares and minimax fitting. The second paper describes a method called ELiS for identifying linear systems from noisy input/output amplitude measurements, which can be used to design FIR and IIR Hilbert transformers by approximating the desired transfer function in a least squares sense. Examples are provided of designing a 30th order FIR Hilbert transformer using least squares fitting and the results are comparable to existing methods.

Uploaded by

kaviyelu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

智能科学与工程学院

数字信号处理

(Digital Signal Processing)

课程大作业

学 号:S32104006W

专 业:CONTROL SCIENCE AND ENGINEERING

学生姓名:LIKANDO MUBITA ( )

任课教师:孟浩 教授

2022 年 6 月
QUESTION 1

Look up two related literatures of FIR or IIR digital filter application, and describe their
contents and results of research.
FIR and IIR Hilbert Transformer Design Via LS and Minimax Fitting
An FIR is a filter whose impulse response is of finite period, as a result of it settles to zero in finite
time. This is often in distinction to IIR filters, which can have internal feedback and will still respond
indefinitely. The impulse response of an Nth order discrete time FIR filter takes precisely N+1
samples before it then settles to zero. FIR filters are most popular kind of filters executed in software
and these filters can be continuous time, analog or digital and discrete time. Special types of FIR
filters are namely, Boxcar, Hilbert Transformer, Differentiator, Lth-Band and Raised-Cosine.

Digital Hilbert transformers are a special class of digital filter whose characteristic is to introduce a
π/2 radians phase shift of the input signal. In the ideal Hilbert transformer all the positive frequency
components are shifted by –π/2 radians and all the negative frequency components are shifted by
π/2 radians. However, these ideal systems cannot be realized since the impulse response is non-
causal. Nevertheless, Hilbert transformers can be designed either as Finite Impulse Response (FIR) or
as Infinite Impulse Response (IIR) digital filters, and they are used in a wide number of Digital Signal
Processing (DSP) applications, such as digital communication systems, radar systems, medical
imaging and mechanical vibration analysis, among others.

Optimal FIR and IIR Hilbert Transformer Design Via LS and Minimax Fitting

The Hilbert transform is a very useful tool in mod- T modulation and demodulation. It has
applications not only in communications, but also in the measurement of frequency deviations of
rotating machines, in the investigation of the impulse response of systems, characterization of
acoustical devices, etc. At present, it can be realized by digital means at a reasonable speed; thus
design methods for digital Hilbert transformers are of increasing interest.

On-line discrete Hilbert transformers are usually designed in the form of linear phase finite impulse
response (FIR) filters 121, [6]. The standard method (the usage of the RemCz algorithm) is well
elaborated. There are attempts to design infinite impulse response (IIR) realizations too. The method
in [R. Ansari. ”IIR discrete-time Hilbert transformers,”] is based on special techniques as transforms
of normal or generalized halfband filters.

Recently, Chen and Parks [7] have shown that the performance of FIR filters can be improved by
accomplishing the fit in the complex domain, and by allowing small deviations from the linear phase
(nearly linear phase filters). This leads to the idea of designing both FIR and IIR Hilbert transformers
by fitting the filter to the complex frequency response.

The design of a (two-sided) digital Hilbert transformer means that we try to approximate the
following transfer function:

 − j if 0  f  f s / 2
H( f ) = 
 j if 0  f s / 2  f  f s
Where f s is the sampling frequency, and j = −1 . Because of the discontinuity at 0 and f s / 2 , a
digital filter can approximate this well only in a given band.

When preparing the design, the choice listed are as follows

Filter type: The filter can be either an FIR or an IIR. The advantage of the FIR filter is that it is always
stable (it has no poles), the implementation is straightforward, and with the Remez algorithm there
is an effective algorithm for the design. The IIR filter may often provide the same performance with a
significantly lower order, however, there is no standard method to assure stability (e.g., the first two
examples of are definitely unstable), and the realization is to be made with care (underflows and
overflows, etc.)

Measure of goodness of fit. The approximation of the desired transfer function can be done using
one of the minimax (Chebyshev), least squares, least absolute values (etc.) criteria ). Intuitively, the
minimax criterion seems to be desirable: using this, the maximum of the error can be kept at a low
level. On the other hand, one can argue for the other norms: if the cost function is small enough, the
fit will be almost perfect.

Another aspect is the implementation of the minimization procedure. For the minimax fit there is
the effective Remez algorithm for linear phase FIR filters, and there is also an approximate method
in the complex domain. The LS criterion can often be handled analytically, and there are already
methods to handle the other criteria.

Handling of the “non-Hilbert’’ bands. For modulation or demodulation purposes, the Hilbert
transform is usually only needed in a certain frequency band. At the same time, there may be other
prescriptions in the other frequency intervals: the transfer function should not exceed a certain
magnitude

In some of the applications, the desired Hilbert transformer is not two-sided as defined above, but
one-sided (the prescribed frequency shift is provided somewhere in the ( 0, f s / 2 intervals only).
These leads to complex signals and complex filter coefficients.

d) Additional restrictions originating from the design method. Some of the design methods contain
inherent constraints. The RemCz algorithm only allows linear phase, that is, no phase error is
allowed. The method presented in [3] only uses all-pass sections, that is, the magnitude function
equals exactly one. These different aspects imply that probably no uniform solution exists for every
case. Thus it is reasonable to look for alternative design methods.

ESTIMATION OFLINEAR SYSTEMS-ELiS

Recently, a method for the identification of linear systems has been published [8], [9]. Starting from
the noisy complex input and output amplitudes measured at different frequencies in a linear system,
the maximum likelihood estimate of the linear transfer function is determined. The transfer function
may be in terms of s or z.

The basic z-domain model is shown in Fig. 1. The input signal X has complex amplitudes Xk, at angular
frequencies wk; the output signal is Y. Both the measured complex input and output amplitudes are
corrupted by noise (  x and  y with variance  xk2 and  yk
2
at the corresponding frequencies) The
noise is assumed to be independent and Gaussian, which means that the result is nothing more than
a weighted least squares estimate.
The transfer function is sought in the following form:

N ( z −1 )
H est ( z ) = z  
D( z −1 )

Where   0 is a delay (the desired function will be realized in the form z − H ( z ) that is, we accept
this delay in order to obtain a realizable approximation), and z −1 N and z −1D are the unknown
numerator and denominator polynomials of the transfer function. In other words, instead of H ( z )
N ( z −1 )
−
we will approximate z H ( z ) by
D ( z −1 )

The algorithm numerically minimizes the following cost function via the coefficients of the
numerator and the denominator of the transfer functicn of the system:
N
| z d N ( zk−1 ) X mk − D( zk−1 )Ymk |2
k =
k =1  xk | N ( zk | + yk | D( zk |
2 −1 2 2 −1 2

And

zk = e jwk Ts

with Ts being the sampling interval. If the noise is small, the least squares estimation can be
considered in the following way: the transfer function to be determined is H( f) which approximates
in LS sense the values

Ymk / X mk ,
k = 1,...., N

Now, if we impose X mk  1 ,  xk
2
 0, yk2  1 and Ymk equals our desired transfer function, the
minimization procedure will result in a least squares approximation. If D ( zk−1 )  1 the result is an FIR
filter, otherwise it is an IIR filter. The delay is to be given in advance. It may be allowed to vary too,
but on the one hand the rather complicated surface of the several dimensional cost function will
usually lead the minimization procedure to local minima and, on the other hand, fractional delays
are often not allowed. Moreover, a poor initial value of  often results in unstable IIR filters. Thus,
an appropriate value of  is to be given in any case, based on experience. It is easy to see that the
“not Hilbert” frequency bands can also be handled.

FIR Filter Design, LS Fit

A FIR Hilbert transformer of order 30 was designed (Example 1 of [2]). The results, presented in Fig.
2, are practically the same as those in [2]. This is no wonder, the eigenfilter approach is nothing
more than a least squares method. It can be observed that the error is small in the middle, but
increases towards the edges. Here it surpasses the maximum error of the Parks-McClellan algorithm,
as it has to, since the latter is the solution of the minimax problem. Thus, the remark in [2] that their
error is much smaller than that of the Parks-McClellan algorithm is somewhat misleading. The error
is indeed generally smaller, but at the edges it is larger than that obtained using the Rem&
algorithm.
It is also of interest to notice that the real part of the transfer function of the designed filter is
negligible (it is in the order of magnitude of the roundoff errors, shown in Table I), though there was
no linear phase constraint. The cause is most probably the fact that since the desired transfer
function is purely imaginary, the approximating function has the same property (the impulse
response is exactly odd; see [7] for a similar statement). The real part is not negligible any more if
the chosen delay value is different from half of the order (15 in this case), but the fitting error is
larger so this case is of no practical interest

FIR Filter Design, Minimax Fit

Starting from the above results, an iteration step using weighted LS was performed, as shown in Fig.
3. The fit is already very close to the ideal minimax design (ParksMcClellan algorithm)

IIR Filter Design, LS Fit

A systematic search was necessary in order to find the minimum IIR order and the appropriate delay
which provides the same (or even smaller) error as the above FIR filters. For a given order, the value
of the delay was found by starting from the value equal to the order and it was decreased gradually
until the last value was reached, for which the designed filter was still stable. Then the delay value
was chosen for which the error was minimum. When the error was smaller than that desired, the
order was decreased. When it was larger, the order was increased and the optimum delay was
sought again.

Finally, the order was chosen as 12/12 and the delay as 11 (the filter became unstable for 6 < 9). As
shown in Fig. 4, the error is somewhat smaller than that of the above FIR solution. The poles and
zeros are easy to implement. It is remarkable that the amplitude response is practically flat (the
magnitude error is less than 1.2 dB ( 1 mW ), that is, the filter is similar to an all-pass filter. Fig. 4(c)-
(d) show the magnitude error, the phase error and the complex error in the “care”-band.

IIR Filter Design, Minimax Fit

Two steps of the iteration were performed until the error of the fit became practically equiripple, as
shown in Fig. 5. Unfortunately, there is no method in the literature which would provide the
minimax solution for the IIR case. Thus we can only assume that we obtained at least a suboptimal
minimax approximation.

Adaptive FIR Filter

A common form of a FIR filter is called an adaptive filter. Adaptive filtering is used in cases where a
speech signal must be extracted from a noisy environment. Assume a speech signal is buried in a
very noisy environment with many periodic frequency components lying in the same bandwidth as
the speech signal. An example might be an automotive application. An adaptive filtering system uses
a noise cancellation model to eliminate as much of this noise as possible.
The adaptive filtering system uses two inputs. One input contains the speech signal corrupted by the
noise. The second input is a noise reference input. The noise reference input contains noise related
to that of the main input (like background noise). The adaptive system first filters the noise
reference signal, which makes it more similar to that of the main input. The filtered version is then
subtracted from the main input signal. The goal of this algorithm is to remove the noise and leave
the speech signal intact. Although the noise may never be completely removed, it is reduced
significantly.

The filter to perform this adaptive algorithm could be any type, but a FIR filter is the most common
because of its simplicity and stability (Figure 4). In this approach, there is a standard FIR filter
algorithm which can use the MAC instruction to perform tap operations in one cycle. The
“adaptation” process requires that calculations to tune the FIR filter match the characteristics of the
desired response. To compute this, the output of the FIR is matched with the external system
response. If the FIR output matches the system response, the filter is tuned and no further
adaptation is required. If there are differences in the two values, this would indicate a need to tune
the FIR filter coefficients further. This difference is referred to as the error term. This error term is
used to adjust each of the coefficient values each time the filter is run.

The basic process of computing an adaptive filter is shown in Figure 4.19. Each iteration of the filter
operation requires the system first to determine the filter error and then scale it by a factor of how
‘hot’ or responsive the rate of adaptation must be. Since there is only one set of these to be
performed each iteration, the overall system cost in cycles is very low.
The next step is to determine how much to tune each of the coefficients. All of the terms are not
necessarily adjusted equally. The stronger the data was at a particular tap, the larger its contribution
was to the error, and the more that term is scaled. (For example, a tap whose data happened to be a
zero couldn't have had any influence on the results, and therefore would not be adapted in that
iteration). This individual error term is added to the coefficient value, and written back to the
coefficient memory location to “update,” or “adapt” the filter. Analysis of the DSP load (Figure)
shows an adaptation process which consists of 3 * N steps. This is larger than the FIR itself, which
requires 2 * N processes to run. The adaptive filter requires 5N operations for each iteration of an N
tap filter. This is many more cycles than a simple FIR. The overall load to compute this operation can
be reduced using to 4N using the DSP MAC instruction. The DSP can also use parallel instruction
execution that allows for a load or store to be performed while a separate math instruction is also
being run.

In this example, a store in parallel with a multiply can absorb two steps of the LMS process, further
reducing the overall load to 3N cycles per iteration. The LMS ADD needs the coefficient value, also
being accessed during the MAC instruction. A specialized LMS instruction (another specialized
instruction for DSP), merges the LMS ADD with the FIR's MAC. This can reduce the load to 2N cycles
for an N tap adaptive filter. A 100th order system would run in about 200 cycles, vs. the expected
500. When selecting a DSP for use in your system, subtle performance issues like these can be seen
to have a very significant effect on how many MIPS a given function will require.
?) G,nnn b*c (v^^.1-i,t.,- a -*iar *rX^^l
y'.(t\= (,^(z-nt,t)t (,^( an+,+) t(,^(znf"t)
(
D 5^* g le +L* {*7n,,1 ,^,-} 11* e-xy rest iart &t, X (,^ )

Fo (t) = (,^ (z^+,-t ) f 9*( 1K+a.l) + (,^ (r|r.t \


{,= b0il, [.= Ioil. .1, = ZooL4=
-u Xr({) -:- S,"ILfrt1,0il"+) y9,^(z^x1ot)+ (,,(2axlt,ot)
--5,^lttoA+\+5,,a(tSorl ) f stn((ooV{ )

En f resliurt @r \(^') rt q! {-,1t,^^,,


[,0 t
/
f , = tz6b
W Prn,.n.t Sna fli*? 4.. XT*rl

X(^) = e,^ ( z-^(**l^ ) r (,^ (z^(%,o)


^ )rf,,,
("W)")
Xl"r . s.^ llr (2,) ") + s,^ (r" (Z) ^ ) + s,^(u (Lu) ^ )
t (,^( *)
)
3)Use Matlab or other programming languages to analyze the spectrum of the signal xa (t ) .

Code:

f1 = 60;
f2 = 90;
f3 = 300;

%Sampling Frequency
fs = 1200;

dt = 1/fs;
StopTime = 3;

%Time vector
t = (0:dt:StopTime-dt)';

xn = sin(2*pi*f1*t) + sin(2*pi*f2*t) + sin(2*pi*f3*t);

%plotting of signal
plot(t,xn);
xlabel('time (in seconds)');
title('Signal versus Time');
%axis([0 2 -3 3]);

%generating Spectrum
sa =
dsp.SpectrumAnalyzer('SampleRate',fs,'PlotAsTwoSidedSpectrum',
fa
lse,'YLimits',[-60 40]);
sa(xn)
In the above code samples the continuous signal with a sampling frequency of 1200 Hz then
we got the function xn

After that plot the frequency spectrum of the given signal using dsp.SpectrumAnalyzer().
t3) ).,i1^
Q? 2 o' LA 0? = 3JF
l^), = O, trn d"s -- zo|p

tNe fra^.f.rrw sprci.fica.{rzrrrs +re


?f &.1,+J SrU+.' **lz +t..+ o& evt a,^ato1
P'r{"!P" hcu" ur\ -tu, 9"",^irt-., (z->vt q '- O-OoogS=
C'iuu gas,ba,-J c*++[ fr.yg
Ar".
^%^ = w, k, ( 8t( n
@
tl* Etaf Vil c*ga4- &r1r^r^g

A a"\*-,^,^, l[ rr) at
.J
t'z D+.^-*a *- O*rFb&ur*, &
I
^
wl.el t, FJ A/ c"*) j-i c.^^4q(1 Wf^y JLc
$
L,rTL'%=,)f
' hoot-r) J
trot9r:t

l"rffi Lr'19, (
"\\W)
/-t 25
1s, +,ts1&
-Cl c
=| L
1o^lr, - ,lh =
'S,.
z _(L . Li
('rrr%)
(
/ Y = , '?- ( . .-N
(\^g#
*J -l,Lc tt ^"^tk &*-*"{^'"-r $^ (') )s n' t V4--t^
I
lD1

*1a0,
lJ.[r) z

--
-#
f rJ
(-t- l+,,) '., s.zst '-
f*Jrr +, zral
l-n, J
I * QarbAr,u

4,tL otls((o-t ft+ t- 7tTx(o'?s'ro


l - o+6 y{c--r' t' + 5,g.t6{ to'f t - otl sa I

J
1, '.-

q .f1 a;ir'J f?dW ,1...^..^- C,h]lrrrt

[* A"
l+Gt,Z- | - et"'in

?
Code
Output

You might also like