This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function h = fsamp(mag,N) | |
% function h = fsamp(mag,N) | |
% frequency sampling design of linear phase FIR filter | |
% | |
% mag ... desired magnitude response on an equidistant grid | |
% between 0 and Nyquist | |
% N ... filter length (N <= 2*length(mag) - 1 ) | |
% | |
% for even N the frequency grid is defined by (M = length(mag)): | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function a = iir_ap(N,f,phi,W) | |
% function a = iir_ap(N,f,phi,W) | |
% IIR allpass filter design using an equation error method | |
% | |
% a denominator coefficients; numerator = flipud(a) | |
% N filter order | |
% f frequency grid; 0 <= f <= 1 ('1' equals Nyquist) | |
% phi desired phase on the grid (in radians) | |
% W positive weight function on the frequency grid | |
% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function x = levin(a,b) | |
% function x = levin(a,b) | |
% solves system of complex linear equations toeplitz(a)*x=b | |
% using Levinson's algorithm | |
% a ... first row of positive definite Hermitian Toeplitz matrix | |
% b ... right hand side vector | |
% | |
% Author: Mathias C. Lang, Vienna University of Technology, AUSTRIA | |
% 1997-09 | |
% [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function h = cfirls(N,f,d,w,hreal) | |
% function h = cfirls(N,f,d,w,hreal) | |
% Least-squares FIR filter design with prescribed magnitude and phase | |
% responses and with possibly complex coefficients | |
% | |
% h real or complex-valued impulse response | |
% N desired filter length | |
% f frequency grid | |
% for complex-valued filters ('hreal=0'): -1 <= f < 1 | |
% ( '1' corresponds to Nyquist) or 0 <= f < 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [a,b] = eqnerror(M,N,w,D,W,iter); | |
% [a,b] = eqnerror(M,N,w,D,W,iter); | |
% | |
% IIR filter design using equation error method | |
% | |
% if the input argument 'iter' is specified and if iter > 1, then | |
% the equation error method is applied iteratively trying to | |
% determine the true L2 solution of the nonlinear IIR design problem | |
% | |
% M numerator order |