Professional Documents
Culture Documents
Active Learning Used For Teaching The Topic Design of Finite Impulse Response Filters in MATLAB in The Course Digital Signal Processing
Active Learning Used For Teaching The Topic Design of Finite Impulse Response Filters in MATLAB in The Course Digital Signal Processing
29th International Conference on Systems, Signals and Image Processing “IWSSIP 2022”, June 01 - 03, 2022, Sofia, Bulgaria
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
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 .
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.
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.
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.