You are on page 1of 5

Proc.

29th International Conference on Systems, Signals and Image Processing “IWSSIP 2022”, June 01 - 03, 2022, Sofia, Bulgaria

Active Learning Used for Teaching the Topic


“Design of Finite Impulse Response Filters in
MATLAB” in the Course “Digital Signal
2022 29th International Conference on Systems, Signals and Image Processing (IWSSIP) | 978-1-6654-9578-3/22/$31.00 ©2022 IEEE | DOI: 10.1109/IWSSIP55020.2022.9854458

Processing”
Adriana Borodzhieva
Department of Telecommunications
University of Ruse “Angel Kanchev”
Ruse, Bulgaria
aborodzhieva@uni-ruse.bg

Abstract—The paper presents the application of active at home and work on solving problems live in class. Using
learning used for teaching the topic “Design of Finite Impulse this pedagogical approach [1], students watch online video
Response Filters in MATLAB” in the course “Digital Signal lectures, collaborate with each other in online discussions, or
Processing” for bachelor students of the specialties “Internet conduct research at home, while activities, including those
and Mobile Communication” (3rd semester) and “Information that can traditionally be considered homework, are moved
and Communication Technologies” (2nd semester) at the into the classroom, with the guidance of a teacher (mentor).
University of Ruse during the COVID-19 Pandemic. Some Project-based learning retains students in learning, using
issues about students’ feedback are given in the paper. activities such as “reading, writing, discussion, problem-
solving, analysis, synthesis, and evaluation of class content”
Keywords—active learning, finite impulse response filters,
digital signal processing, MATLAB, Signal Processing Toolbox.
[2, 3]. These two approaches (FC and PBL) were really very
important during the last three academic years in the
I. INTRODUCTION COVID-19 pandemic when distance learning was used [4].
Nowadays, increasing the motivation and inspiration of II. FINITE IMPULSE RESPONSE (FIR) FILTERS AND
students is a great challenge for all university professors. DESIGN OF FIR FILTERS IN MATLAB
This requires teachers to look for and start applying
innovative ideas such as creative teaching, working on Finite Impulse Response (FIR) filters are a basic class of
projects individually or in teams, using audio and video digital filters in which the value of the output response at a
tools, etc. The main goal of the teachers is to be able to certain point in the discrete time depends on the values of the
engage the students, who are increasingly distracted from the input signal at the current and previous time points, but does
screens of their mobile phones, with the taught material, not depend on the values of the output signal at previous time
motivating them to study and work individually and/or in a points. These filters, also called non-recursive, are a special
team and to increase their enthusiasm to learn and work. case of Infinite Impulse Response (IIR) filters and have the
following advantages [5, 6, 7]:
The aim of the course “Digital Signal Processing”,
mandatory in the curriculum of the specialties “Information • easily implemented programmatically, for example
and Communication Technologies” (2nd semester) and using the functions provided by Signal Processing Toolbox
“Internet and Mobile Communications” (3rd semester) at the (SPT), a specialized extension of MATLAB [8];
University of Ruse, is to introduce the bachelor students with • they are always physically feasible because the
the main issues of theory, practice and applications of digital condition for physical feasibility is the impulse response of
signal processing. One of the basic topics in the course is the filter to have zero values for the negative discrete time,
“Design of Finite Impulse Response (FIR) Filters in
i.e. h ( n ) = 0 for n < 0 ;
MATLAB” where students learn how to apply MATLAB
and its extension Signal Processing Toolbox for designing
• their stability is guaranteed, as the condition
FIR filters of low-pass (LP), high-pass (HP), band-pass (BP), ∞
and band-stop (BS) configurations.  h (n) < ∞ is always fulfilled due to the finite length of
n =−∞
The paper presents the main steps of the flipped
their impulse response;
classroom (FC) and project-based learning (PBL) approaches
as forms of active learning used during the workshops when • they can be implemented in such a way that they
teaching the topic “Design of Finite Impulse Response (FIR) have a linear phase-frequency response, where the group
Filters in MATLAB” with the problems solved by students. time delay is constant. Therefore, the useful signal entering
The flipped classroom, a type of blended learning, is a the pass-band of the filter will pass through it without
learning strategy that aims to increase students' engagement distortion. The condition for linearity of the phase response
and learning by getting students to finish reading the material

