Skip to content

FIR and IIR digital filter design tool. Available on the Mac App Store.

License

Notifications You must be signed in to change notification settings

frolovilya/filter-designer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filter Designer

FIR and IIR low/high pass digital filter designer tool

  • Low and high pass filters
  • Finite and infinite impulse responses
  • Various window types
  • Frequency and phase analysis
  • Pass and transition bands indication
  • Free and open-source

Download on the Mac App Store

ui

Usage

Finite Impulse Response

Using window method for FIR filter design. Filter cofficients are generated by applying an inverse FFT on the ideal frequency response and then multiplying with a selected window function.

High pass filter is calculated from a low pass filter by shifting (multiplying) result coefficients with a sine wave of pi/2 frequency sampled at samplingRate/2.

Number of filter coefficients is either calculated based on the target Attenuation (dB) and Transition Length (Hz) or entered manually. Using odd number of coefficients allows for a linear phase response.

Frequency and phase responses are calculated with a direct FFT of the filter coefficients.

Filter coefficients c[k] must be convolved with a sample buffer to apply a FIR filter:

Vout[i] = c[k] * Vin[i-k] + c[k-1] * Vin[i-(k-1)] + ... + c[0] * Vin[i]

Where Vin[] is a input circle sample buffer of size n, k is a total number of filter coefficients, Vin[i] is a last input sample, Vout[i] is a current output filtered sample.

Infinite Impulse Response

Basic analog filter replication. Using RC circuit for a low-pass and CR circuit for a high-pass filters. analog_filters

Frequency and phase responses are calculated by simulating sine waves of various frequencies and applying IIR filters directly.

IIR filter with coefficients c[3] must be applied the following way:

Vout[i] = c[0] * Vin[i] + c[1] * Vin[i-1] + c[2] * Vout[i-1]

Where Vin[i] is a current input sample, Vout[i] current output filtered sample, Vin[i-1] and Vout[i-1] are previous input and output samples used as a feedback for the IIR filter.

Build

The project depends on Qt, FFTW3, Welle and Boost libraries.

Qt path is passed to the CMake build via -DQT_PATH option, since you may wish to install it via Qt Maintenance Tool to any directory.

FFTW3, Welle and Boost must be available in you /usr/local/include for CMake to resolve the paths.

mkdir build; cd build
cmake ../ -DQT_PATH=/Users/frolovilya/Dev/tools/QT/6.7.0/macos

make