Altair Compose® Challenge 4: FIR Filter Design

RSGarciarivas
RSGarciarivas
Altair Employee
edited October 2023 in Altair HyperWorks

The signal processing OML library contains more than 60 functions that you can leverage in Compose. Some of these will help you design and test both digital and analogue filters.

The task for this challenge is to design and validate several types of finite impulse response (FIR) filters. Namely:

  • Lowpass filter with cutoff frequency of 600 Hz
  • Highpass filter with cutoff frequency of 300 Hz
  • Bandpass filter with passband of 500 to 700 Hz

Iterate over your designs creating filters of different order and explore the effect this has on a filter’s frequency response. Consider a sampling frequency of 2 kHz.

Tip: Functions fir1 and freqz are used to obtain required coefficients for a FIR filter and to obtain its frequency response.

Example: Look at this example in which a 50th order FIR lowpass digital filter is designed with a cutoff frequency of 250 Hz and a 2 kHz sampling frequency.

w = hamming(51, 'symmetric');

fc = 250; % cutoff frequency

fs = 2000; % sampling frequency

num = fir1(50, fc/(fs/2), 'low', w);

[h, f] = freqz(num, 1, [0:5:1000], fs);

plot(f, mag2db(abs(h)));

Level: Easy

Product Required: Compose 2020 or later version (including Personal Edition)

The solution can be attached in the comment section of this post. The desired output format is a JPG or PNG picture of the frequency responses obtained. What filter order did you use?

The solution to Challenge Electrical domain Modelica components can be found here.

If you would like to solve more challenges and get regular challenge release updates, Subscribe to the Altair Community Challenge forum.