978-1-6654-9578-3/22/$31.00 ©2022 IEEE


1

Authorized licensed use limited to: University of Calgary. Downloaded on October 15,2022 at 16:33:53 UTC from IEEE Xplore. Restrictions apply.
is the symmetry (even symmetry) or the anti-symmetry (odd B. Design of FIR filters with standard/single-band response
symmetry) of the impulse response [5, 6, 7]. The fir1 function implements the classic method for
A disadvantage of FIR filters is that with the same input designing linear-phase FIR digital filters using the “window”
data they are obtained from a higher order compared to IIR method. It resembles the functions for designing IIR filters,
filters, which leads to inefficient use of RAM and to a delay which use the design of filters with a standard configuration:
in the calculation of the output response [5, 6, 7]. low-pass, high-pass, band-pass, and band-stop (notch). Its
syntax has the following general form [8]:
The difference equation and the transfer function
describing a FIR filter in discrete time have the forms [5, 6]: b = fir1 (n, Wn, 'ftype', window).
By default, the function designs a low-pass filter, which
N Y (z) N
is represented by its n + 1 coefficients in the numerator of its
y ( n ) =  bi x ( n − i ) , H ( z ) = =  bi z −i
(1)
i =0 X ( z) i =0
transfer function, which are stored in a row-vector b . The
following notations are used:
where y ( n ) is the output signal and x ( n ) is the input signal • n – filter order, as n must be an even number for
of the filter. high-pass and band-stop filters;

In formulas (1), bi are the coefficients of the filter • Wn – desired cut-off frequency (specified as
normalized frequency); for low-pass and high-pass filters Wn
(bi = const ) and N is the order of the filter [5, 6, 7]. is a one-element vector defining the cut-off frequency at a
decrease of 3 dB, and for band-pass and band-stop filters – a
Table I presents the different methods for designing FIR
two-element vector containing the cut-off frequencies of the
filters, the description of these methods, and a list of
pass-band;
available functions in SPT for their implementation [8].
A. Design of linear-phase FIR filters • ‘ftype’ – filter type (string); 'high' is written for
high-pass filters, and 'stop' – for band-stop filters;
All functions in SPT for designing FIR filters, with the
exception of cremez, implement only linear-phase filters. The • window – column-vector with a length of n + 1,
coefficients bi of such filters satisfy dependences with even defining the window function with which the restriction of
or odd symmetry. Depending on the type of this symmetry, the length of the impulse response is performed (Table III);
as well as whether the filter order is even or odd, the linear- Hamming window is used by default. The analytical
phase filter (stored in a vector b with a length of n + 1 ) has expressions used to define window functions can be found in
certain limitations in its frequency response (Table II). The the references [8].
fir1, fir2, firls, remez, fircls, fircls1 and firrcos functions To calculate the length of a Kaiser window, the kaiserord
design linear-phase FIR filters of type I and type II (by function is used, which “returns” the filter order, the cut-off
default). The firls and remez functions design linear-phase frequency, and the parameter β of a Kaiser window needed
FIR filters of type III and type IV by setting the ‘hilbert’ or to satisfy a set of requirements. By specifying the vector of
‘differentiator’ flag. The cremez function can design linear- the cut-off frequencies of the filter bands and the vector of
phase filters of any type as well as nonlinear-phase filters. their corresponding amplitudes, as well as the maximum
Because the frequency response of a filter of type II has a allowable ripples (nonuniformity), kaiserord “returns” the
value “0” for the Nyquist frequency, fir1 does not design appropriate input parameters for the fir1 function. It should
high-pass and band-stop filters of type II. In these cases, for be noted that the Kaiser window achieves the best ratio
odd values of the filter order n , fir1 increments n by one between the width of the transition band and the minimum
and returns a filter of type I [8]. attenuation in the stop-band (above 80 dB) [8].
TABLE I. METHODS AND FUNCTIONS FOR DESIGNING FIR FILTERS C. Design of FIR filters with arbitrary/multi-band response
The fir2 function also designs FIR digital filters using the
“window” method, but with an arbitrary shape, most often
multi-band, amplitude-frequency response, described point
by point (element by element). The analogue of this function
in IIR filters is yulewalk, which also designs filters with
arbitrary frequency response, specified point by point [8]. Its
syntax has the following form: b = fir2 (n, f, m, window). The
function “returns” a row-vector b containing n + 1
coefficients in the numerator of the transfer function of a FIR
filter of order n whose frequency response corresponds to
TABLE II. LIMITATIONS IN FREQUENCY RESPONSES OF FIR FILTERS
that specified by the row-vectors f and m .

