[ANN] FIRLSFilterDesign.jl

Hi everyone,

I want to announce FIRLSFilterDesign.jl, which is a package that allows you to design linear phase Finite Impulse Response filters using weighted Least-Squares.

It supports:

  • All types of linear phase FIR filters (type I, II, III, and IV)
  • Piecewise-linear amplitude response-, and weighting functions

To design a type I passband filter you run the following commands in the Julia REPL:

using Pkg; Pkg.update(); Pkg.add("FIRLSFilterDesign")
using FIRLSFilterDesign
fs = 60 #Sampling frequency in Hz
filter_order = 10
antisymmetric = false
f_bands = [0. 10; 10 20; 20 30] #Frequency bands have to span [0,fs/2] and should not overlap
desired = [0. 0; 1 1; 0 0 ]
filter_coeff = firls_design(filter_order, f_bands, desired, antisymmetric; fs = fs)

If you want to apply a weighting function do the following:

using Pkg; Pkg.update();  Pkg.add("FIRLSFilterDesign")
using FIRLSFilterDesign
fs = 60 #Sampling frequency in Hz
filter_order = 10
antisymmetric = false
f_bands = [0. 10; 10 20; 20 30] #Frequency bands have to span [0,fs/2] and should not overlap
desired = [0. 0; 1 1; 0 0 ]
weights = [1. 2; 2 2; 2 1]
filter_coeff = firls_design(filter_order, f_bands, desired, weights, antisymmetric; fs = fs)

There are docs but they are not 100% there yet, planning on updating them over the course of a few weeks.

Cheers!

11 Likes

Thanks for this really interesting package !
You maybe should consider to move it to the JuliaDSP workgroup ? It is closely related (and very complementary) to what is currently done iand it may ease to find your package.

1 Like

Thanks for the compliment and advise :slight_smile:

I am not sure how to proceed. How can I add my package to this workgroup, or contact the members of the group to see if they’re interested? I have tried mailing to julia-dsp@googlegroups.com, but I get an email back saying this address might not exist

I think that the simplest way is to contact directly one of the maintainer of the organisation (such as @ararslan or @galenlynch ) and see how they consider that :slightly_smiling_face:

+1 for adding this to DSP.jl.
Submit a pull request to GitHub - JuliaDSP/DSP.jl: Filter design, periodograms, window functions, and other digital signal processing functionality.
IMO the interface for firls should be consistent with remez.
DSP.jl/remez_fir.jl at master · JuliaDSP/DSP.jl · GitHub

1 Like