var documenterSearchIndex = {"docs":
[{"location":"manual/#Manual","page":"Manual","title":"Manual","text":"","category":"section"},{"location":"manual/#Installation","page":"Manual","title":"Installation","text":"","category":"section"},{"location":"manual/","page":"Manual","title":"Manual","text":"To install FIRLSFilterDesign.jl, open up a Julia REPL and do:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"pkg> update\npkg> add FIRLSFilterDesign","category":"page"},{"location":"manual/#Usage","page":"Manual","title":"Usage","text":"","category":"section"},{"location":"manual/#Unweighted-least-squares-FIR-design","page":"Manual","title":"Unweighted least-squares FIR design","text":"","category":"section"},{"location":"manual/","page":"Manual","title":"Manual","text":"Let's say we want to design a bandpass filter with a passband from 1 Hz to 2 Hz, with a sampling frequency of 6 Hz, a filter order of 10, and symmetric filter coefficients. ","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"We can do this as follows:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"using FIRLSFilterDesign;\nfs = 6;\nfilter_order = 10;\nantisymmetric = false;","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"Set the frequency-band matrix:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"freq_bands = [0 1; 1 2; 2 3];","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"note: Note\nFrequency bands must not overlap and must completely cover the range 0 f_s2.","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"Define the amplitude response:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"D = [0. 0.; 1. 1.; 0. 0.];","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"Now we can design the filter:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"using FIRLSFilterDesign;\nfs = 6;\nfilter_order = 10;\nantisymmetric = false;\nfreq_bands = [0 1; 1 2; 2 3];\nD = [0. 0.; 1. 1.; 0. 0.];","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"h = firls_design(filter_order, freq_bands, D, antisymmetric; fs = fs)","category":"page"},{"location":"manual/#Weighted-least-squares-FIR-design","page":"Manual","title":"Weighted least-squares FIR design","text":"","category":"section"},{"location":"manual/","page":"Manual","title":"Manual","text":"Now let's say we want to design the same filter, but this time we want to place more weight on errors in the passband. We can do this by defining the following weighting coefficient matrix:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"W = [1 2; 2 2; 2 1];","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"Now we can design the filter with the weight function:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"using FIRLSFilterDesign;\nfs = 6;\nfilter_order = 10;\nantisymmetric = false;\nbands_D = [0 1; 1 2; 2 3];\nD = [0. 0.; 1. 1.; 0. 0.];\nW = [1 2; 2 2; 2 1];","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"h = firls_design(filter_order, bands_D, D, W, antisymmetric; fs = fs)","category":"page"},{"location":"manual/#Different-input-forms","page":"Manual","title":"Different input forms","text":"","category":"section"},{"location":"manual/","page":"Manual","title":"Manual","text":"You can use the firls_design function with several different input shapes for the frequency, amplitude response, and weighting function values. They are listed in the table below:","category":"page"},{"location":"manual/","page":"Manual","title":"Manual","text":"Frequency bands Amplitude response Weighting function Comments\nMatrix Union{Vector,Matrix} Union{Vector,Matrix} Vectors are interpreted as constant values over the frequency band.\nVector Vector Vector Vectors are interpreted as frequency knotpoints and values at those knotpoints.\nMatrix Union{Vector,Matrix} N/A Vectors are interpreted as constant values over the frequency band.\nVector Vector N/A Vectors are interpreted as frequency knotpoints and values at those knotpoints.","category":"page"},{"location":"manual/#Functions","page":"Manual","title":"Functions","text":"","category":"section"},{"location":"manual/","page":"Manual","title":"Manual","text":"Modules = [FIRLSFilterDesign]","category":"page"},{"location":"manual/#FIRLSFilterDesign._to_impulse_response-Tuple{Any, FIRLSFilterDesign.FIR_III}","page":"Manual","title":"FIRLSFilterDesign._to_impulse_response","text":"For type III FIR filters:\n\n    h = bigg aM+1 quad aM quad cdots quad a2 quad 0 quad -a2 quad cdots quad -aM+1 bigg^T\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign._to_impulse_response-Tuple{Any, FIRLSFilterDesign.FIR_II}","page":"Manual","title":"FIRLSFilterDesign._to_impulse_response","text":"For type II FIR filters:\n\n    h = bigg aM+1 quad aM quad cdots quad a2 quad a1 quad a1 quad a2 quad cdots quad aM+1 bigg^T\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign._to_impulse_response-Tuple{Any, FIRLSFilterDesign.FIR_IV}","page":"Manual","title":"FIRLSFilterDesign._to_impulse_response","text":"For type IV FIR filters:\n\n    h = bigg aM+1 quad aM quad cdots quad a2 quad 0 quad 0 quad -a2 quad cdots quad -aM+1 bigg^T\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign._to_impulse_response-Tuple{Any, FIRLSFilterDesign.FIR_I}","page":"Manual","title":"FIRLSFilterDesign._to_impulse_response","text":"_to_impulse_response(a, fir_type)\n\nCreates a linear phase FIR filter based on fir_type and the coefficients in vector a, which was obtained by solving the linear equation Qa = b.\n\n...\n\nArguments\n\n-a::Vector      : a vector of size (M+1,) with coefficients.   \n\nfir_type::FIR : indicates the type of FIR filter.\n\nOutputs\n\n-h::Vector      : a vector of size (filter_order+1,) with the filter coefficients. ...\n\nFor type I FIR filters:\n\n    h = bigg aM+1 quad aM quad cdots quad a2 quad a1 quad a2 quad cdots quad aM+1 bigg^T\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign._update_trig_arg_b!-Tuple{Any, Any, Union{FIRLSFilterDesign.FIR_I, FIRLSFilterDesign.FIR_II}}","page":"Manual","title":"FIRLSFilterDesign._update_trig_arg_b!","text":"_update_trig_arg_b!(_αn, n, fir_type::Union{FIR_I,FIR_II})\n\nUpdates the argument of the trigonometric functions in bn! by multiplying with the current n.\n\n...\n\nArguments\n\n_αn::Vector : a vector of size (J,)\nn::Real\nfir_type{Union{FIR_I,FIR_II}}\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign._update_trig_arg_b!-Tuple{Any, Any, Union{FIRLSFilterDesign.FIR_III, FIRLSFilterDesign.FIR_IV}}","page":"Manual","title":"FIRLSFilterDesign._update_trig_arg_b!","text":"_update_trig_arg_b!(_αn, n, fir_type::Union{FIR_III,FIR_IV})\n\nUpdates the argument of the trigonometric functions in bn! by multiplying with n and subtracting pi. The subtraction of pi is necessary because when the filter is antisymmetric (type III and IV FIR filters), the filter response is a sum of sines instead of cosines and sin(x) = cos(x - pi2) (see page 12 and 13 of this).\n\n...\n\nArguments\n\n_αn::Vector : a vector of size (J,)\nn::Real\nfir_type::Union{FIR_III,FIR_IV}\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.bn!-NTuple{7, Any}","page":"Manual","title":"FIRLSFilterDesign.bn!","text":"bn!(_bn, k, f, a, b, c, d)\n\nSpecial case for when n = 0, since then the integral is simplified:\n\ng_j(f0) = (c_j f+d_j) (a_j f+b_j) cos(pi k f 0) = (c_j f+d_j) (a_j f+b_j)\n\nAnd the antiderivative becomes:\n\nG_j(f0) = a_j c_j fracf^33  + (a_j d_j + b_j c_j)fracf^22 + b_j d_j f\n\n...\n\nArguments\n\n_bn::Vector : a vector of size (J,) that is used to store the intermdediate values.\nk::Real : equal to 2f_s.\nf::Matrix : a matrix of size (J,2) which contains rows of sequential frequency bands, spanning [0, fs/2].\na::Vector : a vector of size (J,) with the a_j values in the equation a_j f + b_j that equates to the linear function that describes the desired frequency response in the j^th frequency band.\nb::Vector : a vector of size (J,) with the b_j values in the equation a_j f + b_j that equates to the linear function that describes the desired frequency response in the j^th frequency band.\nc::Vector : a vector of size (J,) with the c_j values in the equation c_j f + d_j that equates to the linear function that describes the error weighting function in the j^th frequency band.\nd::Vector : a vector of size (J,) with the d_j values in the equation c_j f + d_j that equates to the linear function that describes the error weighting function in the j^th frequency band.\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.bn!-NTuple{8, Any}","page":"Manual","title":"FIRLSFilterDesign.bn!","text":"bn!(_bn, n, k, _αn, _βn², γ, _δn, fir_type)\n\nCalculates the elements of the b-vector, which are equal to: \n\nbi = frac2f_s int_0^f_s2 W(f) D(f) cos(pi frac2f_s n f) df quad i = 1 2 cdots M+1\n\nBoth D(f) and W(f) are piecewise linear functions, and n is calculated by idx2n_b. Using k = 2f_s, this integral becomes:\n\nbi = k sum_j=1^J int_F_j1^F_j2 g_j(fn) df = k sum_j=1^J int_F_j1^F_j2 big(c_j f+d_jbig) big(a_j f+b_jbig) cos(pi k n f) df quad i = 1 2 cdots M+1\n\nWhere:\n\nF_j1 and F_j2 are the lower and upper bound of the j^th frequency band.\na_j and b_j are the parameters of the linear function that describes the desired frequency response in the j^th frequency band.\nc_j and d_j are the parameters of the linear function that describes the error weighting function in the j^th frequency band.\n\nThe antiderivative of g(fn) is equal to:\n\nG_j(fn) = frac1pi^3 k^3 n^3 bigg(sinbig(alpha(f) nbig)Big(beta_j(f) n^2 + gamma_j(f)Big) + delta_j(f) n cosbig(alpha(f) nbig)bigg) + constants\n\nWhere:\n\nalpha(f) = pi kf, \nbeta(f) = pi^2 k^2 big(acf^2 + (ad+bc)f + bdbig), \ngamma(f) = -2ac, \ndelta(f) = pi kbig(2acf + ad + bcbig).\n\nNote that the subscripts have been dropped here for clarity.\n\n...\n\nArguments\n\n_bn::Vector   : a vector of size (J,) that is used to store the intermediate values.\nn::Integer    : integer denoting the current cosine mode.\nk::Real       : equal to 2/fs.\n_αn::Vector   : a vector of size (J,) that holds the values of alpha n.\n_βn²::Vector  : a vector of size (J,) that holds the values of beta n^2.\nγ::Vector     : a vector of size (J,) that holds the values of gamma.\n_δn::Vector   : a vector of size (J,) that holds the values of delta n.\nfir_type::FIR : indicates the type of FIR filter.\n\nOutputs\n\nbn            : n^th element in the b vector.\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.bn_n0!-NTuple{13, Any}","page":"Manual","title":"FIRLSFilterDesign.bn_n0!","text":"bn_n0!(_bn, n, k, f, a, b, c, d, _αn, _βn², γ, _δn, fir_type)\n\nDispatches to the correct function to calculate the first element of the b vector, based on the type of FIR filter. Needed because for type I FIR filters the value of n at the first iteration is 0.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.constants_b-Tuple{Any, Any, Any}","page":"Manual","title":"FIRLSFilterDesign.constants_b","text":"constants_b(f, D, W)\n\nCalculates data that is reused at every evaluation of bn!.\n\n...\n\nArguments\n\nf::Matrix : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning the interval [0, fs/2].\nD::Matrix : a matrix of size (N,2) which contains rows of desired frequency response values for the frequency bands in f. The first and second columns indicate the desired response at the lower and upper bound of the frequency bands, interpolated linearly in between.\nW::Matrix : a matrix of size (N,2) which contains rows of weighting coefficients for the frequency bands in f. The first and second columns indicate the weighting at the lower and upper bound of the frequency bands, interpolated linearly in between.\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.firls_design-Tuple{Integer, Matrix{T} where T, Matrix{T} where T, Matrix{T} where T, Bool}","page":"Manual","title":"FIRLSFilterDesign.firls_design","text":"firls_design(filter_order::Integer, bands_DW::Matrix, D::Matrix, W::Matrix, antisymmetric::Bool; fs::Real = 1, solver::Function = \\)\n\nDesigns a linear-phase FIR filter.\n\nArguments\n\nfilter_order::Integer   : the order of the FIR filter.\nbands_DW::Matrix        : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning [0, fs/2].\nD::Matrix               : a matrix of size (N,2) which contains rows of amplitude responses for the frequency bands in bands_DW. The first and second columns indicate the amplitude response at the lower and upper bound of the frequency bands, interpolated linearly in between.\nW::Matrix               : a matrix of size (N,2) which contains rows of weighting coefficients for the frequency bands in bands_DW. The first and second columns indicate the weighting at the lower and upper bound of the frequency bands, interpolated linearly in between.\nantisymmetric::Bool     : a Boolean that signifies whether the filter coefficients will be anti-symmetric, as used in type III and IV FIR filters.\nfs::Real                : the sampling frequency.\nsolver::Function        : the function that is called to solve the equation Qa = b, with the function call: solver(Q,b) which returns a.\n\nOutputs\n\nh : a vector of linear-phase FIR filter coefficients.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.firls_design-Tuple{Integer, Matrix{T} where T, VecOrMat{T} where T, Bool}","page":"Manual","title":"FIRLSFilterDesign.firls_design","text":"firls_design(filter_order::Integer, bands_DW::Matrix, D::Union{Vector,Matrix}, antisymmetric::Bool; fs::Real = 1, solver::Function = \\)\n\nArguments\n\nfilter_order::Integer   : the order of the FIR filter.\nbands_DW::Matrix        : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning [0, fs/2].\nD::Union{Vector,Matrix} : a matrix of size (N,2), or a vector of size (N,), which amplitude responses for the frequency bands in bands_DW. In the case of a matrix, the first and second columns indicate the amplitude response at the lower and upper bound of the frequency bands, interpolated linearly in between. In the case of a vector the elements the amplitude response is piecewise constant.\nantisymmetric::Bool     : a Boolean that signifies whether the filter coefficients will be anti-symmetric, as used in type III and IV FIR filters.\nfs::Real                : the sampling frequency.\nsolver::Function        : the function that is called to solve the equation Qa = b, with the function call: solver(Q,b) which returns a.\n\nOutputs\n\nh : a vector of linear-phase FIR filter coefficients.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.firls_design-Tuple{Integer, Matrix{T} where T, VecOrMat{T} where T, VecOrMat{T} where T, Bool}","page":"Manual","title":"FIRLSFilterDesign.firls_design","text":"firls_design(filter_order::Integer, bands_DW::Matrix, D::Union{Vector,Matrix}, W::Union{Vector,Matrix}, antisymmetric::Bool; fs::Real = 1, solver::Function = \\)\n\nArguments\n\nfilter_order::Integer   : the order of the FIR filter.\nbands_DW::Matrix        : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning [0, fs/2].\nD::Union{Vector,Matrix} : a matrix of size (N,2), or a vector of size (N,), which amplitude responses for the frequency bands in bands_DW. In the case of a matrix, the first and second columns indicate the amplitude response at the lower and upper bound of the frequency bands, interpolated linearly in between. In the case of a vector the elements the amplitude response is piecewise constant.\nW::Union{Vector,Matrix} : a matrix of size (N,2), or a vector of size (N,), which contains weighting function values for the frequency bands in bands_DW. In the case of a matrix, the first and second columns indicate the weighting function values at the lower and upper bound of the frequency bands, interpolated linearly in between. In the case of a vector the elements the weighting function is piecewise constant.\nantisymmetric::Bool     : a Boolean that signifies whether the filter coefficients will be anti-symmetric, as used in type III and IV FIR filters.\nfs::Real                : the sampling frequency.\nsolver::Function        : the function that is called to solve the equation Qa = b, with the function call: solver(Q,b) which returns a.\n\nOutputs\n\nh : a vector of linear-phase FIR filter coefficients.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.firls_design-Tuple{Integer, Vector{T} where T, Vector{T} where T, Bool}","page":"Manual","title":"FIRLSFilterDesign.firls_design","text":"firls_design(filter_order::Integer, knotpoints_D::Vector, D::Vector, antisymmetric::Bool; fs::Real = 1, solver::Function = \\)\n\nArguments\n\nfilter_order::Integer   : the order of the FIR filter.\nknotpoints_D::Vector    : a vector of size (N,) which contains frequency knotpoints, spanning [0, fs/2].\nD::Vector               : a vector of size (N,) which contains amplitude response values for the frequency knotpoints in knotpoints_D::Vector.\nantisymmetric::Bool     : a Boolean that signifies whether the filter coefficients will be anti-symmetric, as used in type III and IV FIR filters.\nfs::Real                : the sampling frequency.\nsolver::Function        : the function that is called to solve the equation Qa = b, with the function call: solver(Q,b) which returns a.\n\nOutputs\n\nh : a vector of linear-phase FIR filter coefficients.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.firls_design-Tuple{Integer, Vector{T} where T, Vector{T} where T, Vector{T} where T, Bool}","page":"Manual","title":"FIRLSFilterDesign.firls_design","text":"firls_design(filter_order::Integer, knotpoints_DW::Vector, D::Vector, W::Vector, antisymmetric::Bool; fs::Real = 1, solver::Function = \\)\n\nArguments\n\nfilter_order::Integer   : the order of the FIR filter.\nknotpoints_DW::Vector   : a vector of size (N,) which contains frequency knotpoints, spanning [0, fs/2].\nD::Vector               : a vector of size (N,) which contains amplitude response values for the frequency knotpoints in knotpoints_DW. \nW::Vector               : a vector of size (N,) which contains weighting function values for the frequency knotpoints in knotpoints_DW. \nantisymmetric::Bool     : a Boolean that signifies whether the filter coefficients will be anti-symmetric, as used in type III and IV FIR filters.\nfs::Real                : the sampling frequency.\nsolver::Function        : the function that is called to solve the equation Qa = b, with the function call: solver(Q,b) which returns a.\n\nOutputs\n\nh : a vector of linear-phase FIR filter coefficients.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.get_Q-NTuple{4, Any}","page":"Manual","title":"FIRLSFilterDesign.get_Q","text":"get_Q(M, f, W, fir_type)\n\nConstructs the matrix Q used in the equation Qa = b, based on a set of weights.\n\nArguments\n\nM::Integer      : indicator of the amount of elements needed.\nf::Matrix       : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning [0, fs/2].\nW::Matrix       : a matrix of size (N,2) which contains rows of weighting coefficients for the frequency bands in f. The first and second columns indicate the weighting at the lower and upper bound of the frequency bands, interpolated linearly in between.\nfir_type::FIR   : indicates the type of FIR filter.\n\nOutputs\n\nQ::Matrix : the matrix Q used in the equation Qa = b.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.get_Q-Tuple{Any, Any}","page":"Manual","title":"FIRLSFilterDesign.get_Q","text":"get_Q(M, fir_type)\n\nConstructs the matrix Q used in the equation Qa = b, when there are no weights. Which results in Q being the identity matrix.\n\nArguments\n\nM::Integer      : indicator of the amount of elements needed.\nfir_type::FIR   : indicates the type of FIR filter.\n\nOutputs\n\nQ::Matrix : the matrix Q used in the equation Qa = b.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.get_Q-Tuple{Any, FIRLSFilterDesign.FIR_I}","page":"Manual","title":"FIRLSFilterDesign.get_Q","text":"get_Q(M, fir_type::FIR_I)\n\nConstructs the matrix Q used in the equation Qa = b, when there are no weights and the FIR filter is of type I.\n\nArguments\n\nM::Integer      : indicator of the amount of elements needed.\nfir_type::FIR_I   : indicates the type of FIR filter is I.\n\nOutputs\n\nQ::Matrix : the matrix Q used in the equation Qa = b.\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.get_b-NTuple{5, Any}","page":"Manual","title":"FIRLSFilterDesign.get_b","text":"get_b(M, f, D, W, fir_type)\n\nFinds the vector b used in the equation Qa = b. ...\n\nArguments\n\nM::Integer      : Size of the b vector is M+1 .\nf::Matrix       : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning the interval [0, fs/2].\nD::Matrix       : a matrix of size (N,2) which contains rows of desired frequency response values for the frequency bands in f. The first and second columns indicate the desired response at the lower and upper bound of the frequency bands, interpolated linearly in between.\nW::Matrix       : a matrix of size (N,2) which contains rows of weighting coefficients for the frequency bands in f. The first and second columns indicate the weighting at the lower and upper bound of the frequency bands, interpolated linearly in between.\nfir_type::FIR   : indicates the type of FIR filter.\n\nOutputs\n\nb_out::Vector   : a vector of size (M+1,), the b-vector used in the equation Qa = b.\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.get_flength_M-Tuple{Any}","page":"Manual","title":"FIRLSFilterDesign.get_flength_M","text":"get_flength_M(filter_order)\n\nDetermines the length of the FIR filter and the number of amplitude coefficients needed, based on its order.\n\nArguments\n\nfilter_order::Integer : the order of the FIR filter.\n\nOutputs\n\nfilter_length::Integer : the number of filter coefficients\nM::Integer : the number of unique amplitude coefficients needed to form the filter is equal to M+1\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.get_q-NTuple{4, Any}","page":"Manual","title":"FIRLSFilterDesign.get_q","text":"get_q(M, f, W, fir_type)\n\nFinds the vector q which is used to populate the matrix Q. ...\n\nArguments\n\nM::Integer      : indicator of the amount of elements needed.\nf::Matrix       : a matrix of size (N,2) which contains rows of sequential frequency bands, spanning [0, fs/2].\nW::Matrix       : a matrix of size (N,2) which contains rows of weighting coefficients for the frequency bands in f. The first and second columns indicate the weighting at the lower and upper bound of the frequency bands, interpolated linearly in between.\nfir_type::FIR   : indicates the type of FIR filter.\n\nOutputs\n\nq_out::Vector   : a vector of q-values that are used to fill in the Q-matrix.\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.idx2n_b-Tuple{Any, Union{FIRLSFilterDesign.FIR_I, FIRLSFilterDesign.FIR_III}}","page":"Manual","title":"FIRLSFilterDesign.idx2n_b","text":"idx2n_b(idx, fir_type::Union{FIR_I,FIR_III})\n\nDetermine the value of n based on the index in the b-vector. For type I and III FIR filters the following holds: n = i - 1. Based on page 10 and 12 of this.\n\n...\n\nArguments\n\ni::Integer : index in the b-vector.\nfir_type::Union{FIR_I,FIR_III}\n\nOutputs\n\nn::Real\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.idx2n_b-Tuple{Any, Union{FIRLSFilterDesign.FIR_II, FIRLSFilterDesign.FIR_IV}}","page":"Manual","title":"FIRLSFilterDesign.idx2n_b","text":"idx2n_b(idx, fir_type::Union{FIR_II,FIR_IV})\n\nDetermine the value of n based on the index in the b-vector, Where n is used in  For type II and IV FIR filters the following holds: n = i - 12. Based on page 11 and 13 of this.\n\n...\n\nArguments\n\ni::Integer : index in the b-vector.\nfir_type::Union{FIR_II,FIR_IV}\n\nOutputs\n\nn::Real\n\n...\n\n\n\n\n\n","category":"method"},{"location":"manual/#FIRLSFilterDesign.infer_fir_type-Tuple{Any, Any}","page":"Manual","title":"FIRLSFilterDesign.infer_fir_type","text":"infer_fir_type(is_odd, is_antisymmetric)\n\nDetermines the type of FIR filter to be designed, based on:\n\nWhether the number of filter coefficients is odd (is_odd)\nWhether the filter should be antisymmetric (is_antisymmetric)\n\nThe result is a fir_type, which can be:\n\nFIR_I, when filter length is odd and the filter is not antisymmetric\nFIR_II, when filter length is even and the filter is not antisymmetric\nFIR_III, when filter length is odd and the filter is antisymmetric\nFIR_IV, when filter length is even and the filter is antisymmetric\n\nArguments\n\nis_odd::Bool\nis_antisymmetric::Bool\n\nOutputs\n\nfir_type::FIR\n\n\n\n\n\n","category":"method"},{"location":"#FIRLSFilterDesign.jl-Least-squares-FIR-filter-design","page":"Home","title":"FIRLSFilterDesign.jl - Least-squares FIR filter design","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"FIRLSFilterDesign.jl is a julia package to perform linear-phase FIR filter design using weighted least-squares. It supports the following:","category":"page"},{"location":"","page":"Home","title":"Home","text":"Piecewise linear amplitude response functions\nPiecewise linear weighting functions\nType I, II, III, IV FIR filters\nCustom linear solver function","category":"page"}]
}