TABLE III. WINDOW FUNCTIONS

Authorized licensed use limited to: University of Calgary. Downloaded on October 15,2022 at 16:33:53 UTC from IEEE Xplore. Restrictions apply.
f is a row-vector of the normalized frequencies in the Task 1. Write a MATLAB program to design a low-pass FIR filter with
a cut-off frequency of 1 kHz at a sampling frequency of 8 kHz, for the following
range from 0 to 1 (corresponding to the Nyquist frequency);
four cases: a) filter order n = 36 , with a Hamming window; b) filter order n = 50 ,
the values in the vector f should be listed in ascending
with a Hamming window; c) filter order n = 50 , with a rectangular window;
order, but there may be repeating elements corresponding to
a jump in the frequency response. m is a row-vector d) filter order n = 50 , with a Kaiser window with a parameter β = 8 .

containing the desired amplitudes for the frequencies Let the program draw the frequency responses (magnitude and phase) of
specified in the vector f . Here, window is also a column- the designed filter, and for the filter from sub-task b) draw the impulse response

vector with a length of n + 1, defining the window function and pole-zero diagram.

with which the restriction of the length of the impulse a)


response is performed (Table III). By default, it works with a
Hamming window [8].
III. ACTIVE LEARNING IN THE TOPIC “DESIGN OF FINITE
IMPULSE RESPONSE (FIR) FILTERS IN MATLAB”
Due to the COVID-19 pandemic and the need for
distance learning during the last three academic years, the
teachers in the course “Digital Signal Processing”, studied by
students in the specialties “Internet and Mobile
Communications” and “Information and Communication
Technologies” (respectively 3rd and 2nd semester) at the
University of Ruse decided to introduce active learning with b)
two of its possible forms: flipped classroom (FC) [1] and
Fig. 1. Task 1, solved by students: a) conditions; b) solution – code in
project-based learning (PBL) [2, 3, 4]. MATLAB (with comments)
PBL combined with FC gives students chances for
learning by researching and working on projects [2, 3, 4]
while developing their 21st-century skills such as creativity,
problem-solving, communication and collaboration skills,
logical, analytical and critical thinking, project management,
in-depth understanding, etc.
First, at home, students must watch some videos and/or
PowerPoint presentations, where the material (theory,
practice, and applications, as well as functions in Signal
Processing Toolbox and its features, presented in Section II
of the paper) is explained to students. The material presented
in Section II is important for an in-depth understanding of
the problems (Fig. 1…Fig. 9) presented for demonstration of
MATLAB and Signal Processing Toolbox for designing FIR
filters. It helps students to prepare themselves at home and to
start with exercises in class (FC and PBL) [1, 2, 3, 4].
During the workshops (online or face-to-face), students
solve different individual tasks similar to those presented in
the demonstration phase. It is recommended to provide
written instructions for students in the laboratory at a visible
Fig. 2. Frequency responses (magnitude and phase) of finite impulse
location. In Task 1, students have to design and investigate
response (FIR) filters with: a) filter order n = 36, Hamming window;
low-pass FIR filters of different orders using different
b) filter order n = 50, Hamming window; c) filter order n = 50,
window functions (Hamming, rectangular, Kaiser, etc.) and
compare the results. This task allows students to experiment rectangular window; d) filter order n = 50, Kaiser window with a
with the fir1 function. The conditions of Task 1 and its parameter β = 8
solution in the form of MATLAB code are given in Fig. 1.
The design results are given in Fig. 2, Fig. 3, and Fig. 4. In
Task 2, students have to design and investigate low-pass FIR
filters of different orders using different window functions
(Hamming, rectangular, Kaiser, etc.), when the magnitude
response is given “point-by-point” and compare the results
while experimenting with the fir2 function. The conditions of
Task 2 and its solution in the form of MATLAB code are
given in Fig. 5. The design results are given in Fig. 6. Similar
results are presented in Fig. 7, but when using other window Fig. 3. Impulse response of FIR Fig. 4. Pole-zero diagram of FIR
functions (rectangular and Kaiser windows, with a parameter filter of n = 50 order filter of n = 50 order
β = 8 ).

