function [f,g,h,x,names,values,spar]=dloudApfiltA_lit
% Symbolic literal model of loudspeaker + 4th order Butterworth post filter
%
% [F,G,H,NAMES,VALUES,SPAR]=DLOUDAPFILTA_LIT defines the literal symbolic
% linear-analytic state-space model x'= f(x) + g(x)u, y=hx of a
% loudspeaker with a filter at its output . NAMES is a cell containing parameter names, used later to
% access a structure of numerical parameter values. VALUES is a structure
% with default parameter values X is the symbolic state vector, used in the
% Taylor expansion of the model. SPAR are simulation parameters of the filter
% in case it is also attached to the input of the loudspeaker.

%   CBVK Toolbox
%   JHMG, PMSB 2016

% Output filter
[A,b,c,d]=butter(4,2.989648308834421e+03,'s');
S=ss(A,b,c,d);

% Balanced realization
Sb=balreal(S);

So.A=Sb.a;
So.b=Sb.b;
So.c=Sb.c;

[f,g,h,x,names,values]=dloudApfilt_lit(So);

% Simulation parameters
[Num,Den]=ss2tf(A,b,c,d);
[r,p]=residue(Num,Den);
r=[2*r(imag(p)>0); r(imag(p)==0)];
p=[p(imag(p)>0); p(imag(p)==0)];
spar.r=r;
spar.p=p;