Authorized licensed use limited to: University of Calgary. Downloaded on October 15,2022 at 16:33:53 UTC from IEEE Xplore. Restrictions apply.
Task 2: Design low-pass filters of 30th and 45th order, using the fir2 function. Task 3: Write a MATLAB program that synthesizes a band-stop FIR filter of
34th order with a stop-band from 1 kHz to 2 kHz, at a sampling frequency of
Draw their magnitude responses, such as the desired frequency response of the
8 kHz, using a Chebyshev window with ripples (non-uniformity) 35 dB. Let the
filter, specified by the frequency vector f = [0 0.6 0.6 1] and the amplitude vector program draw the frequency responses (magnitude and phase) of the filter, as
well as its impulse response and pole-zero diagram. What is characteristic for
m = [1 1 0 0] and the actual frequency response are superimposed on each the frequency responses (magnitude and phase), impulse response and pole-zero
other: a) using a Hamming window (by default); b) using a rectangular window diagram of the designed filter? What is the default window for fir1?
Task 4: Write a MATLAB program that synthesizes a filter of 24th order with
and a Kaiser window with a parameter β = 8 for a low-pass filter of 30th order. a normalized frequency response given in the figure below
([0 0.1 0.15 0.25 0.3 0.55 0.6 0.7 0.75 1.0]). Let the program draw in one
a)
coordinate system the desired and actual frequency responses of the filter using
the functions fir2, remez and firls. What is characteristic for the frequency
response of each of the designed filters in terms of matching the desired and
actual responses in the pass-band, stop-band and the transition band and in
terms of ripples (pulsations) in the pass-band and in the stop-band? What filters
are designed with these functions?
Note: The syntax of the remez and firls
functions is the same as that of the fir2
function. Try to write the MATLAB
programs for Task 3 and Task 4 by yourself.
Answer the questions to both tasks and
Figure. Desired frequency response of apply the code and graphical dependencies
the filter to the tasks.

Fig. 9. Tasks 3 and 4, solved by students: conditions, notes and quesions

In the last two more complicated tasks, students design a


b) band-stop filter and a multi-band filter with a normalized
frequency response (Fig. 9). Some students had difficulties
Fig. 5. Task 2, solved by students: a) conditions; b) code in MATLAB
when solving these problems but most of them thought that
this was not so difficult when reading the theory carefully.
IV. CONCLUSION
This paper presents project-based learning when students
investigate the topic “Design of FIR Filters in MATLAB”
and the tasks solved by students based on the principles of
the flipped classroom and project-based learning. A survey
with 33 students studying the course “Digital Signal
Processing” was conducted at the end of the semester of the
Fig. 6. Normalized frequency Fig. 7. Normalized frequency last academic year. This survey assesses the students’
responses of FIR filters of 30th order responses of FIR filters of 30th opinions about using the approaches FC and PBL, and their
and 45th order, with a Hamming order, with a Kaiser ( β = 8 ) and satisfaction. Students definitely prefer FC and PBL and are
window, superimposed on the ideal
one
a rectangular window, super- more likely to use them in the future. The results show that
imposed on the ideal one the topic is hard for students, but with suitable methods, they
can be satisfied with their results, learn more, and with
After solving these problems, students must draw some interest. Students with learning difficulties could be helped to
conclusions (Fig. 8) about the studied responses (magnitude learn the material on time before the corresponding exam
and phase responses, impulse response, and pole-zero plot) using peer-to-peer learning and “think-pair-share” methods.
of FIR filters. Formulating conclusions based on graphical
dependencies improves scientific literacy, one of the most REFERENCES
important 21st-century skills for future engineers. [1] C.-C. Lo, M.-H. Hsieh, H.-H. Lin, H.-H. Hung, “Influences of flipped
teaching in electronics courses on students' learning effectiveness and
The graphical dependencies obtained from the filter design allow the strategies”, International Journal of Environmental Research and
following conclusions to be drawn:
Public Health, Vol. 18, Issue 18, 2021, DOI 10.3390/ijerph18189748.
1. Due to the limitation of the length of the impulse response, carried out
[2] R. Pinter, S. M. Cisar, “Measuring team member performance in
in this case using the “window” method, ripples (pulsations) in the frequency
response, known as the Gibbs effect, occur. When the filter order increases, the
project-based learning”, Journal of Applied Technical and
amplitude of these ripples does not decrease, but they are concentrated in a Educational Sciences, vol. 8, no. 4, pp. 22-34, 2018.
narrower area around the cut-off frequency. [3] M.-H. Shin, “Effects of project-based learning on students’ motiva-
2. The amplitude of the ripples in the pass-band, as well as the width of tion and self-efficacy”, English Teaching 73, no. 1, pp. 95-114, 2018.
the transition band, depend on the window function – when using a Kaiser [4] M. Haack, T. N. Jambor, “Remote laboratory for activating lecture
window, a minimum attenuation over 80 dB (when β = 8 ) in the stop-band is hall teaching and distance learning”, pp. 536-542, 9th International
achieved, when using a Hamming window – about 50 dB, while using a Conference TEEM 2021, Barcelona, DOI 10.1145/3486011.3486511.
rectangular window – only 20 dB.
[5] A. Borodzhieva, P. Manoilov. “Digital Signal Processing – Exercise
3. FIR filters have a linear phase response in the pass-band, which is their Guide”. Ruse; Publisher: Avangard Print EOOD, 2011; 80 p.; ISBN:
biggest advantage because there are no distortions in the transmission of pulses. 978-954-337-116-7. (in Bulgarian).
The linearity of the phase response is due to the symmetrical impulse response.
[6] A. Borodzhieva, I. Tsvetkova, “Increasing students’ motivation in the
4. The FIR filter is unconditionally stable because its pole-zero diagram course “Digital Signal Processing” Using Active Learning”. 14th
contains only zeros (represented by “o”) and does not contain poles (represented Annual International Conference of Education, Research and
by “x”). Its zeros are real or complex-conjugate (in pairs) and can lie anywhere
Innovation, Seville (Spain), ICERI2021, pp. 3192-3201.
in the complex z-plane (inside the unit circle, on it and outside it).
[7] St. H. Mneney, “An Introduction to Digital Signal Processing: A
5. The design of FIR filters with arbitrary frequency response is
performed extremely quickly and easily using the software available in SPT. Focus on Implementation”. River Publishers ApS, Aalborg, Denmark,
Window functions must be carefully selected depending on the specific 2008, pp. 284, ISBN: 978-87-92329-12-7, https://www.riverpub-
application of the filter. lishers.com/pdf/ebook/RP_E9788792982032.pdf.
[8] Signal Processing Toolbox for Use with MATLAB. User's Guide,
Fig. 8. Conclusions drawn by students after solving all the tasks 2001, https://web.stanford.edu/class/ee254/software/signal_tb.pdf.

Authorized licensed use limited to: University of Calgary. Downloaded on October 15,2022 at 16:33:53 UTC from IEEE Xplore. Restrictions apply.
5

Authorized licensed use limited to: University of Calgary. Downloaded on October 15,2022 at 16:33:53 UTC from IEEE Xplore. Restrictions apply.

You might also like