function [ret,x0,str,ts,xts]=extrfilt(t,x,u,flag);
%EXTRFILT	is the M-file description of the SIMULINK system named EXTRFILT.
%	The block-diagram can be displayed by typing: EXTRFILT.
%
%	SYS=EXTRFILT(T,X,U,FLAG) returns depending on FLAG certain
%	system values given time point, T, current state vector, X,
%	and input vector, U.
%	FLAG is used to indicate the type of output to be returned in SYS.
%
%	Setting FLAG=1 causes EXTRFILT to return state derivatives, FLAG=2
%	discrete states, FLAG=3 system outputs and FLAG=4 next sample
%	time. For more information and other options see SFUNC.
%
%	Calling EXTRFILT with a FLAG of zero:
%	[SIZES]=EXTRFILT([],[],[],0),  returns a vector, SIZES, which
%	contains the sizes of the state vector and other parameters.
%		SIZES(1) number of states
%		SIZES(2) number of discrete states
%		SIZES(3) number of outputs
%		SIZES(4) number of inputs
%		SIZES(5) number of roots (currently unsupported)
%		SIZES(6) direct feedthrough flag
%		SIZES(7) number of sample times
%
%	For the definition of other parameters in SIZES, see SFUNC.
%	See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.

% Note: This M-file is only used for saving graphical information;
%       after the model is loaded into memory an internal model
%       representation is used.

% the system will take on the name of this mfile:
sys = mfilename;
new_system(sys)
simver(1.3)
if (0 == (nargin + nargout))
     set_param(sys,'Location',[106,122,499,538])
     open_system(sys)
end;
set_param(sys,'algorithm',     'RK-45')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     '999999')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '10')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars',   '')


%     Subsystem  ['Discrete',13,'Highpass'].

new_system([sys,'/',['Discrete',13,'Highpass']])
set_param([sys,'/',['Discrete',13,'Highpass']],'Location',[8,75,168,638])

add_block('built-in/Filter',[sys,'/',['Discrete',13,'Highpass/Classical FIR ',13,'HP Filter']])
set_param([sys,'/',['Discrete',13,'Highpass/Classical FIR ',13,'HP Filter']],...
		'Numerator','b',...
		'Denominator','1',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','fir1(HP)')
set_param([sys,'/',['Discrete',13,'Highpass/Classical FIR ',13,'HP Filter']],...
		'Mask Dialogue','Classical FIR high pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Highpass/Classical FIR ',13,'HP Filter']],...
		'Mask Translate','[b]=fir1(@2,@1,''high''); ts=@3;  h=freqz(b,1,64); ',...
		'Mask Help','FIR high pass filter using MATLAB''s fir1 command.')
set_param([sys,'/',['Discrete',13,'Highpass/Classical FIR ',13,'HP Filter']],...
		'Mask Entries','0.5\/8\/0.1\/',...
		'position',[50,73,125,117])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Highpass/Discrete-Time',13,'Highpass Filters']])
set_param([sys,'/',['Discrete',13,'Highpass/Discrete-Time',13,'Highpass Filters']],...
		'position',[80,20,85,25])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Highpass/Butterworth',13,'IIR HP Filter']])
set_param([sys,'/',['Discrete',13,'Highpass/Butterworth',13,'IIR HP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','butter(HP)')
set_param([sys,'/',['Discrete',13,'Highpass/Butterworth',13,'IIR HP Filter']],...
		'Mask Dialogue','Butterworth high pass filter.\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Highpass/Butterworth',13,'IIR HP Filter']],...
		'Mask Translate','[a,b,c,d]=butter(@2,@1,''high''); ts=@3; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Highpass/Butterworth',13,'IIR HP Filter']],...
		'Mask Help','IIR Butterworth high pass filter using MATLAB''s butter command.',...
		'Mask Entries','0.5\/4\/0.1\/',...
		'position',[50,167,125,213])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Highpass/Chebychev Type I',13,'IIR HP Filter']])
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type I',13,'IIR HP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby1(HP)')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type I',13,'IIR HP Filter']],...
		'Mask Dialogue','IIR Chebychev type I high pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Db ripple in passband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type I',13,'IIR HP Filter']],...
		'Mask Translate','[a,b,c,d]=cheby1(@2,@3,@1,''high''); ts=@4; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type I',13,'IIR HP Filter']],...
		'Mask Help','IIR Chebychev type I high pass filter using MATLAB''s cheby1 command.',...
		'Mask Entries','0.5\/4\/3\/0.1\/',...
		'position',[55,266,115,314])


%     Subsystem  ['Discrete',13,'Highpass/Elliptic'].

new_system([sys,'/',['Discrete',13,'Highpass/Elliptic']])
set_param([sys,'/',['Discrete',13,'Highpass/Elliptic']],'Location',[8,51,240,278])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Highpass/Elliptic/Elliptic',13,'IIR LP Filter']])
set_param([sys,'/',['Discrete',13,'Highpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','ellip(HP)')
set_param([sys,'/',['Discrete',13,'Highpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'Mask Dialogue','Elliptic high pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Db ripple in passband:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Highpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'Mask Translate','[a,b,c,d]=ellip(@2,@3,@4,@1,''high''); ts=@5; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64);  ')
set_param([sys,'/',['Discrete',13,'Highpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'Mask Help','IIR elliptic high pass filter using MATLAB''s ellip command.',...
		'Mask Entries','0.5\/2\/3\/20\/1\/',...
		'position',[85,66,145,114])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Highpass/Elliptic/(May take some time to draw icon)']])
set_param([sys,'/',['Discrete',13,'Highpass/Elliptic/(May take some time to draw icon)']],...
		'position',[120,20,125,25])


%     Finished composite block ['Discrete',13,'Highpass/Elliptic'].

set_param([sys,'/',['Discrete',13,'Highpass/Elliptic']],...
		'position',[70,464,100,510])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Highpass/Chebychev Type II',13,'IIR HP Filter']])
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type II',13,'IIR HP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby2(HP)')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type II',13,'IIR HP Filter']],...
		'Mask Dialogue','Chebychev type II low pass filter.\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type II',13,'IIR HP Filter']],...
		'Mask Translate','[a,b,c,d]=cheby2(@2,@3,@1,''high''); ts=@4; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type II',13,'IIR HP Filter']],...
		'Mask Help','IIR Chebychev type II high pass filter using MATLAB''s cheby2 command.',...
		'Mask Entries','0.5\/4\/20\/0.1\/')
set_param([sys,'/',['Discrete',13,'Highpass/Chebychev Type II',13,'IIR HP Filter']],...
		'position',[55,361,115,409])


%     Finished composite block ['Discrete',13,'Highpass'].

set_param([sys,'/',['Discrete',13,'Highpass']],...
		'position',[320,178,350,232])


%     Subsystem  ['Discrete',13,'Bandstop'].

new_system([sys,'/',['Discrete',13,'Bandstop']])
set_param([sys,'/',['Discrete',13,'Bandstop']],'Location',[8,75,168,638])


%     Subsystem  ['Discrete',13,'Bandstop/Elliptic'].

new_system([sys,'/',['Discrete',13,'Bandstop/Elliptic']])
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic']],'Location',[8,51,240,278])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Bandstop/Elliptic/(May take some time to draw icon)']])
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic/(May take some time to draw icon)']],...
		'position',[120,20,125,25])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandstop/Elliptic/Elliptic',13,'IIR BS Filter']])
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic/Elliptic',13,'IIR BS Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','ellip(BS)')
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic/Elliptic',13,'IIR BS Filter']],...
		'Mask Dialogue','Elliptic band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Db ripple in passband:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic/Elliptic',13,'IIR BS Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=ellip(@3,@4,@5,[@1-bw,@1+bw],''stop''); ts=@6; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64);  ')
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic/Elliptic',13,'IIR BS Filter']],...
		'Mask Help','IIR elliptic band stop filter using MATLAB''s ellip command.',...
		'Mask Entries','0.5\/0.5\/3\/1\/20\/0.05\/')
set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic/Elliptic',13,'IIR BS Filter']],...
		'position',[85,66,145,114])


%     Finished composite block ['Discrete',13,'Bandstop/Elliptic'].

set_param([sys,'/',['Discrete',13,'Bandstop/Elliptic']],...
		'position',[70,464,100,510])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandstop/Chebychev Type II',13,'IIR BS Filter']])
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type II',13,'IIR BS Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby2(BS)')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type II',13,'IIR BS Filter']],...
		'Mask Dialogue','Chebychev type II band pass filter.\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type II',13,'IIR BS Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=cheby2(@3,@4,[@1-bw,@1+bw],''stop''); ts=@5; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type II',13,'IIR BS Filter']],...
		'Mask Help','IIR Chebychev type II band stop filter using MATLAB''s cheby2 command.',...
		'Mask Entries','0.5\/0.5\/5\/20\/0.1\/')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type II',13,'IIR BS Filter']],...
		'position',[55,356,115,404])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandstop/Chebychev Type I',13,'IIR BS Filter']])
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type I',13,'IIR BS Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby1(BS)')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type I',13,'IIR BS Filter']],...
		'Mask Dialogue','IIR Chebychev type I band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Db ripple in passband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type I',13,'IIR BS Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=cheby1(@3,@4,[@1-bw,@1+bw],''stop''); ts=@5; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type I',13,'IIR BS Filter']],...
		'Mask Help','IIR Chebychev type I band stop filter using MATLAB''s cheby1 command.',...
		'Mask Entries','0.5\/0.5\/3\/1\/0.1\/')
set_param([sys,'/',['Discrete',13,'Bandstop/Chebychev Type I',13,'IIR BS Filter']],...
		'position',[55,266,115,314])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandstop/Butterworth',13,'IIR BS Filter']])
set_param([sys,'/',['Discrete',13,'Bandstop/Butterworth',13,'IIR BS Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','butter(BS)')
set_param([sys,'/',['Discrete',13,'Bandstop/Butterworth',13,'IIR BS Filter']],...
		'Mask Dialogue','Butterworth band pass filter.\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandstop/Butterworth',13,'IIR BS Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=butter(@3,[@1-bw,@1+bw],''stop''); ts=@4; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Bandstop/Butterworth',13,'IIR BS Filter']],...
		'Mask Help','IIR Butterworth band stop filter using MATLAB''s butter command.',...
		'Mask Entries','0.5\/0.5\/5\/0.1\/',...
		'position',[50,167,125,213])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Bandstop/Discrete-Time',13,'Bandstop Filters']])
set_param([sys,'/',['Discrete',13,'Bandstop/Discrete-Time',13,'Bandstop Filters']],...
		'position',[80,20,85,25])

add_block('built-in/Filter',[sys,'/',['Discrete',13,'Bandstop/Classical FIR ',13,'BS Filter']])
set_param([sys,'/',['Discrete',13,'Bandstop/Classical FIR ',13,'BS Filter']],...
		'Numerator','b',...
		'Denominator','1',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','fir1(BS)')
set_param([sys,'/',['Discrete',13,'Bandstop/Classical FIR ',13,'BS Filter']],...
		'Mask Dialogue','Classical FIR band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandstop/Classical FIR ',13,'BS Filter']],...
		'Mask Translate','bw=@2/2; [b]=fir1(@3,[@1-bw,@1+bw],''stop''); ts=@4;  h=freqz(b,1,64); ',...
		'Mask Help','FIR band stop filter using MATLAB''s fir1 command.')
set_param([sys,'/',['Discrete',13,'Bandstop/Classical FIR ',13,'BS Filter']],...
		'Mask Entries','0.5\/0.1\/8\/0.1\/',...
		'position',[50,73,125,117])


%     Finished composite block ['Discrete',13,'Bandstop'].

set_param([sys,'/',['Discrete',13,'Bandstop']],...
		'position',[240,178,270,232])


%     Subsystem  ['Discrete',13,'Bandpass'].

new_system([sys,'/',['Discrete',13,'Bandpass']])
set_param([sys,'/',['Discrete',13,'Bandpass']],'Location',[8,75,168,638])

add_block('built-in/Filter',[sys,'/',['Discrete',13,'Bandpass/Classical FIR ',13,'BP Filter']])
set_param([sys,'/',['Discrete',13,'Bandpass/Classical FIR ',13,'BP Filter']],...
		'Numerator','b',...
		'Denominator','1',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','fir1(BP)')
set_param([sys,'/',['Discrete',13,'Bandpass/Classical FIR ',13,'BP Filter']],...
		'Mask Dialogue','Classical FIR band pass filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandpass/Classical FIR ',13,'BP Filter']],...
		'Mask Translate','bw=@2/2; [b]=fir1(@3, [@1-bw,@1+bw] ); ts=@4;  h=freqz(b,1,64); ',...
		'Mask Help','FIR band pass filter using MATLAB''s fir1 command.')
set_param([sys,'/',['Discrete',13,'Bandpass/Classical FIR ',13,'BP Filter']],...
		'Mask Entries','0.5\/0.1\/8\/0.1\/',...
		'position',[50,73,125,117])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Bandpass/Discrete-Time',13,'Bandpass Filters']])
set_param([sys,'/',['Discrete',13,'Bandpass/Discrete-Time',13,'Bandpass Filters']],...
		'position',[80,20,85,25])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandpass/Butterworth',13,'IIR BP Filter']])
set_param([sys,'/',['Discrete',13,'Bandpass/Butterworth',13,'IIR BP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','butter(BP)')
set_param([sys,'/',['Discrete',13,'Bandpass/Butterworth',13,'IIR BP Filter']],...
		'Mask Dialogue','Butterworth band pass filter.\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandpass/Butterworth',13,'IIR BP Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=butter(@3,[@1-bw,@1+bw] ); ts=@4; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Bandpass/Butterworth',13,'IIR BP Filter']],...
		'Mask Help','IIR Butterworth band pass filter using MATLAB''s butter command.',...
		'Mask Entries','0.5\/0.5\/5\/0.1\/',...
		'position',[50,167,125,213])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandpass/Chebychev Type I',13,'IIR BP Filter']])
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type I',13,'IIR BP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby1(BP)')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type I',13,'IIR BP Filter']],...
		'Mask Dialogue','IIR Chebychev type I band pass filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Db ripple in passband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type I',13,'IIR BP Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=cheby1(@3,@4,[@1-bw,@1+bw]); ts=@5; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type I',13,'IIR BP Filter']],...
		'Mask Help','IIR Chebychev type I band pass filter using MATLAB''s cheby1 command.',...
		'Mask Entries','0.5\/0.5\/3\/1\/0.1\/')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type I',13,'IIR BP Filter']],...
		'position',[55,266,115,314])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandpass/Chebychev Type II',13,'IIR BP Filter']])
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type II',13,'IIR BP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby2(BP)')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type II',13,'IIR BP Filter']],...
		'Mask Dialogue','Chebychev type II band pass filter.\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type II',13,'IIR BP Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=cheby2(@3,@4,[@1-bw,@1+bw]); ts=@5; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type II',13,'IIR BP Filter']],...
		'Mask Help','IIR Chebychev type II band pass filter using MATLAB''s cheby2 command.',...
		'Mask Entries','0.5\/0.5\/5\/20\/0.1\/')
set_param([sys,'/',['Discrete',13,'Bandpass/Chebychev Type II',13,'IIR BP Filter']],...
		'position',[55,356,115,404])


%     Subsystem  ['Discrete',13,'Bandpass/Elliptic'].

new_system([sys,'/',['Discrete',13,'Bandpass/Elliptic']])
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic']],'Location',[8,51,240,278])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Bandpass/Elliptic/Elliptic',13,'IIR BP Filter']])
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic/Elliptic',13,'IIR BP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','ellip(BP)')
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic/Elliptic',13,'IIR BP Filter']],...
		'Mask Dialogue','Elliptic band pass filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (0 to 1):|Bandwidth (0 to 1):|Order:|Db ripple in passband:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic/Elliptic',13,'IIR BP Filter']],...
		'Mask Translate','bw = @2/2; [a,b,c,d]=ellip(@3,@4,@5,[@1-bw,@1+bw]); ts=@6; [num,den]=ss2tf(a,b,c,d,1); if (@3 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64);  ')
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic/Elliptic',13,'IIR BP Filter']],...
		'Mask Help','IIR elliptic band pass filter using MATLAB''s ellip command.',...
		'Mask Entries','0.5\/0.5\/3\/1\/20\/0.05\/')
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic/Elliptic',13,'IIR BP Filter']],...
		'position',[85,66,145,114])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Bandpass/Elliptic/(May take some time to draw icon)']])
set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic/(May take some time to draw icon)']],...
		'position',[120,20,125,25])


%     Finished composite block ['Discrete',13,'Bandpass/Elliptic'].

set_param([sys,'/',['Discrete',13,'Bandpass/Elliptic']],...
		'position',[70,464,100,510])


%     Finished composite block ['Discrete',13,'Bandpass'].

set_param([sys,'/',['Discrete',13,'Bandpass']],...
		'position',[160,178,190,232])


%     Subsystem  ['Analog',13,'Bandstop'].

new_system([sys,'/',['Analog',13,'Bandstop']])
set_param([sys,'/',['Analog',13,'Bandstop']],'Location',[8,75,228,499])


%     Subsystem  ['Analog',13,'Bandstop/Elliptic',13,'BS Filter'].

new_system([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter']])
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter']],'Location',[8,51,241,314])

add_block('built-in/Note',[sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/(May take some time to draw icon)']])
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/(May take some time to draw icon)']],...
		'position',[115,20,120,25])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/Elliptic',13,'BS Filter']])
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/Elliptic',13,'BS Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','ellip, lp2bs,')
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/Elliptic',13,'BS Filter']],...
		'Mask Dialogue','Elliptic band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec):|Bandwidth (rad/sec):|Order:|Db ripple in passband:|Db ripple in stopband:')
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/Elliptic',13,'BS Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''ellipap'',''lp2bs'',@1,@2,50,@3,@4,@5);')
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/Elliptic',13,'BS Filter']],...
		'Mask Help','Elliptic band stop filter using MATLAB''s ellipap and lp2bs commands.',...
		'Mask Entries','20\/1\/3\/3\/30\/')
set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter/Elliptic',13,'BS Filter']],...
		'position',[90,75,145,125])


%     Finished composite block ['Analog',13,'Bandstop/Elliptic',13,'BS Filter'].

set_param([sys,'/',['Analog',13,'Bandstop/Elliptic',13,'BS Filter']],...
		'position',[95,340,125,390])

add_block('built-in/Note',[sys,'/',['Analog',13,'Bandstop/Analog Bandstop Filters']])
set_param([sys,'/',['Analog',13,'Bandstop/Analog Bandstop Filters']],...
		'position',[110,15,115,20])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Bandstop/Analog Butterworth',13,'BS Filter']])
set_param([sys,'/',['Analog',13,'Bandstop/Analog Butterworth',13,'BS Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','buttap,lp2bs')
set_param([sys,'/',['Analog',13,'Bandstop/Analog Butterworth',13,'BS Filter']],...
		'Mask Dialogue','Analog Butterworth band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec)|Bandwidth (rad/sec):|Order')
set_param([sys,'/',['Analog',13,'Bandstop/Analog Butterworth',13,'BS Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''buttap'',''lp2bs'',@1,@2,50,@3);')
set_param([sys,'/',['Analog',13,'Bandstop/Analog Butterworth',13,'BS Filter']],...
		'Mask Help','Butterworth band stop filter using MATLAB''s butter and lp2bs commands.',...
		'Mask Entries','50\/5\/4\/',...
		'position',[80,54,140,96])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Bandstop/Chebychev Type ',13,'BS Filter']])
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type ',13,'BS Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','cheb1ap,lp2bs')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type ',13,'BS Filter']],...
		'Mask Dialogue',' Chebyshev type I band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec):|Bandwidth (rad/sec):|Order:|Db ripple in passband:')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type ',13,'BS Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''cheb1ap'',''lp2bs'',@1,@2,50,@3,@4);')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type ',13,'BS Filter']],...
		'Mask Help','Analog Chebychev type I band stop filter using MATLAB''s cheb1ap and lp2bs commands.',...
		'Mask Entries','50\/5\/3\/3\/')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type ',13,'BS Filter']],...
		'position',[80,139,145,191])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Bandstop/Chebychev Type II',13,'BS  Filter']])
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type II',13,'BS  Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','cheb2ap,lp2bs')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type II',13,'BS  Filter']],...
		'Mask Dialogue','Chebyshev type II band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec):|Bandwidth (rad/sec):|Order:|Db ripple down in stopband:')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type II',13,'BS  Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''cheb2ap'',''lp2bs'',@1,@2,50,@3,@4);')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type II',13,'BS  Filter']],...
		'Mask Help','Analog Chebychev type II band stop filter using MATLAB''s cheb2ap and lp2bs commands.',...
		'Mask Entries','40\/6\/4\/30\/')
set_param([sys,'/',['Analog',13,'Bandstop/Chebychev Type II',13,'BS  Filter']],...
		'position',[80,234,145,286])


%     Finished composite block ['Analog',13,'Bandstop'].

set_param([sys,'/',['Analog',13,'Bandstop']],...
		'position',[240,73,270,127])


%     Subsystem  ['Discrete',13,'Lowpass'].

new_system([sys,'/',['Discrete',13,'Lowpass']])
set_param([sys,'/',['Discrete',13,'Lowpass']],'Location',[8,75,168,638])


%     Subsystem  ['Discrete',13,'Lowpass/Elliptic'].

new_system([sys,'/',['Discrete',13,'Lowpass/Elliptic']])
set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic']],'Location',[8,51,240,278])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Lowpass/Elliptic/(May take some time to draw icon)']])
set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic/(May take some time to draw icon)']],...
		'position',[120,20,125,25])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Lowpass/Elliptic/Elliptic',13,'IIR LP Filter']])
set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','ellip')
set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'Mask Dialogue','Elliptic low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Db ripple in passband:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'Mask Translate','[a,b,c,d]=ellip(@2,@3,@4,@1); ts=@5; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64);  ')
set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic/Elliptic',13,'IIR LP Filter']],...
		'Mask Help','IIR elliptic low pass filter using MATLAB''s ellip command.',...
		'Mask Entries','0.5\/2\/3\/20\/1\/',...
		'position',[85,66,145,114])


%     Finished composite block ['Discrete',13,'Lowpass/Elliptic'].

set_param([sys,'/',['Discrete',13,'Lowpass/Elliptic']],...
		'position',[70,464,100,510])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Lowpass/Chebychev Type II',13,'IIR LP Filter']])
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type II',13,'IIR LP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby2')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type II',13,'IIR LP Filter']],...
		'Mask Dialogue','Chebychev type II low pass filter.\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Db ripple in stopband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type II',13,'IIR LP Filter']],...
		'Mask Translate','[a,b,c,d]=cheby2(@2,@3,@1); ts=@4; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type II',13,'IIR LP Filter']],...
		'Mask Help','IIR Chebychev type II low pass filter using MATLAB''s cheby2 command.',...
		'Mask Entries','0.5\/4\/20\/0.1\/')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type II',13,'IIR LP Filter']],...
		'position',[55,356,115,404])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Lowpass/Chebychev Type I',13,'IIR LP Filter']])
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type I',13,'IIR LP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','cheby1')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type I',13,'IIR LP Filter']],...
		'Mask Dialogue','IIR Chebychev type I low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Db ripple in passband:|Sample time:')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type I',13,'IIR LP Filter']],...
		'Mask Translate','[a,b,c,d]=cheby1(@2,@3,@1); ts=@4; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Lowpass/Chebychev Type I',13,'IIR LP Filter']],...
		'Mask Help','IIR Chebychev type I low pass filter using MATLAB''s cheby1 command.',...
		'Mask Entries','0.5\/4\/3\/0.1\/',...
		'position',[55,266,115,314])

add_block('built-in/Discrete State-Space',[sys,'/',['Discrete',13,'Lowpass/Butterworth',13,'IIR LP Filter']])
set_param([sys,'/',['Discrete',13,'Lowpass/Butterworth',13,'IIR LP Filter']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','butter')
set_param([sys,'/',['Discrete',13,'Lowpass/Butterworth',13,'IIR LP Filter']],...
		'Mask Dialogue','Butterworth low pass filter.\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Lowpass/Butterworth',13,'IIR LP Filter']],...
		'Mask Translate','[a,b,c,d]=butter(@2,@1); ts=@3; [num,den]=ss2tf(a,b,c,d,1); if (@2 <= 8), [a,b,c,d]=tf2ss(num,den); end; h=freqz(num,den,64); ')
set_param([sys,'/',['Discrete',13,'Lowpass/Butterworth',13,'IIR LP Filter']],...
		'Mask Help','IIR Butterworth low pass filter using MATLAB''s butter command.',...
		'Mask Entries','0.5\/4\/0.1\/',...
		'position',[50,167,125,213])

add_block('built-in/Note',[sys,'/',['Discrete',13,'Lowpass/Discrete-Time',13,'Lowpass Filters']])
set_param([sys,'/',['Discrete',13,'Lowpass/Discrete-Time',13,'Lowpass Filters']],...
		'position',[80,20,85,25])

add_block('built-in/Filter',[sys,'/',['Discrete',13,'Lowpass/Classical FIR ',13,'LP Filter']])
set_param([sys,'/',['Discrete',13,'Lowpass/Classical FIR ',13,'LP Filter']],...
		'Numerator','b',...
		'Denominator','1',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','fir1')
set_param([sys,'/',['Discrete',13,'Lowpass/Classical FIR ',13,'LP Filter']],...
		'Mask Dialogue','Classical FIR low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (0 to 1):|Order:|Sample time:')
set_param([sys,'/',['Discrete',13,'Lowpass/Classical FIR ',13,'LP Filter']],...
		'Mask Translate','[b]=fir1(@2,@1); ts=@3;  h=freqz(b,1,64); ',...
		'Mask Help','FIR low pass filter using MATLAB''s fir1 command.')
set_param([sys,'/',['Discrete',13,'Lowpass/Classical FIR ',13,'LP Filter']],...
		'Mask Entries','0.5\/5\/0.1\/',...
		'position',[50,73,125,117])


%     Finished composite block ['Discrete',13,'Lowpass'].

set_param([sys,'/',['Discrete',13,'Lowpass']],...
		'position',[90,178,120,232])


%     Subsystem  ['Analog ',13,'Bandpass'].

new_system([sys,'/',['Analog ',13,'Bandpass']])
set_param([sys,'/',['Analog ',13,'Bandpass']],'Location',[8,75,194,509])

add_block('built-in/State-Space',[sys,'/',['Analog ',13,'Bandpass/Chebychev Type ',13,'BP Filter']])
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type ',13,'BP Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','cheb1ap,lp2bp')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type ',13,'BP Filter']],...
		'Mask Dialogue',' Chebyshev type I band pass filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec):|Bandwidth (rad/sec):|Order:|Db ripple in passband:')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type ',13,'BP Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''cheb1ap'',''lp2bp'',@1,@2,50,@3,@4); ')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type ',13,'BP Filter']],...
		'Mask Help','Analog Chebychev type I band pass filter using MATLAB''s cheb1ap and lp2bp commands.',...
		'Mask Entries','50\/5  \/3 \/3\/')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type ',13,'BP Filter']],...
		'position',[55,134,120,186])

add_block('built-in/State-Space',[sys,'/',['Analog ',13,'Bandpass/Chebychev Type II',13,'BP  Filter']])
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type II',13,'BP  Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','cheb2ap,lp2bp')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type II',13,'BP  Filter']],...
		'Mask Dialogue','Chebyshev type II band pass filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec):|Bandwidth (rad/sec):|Order:|Db ripple down in stopband:')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type II',13,'BP  Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''cheb2ap'',''lp2bp'',@1,@2,50,@3,@4);')
set_param([sys,'/',['Analog ',13,'Bandpass/Chebychev Type II',13,'BP  Filter']],...
		'Mask Help','Analog Chebychev type II band pass filter using MATLAB''s cheb2ap command.',...
		'Mask Entries','50\/8\/4\/40\/',...
		'position',[55,234,120,286])

add_block('built-in/State-Space',[sys,'/',['Analog ',13,'Bandpass/Analog Butterworth',13,'BP Filter ']])
set_param([sys,'/',['Analog ',13,'Bandpass/Analog Butterworth',13,'BP Filter ']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','buttap,lp2bp')
set_param([sys,'/',['Analog ',13,'Bandpass/Analog Butterworth',13,'BP Filter ']],...
		'Mask Dialogue','Analog Butterworth band pass filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec)|Bandwidth (rad/sec):|Order')
set_param([sys,'/',['Analog ',13,'Bandpass/Analog Butterworth',13,'BP Filter ']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''buttap'',''lp2bp'',@1,@2,50,@3);')
set_param([sys,'/',['Analog ',13,'Bandpass/Analog Butterworth',13,'BP Filter ']],...
		'Mask Help','Butterworth band pass filter using MATLAB''s butter and lp2bp command.',...
		'Mask Entries','50\/5\/4\/',...
		'position',[55,54,115,96])

add_block('built-in/Note',[sys,'/',['Analog ',13,'Bandpass/Analog Bandpass Filters']])
set_param([sys,'/',['Analog ',13,'Bandpass/Analog Bandpass Filters']],...
		'position',[85,15,90,20])


%     Subsystem  ['Analog ',13,'Bandpass/Elliptic',13,'BP Filter'].

new_system([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter']])
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter']],'Location',[8,75,226,269])

add_block('built-in/Note',[sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/(May take some time to draw icon)']])
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/(May take some time to draw icon)']],...
		'position',[115,25,120,30])

add_block('built-in/State-Space',[sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/Elliptic',13,'BP Filter']])
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/Elliptic',13,'BP Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','ellip')
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/Elliptic',13,'BP Filter']],...
		'Mask Dialogue','Elliptic low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Bandwidth (rad/sec):|Order:|Db ripple in passband:|Db ripple in stopband:')
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/Elliptic',13,'BP Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''ellipap'',''lp2bp'',@1,@2,50,@3,@4,@5);')
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/Elliptic',13,'BP Filter']],...
		'Mask Help','Elliptic band pass filter using MATLAB''s ellipap and lp2bp commands.',...
		'Mask Entries','20\/1\/2\/3\/30\/')
set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter/Elliptic',13,'BP Filter']],...
		'position',[80,80,135,130])


%     Finished composite block ['Analog ',13,'Bandpass/Elliptic',13,'BP Filter'].

set_param([sys,'/',['Analog ',13,'Bandpass/Elliptic',13,'BP Filter']],...
		'position',[70,340,100,390])


%     Finished composite block ['Analog ',13,'Bandpass'].

set_param([sys,'/',['Analog ',13,'Bandpass']],...
		'position',[160,73,190,127])

add_block('built-in/Note',[sys,'/',['ANALOG:',13,'(S-DOMAIN)']])
set_param([sys,'/',['ANALOG:',13,'(S-DOMAIN)']],...
		'position',[40,90,45,95])

add_block('built-in/Note',[sys,'/',['DISCRETE',13,'TIME:',13,'(Z-DOMAIN)']])
set_param([sys,'/',['DISCRETE',13,'TIME:',13,'(Z-DOMAIN)']],...
		'position',[40,190,45,195])


%     Subsystem  ['Analog',13,'Highpass'].

new_system([sys,'/',['Analog',13,'Highpass']])
set_param([sys,'/',['Analog',13,'Highpass']],'Location',[10,98,228,523])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Highpass/Analog Butterworth',13,'HP Filter']])
set_param([sys,'/',['Analog',13,'Highpass/Analog Butterworth',13,'HP Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','buttap,lp2hp')
set_param([sys,'/',['Analog',13,'Highpass/Analog Butterworth',13,'HP Filter']],...
		'Mask Dialogue','Analog Butterworth high pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Order')
set_param([sys,'/',['Analog',13,'Highpass/Analog Butterworth',13,'HP Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''buttap'',''lp2hp'',@1,[],20,@2);')
set_param([sys,'/',['Analog',13,'Highpass/Analog Butterworth',13,'HP Filter']],...
		'Mask Help','Butterworth high pass filter using MATLAB''s butter and lp2hp commands.',...
		'Mask Entries','50\/4\/',...
		'position',[85,52,150,98])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Highpass/Chebychev Type II',13,'HP  Filter']])
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type II',13,'HP  Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','cheb2ap,lp2hp')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type II',13,'HP  Filter']],...
		'Mask Dialogue','Chebyshev type II high pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Order:|Db ripple down in stopband:')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type II',13,'HP  Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''cheb2ap'',''lp2hp'',@1,[],60,@2,@3);')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type II',13,'HP  Filter']],...
		'Mask Help','Analog Chebychev type II high pass filter using MATLAB''s cheb2ap and lp2hp commands.',...
		'Mask Entries','40\/6\/20\/')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type II',13,'HP  Filter']],...
		'position',[80,234,145,286])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Highpass/Chebychev Type ',13,'HP Filter']])
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type ',13,'HP Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','cheb1ap,lp2hp')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type ',13,'HP Filter']],...
		'Mask Dialogue',' Chebyshev type I high pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Order:|Db ripple in passband:')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type ',13,'HP Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''cheb1ap'',''lp2hp'',@1,[],50,@2,@3);')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type ',13,'HP Filter']],...
		'Mask Help','Analog Chebychev type I high pass filter using MATLAB''s cheb1ap and lp2hp commands.',...
		'Mask Entries','50\/4\/3\/')
set_param([sys,'/',['Analog',13,'Highpass/Chebychev Type ',13,'HP Filter']],...
		'position',[80,139,145,191])

add_block('built-in/Note',[sys,'/',['Analog',13,'Highpass/Analog Highpass Filters']])
set_param([sys,'/',['Analog',13,'Highpass/Analog Highpass Filters']],...
		'position',[110,15,115,20])


%     Subsystem  ['Analog',13,'Highpass/Elliptic',13,'HP Filter'].

new_system([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter']])
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter']],'Location',[8,51,250,269])

add_block('built-in/State-Space',[sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/Elliptic',13,'HP Filter']])
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/Elliptic',13,'HP Filter']],...
		'A','at',...
		'B','bt',...
		'C','ct',...
		'D','dt',...
		'Mask Display','plot(w,mag)',...
		'Mask Type','ellip, lp2hp')
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/Elliptic',13,'HP Filter']],...
		'Mask Dialogue','Elliptic band stop filter.\n\n(Requires Signal Processing Toolbox)|Center frequency (rad/sec):|Order:|Db ripple in passband:|Db ripple in stopband:')
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/Elliptic',13,'HP Filter']],...
		'Mask Translate','[at,bt,ct,dt,w,mag]=filtm(''ellipap'',''lp2hp'',@1,[],60,@2,@3,@4);')
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/Elliptic',13,'HP Filter']],...
		'Mask Help','Elliptic high pass filter using MATLAB''s ellipap and lp2hp commands.',...
		'Mask Entries','20\/2\/3\/20\/')
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/Elliptic',13,'HP Filter']],...
		'position',[90,75,145,125])

add_block('built-in/Note',[sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/(May take some time to draw icon)']])
set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter/(May take some time to draw icon)']],...
		'position',[115,20,120,25])


%     Finished composite block ['Analog',13,'Highpass/Elliptic',13,'HP Filter'].

set_param([sys,'/',['Analog',13,'Highpass/Elliptic',13,'HP Filter']],...
		'position',[95,340,125,390])


%     Finished composite block ['Analog',13,'Highpass'].

set_param([sys,'/',['Analog',13,'Highpass']],...
		'position',[320,73,350,127])

add_block('built-in/Note',[sys,'/','These blocks require the Signal Processing Toolbox'])
set_param([sys,'/','These blocks require the Signal Processing Toolbox'],...
		'position',[195,35,200,40])

add_block('built-in/Note',[sys,'/','Filters'])
set_param([sys,'/','Filters'],...
		'position',[193,9,198,15])


%     Subsystem  ['Double click',13,'on this block',13,'for demo.'].

new_system([sys,'/',['Double click',13,'on this block',13,'for demo.']])
set_param([sys,'/',['Double click',13,'on this block',13,'for demo.']],'Location',[-10,380,117,533])
set_param([sys,'/',['Double click',13,'on this block',13,'for demo.']],...
		'Mask Display','DEMO',...
		'Mask Dialogue','eval(''spectf'')')


%     Finished composite block ['Double click',13,'on this block',13,'for demo.'].

set_param([sys,'/',['Double click',13,'on this block',13,'for demo.']],...
		'position',[256,282,311,316])


%     Subsystem  ['Special Discrete-',13,'Time Filters'].

new_system([sys,'/',['Special Discrete-',13,'Time Filters']])
set_param([sys,'/',['Special Discrete-',13,'Time Filters']],'Location',[8,75,152,405])

add_block('built-in/Note',[sys,'/',['Special Discrete-',13,'Time Filters/(May take some time ',13,'to draw icons)']])
set_param([sys,'/',['Special Discrete-',13,'Time Filters/(May take some time ',13,'to draw icons)']],...
		'position',[75,25,80,30])

add_block('built-in/Filter',[sys,'/',['Special Discrete-',13,'Time Filters/Remez FIR']])
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Remez FIR']],...
		'Numerator','b',...
		'Denominator','a',...
		'Sample time','ts',...
		'Mask Display','plot(1:128,abs(h))',...
		'Mask Type','remez')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Remez FIR']],...
		'Mask Dialogue','Parks-McClellan linear phase FIR filter.\n\n(Requires Signal Processing Toolbox)|Frequencies (0 to 1):|Magnitudes:|Order:|Sample time:')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Remez FIR']],...
		'Mask Translate','[b,a]=remez(@3,@1,@2); ts=@4;  h=freqz(b,a,128); ',...
		'Mask Help','Parks-McClellan filter using MATLAB''s remez command.')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Remez FIR']],...
		'Mask Entries','[0 .55 .65 1]\/[1 1 0 0]\/4\/1\/',...
		'position',[50,243,100,297])

add_block('built-in/Filter',[sys,'/',['Special Discrete-',13,'Time Filters/FIR Filter']])
set_param([sys,'/',['Special Discrete-',13,'Time Filters/FIR Filter']],...
		'Numerator','b',...
		'Denominator','1',...
		'Sample time','ts',...
		'Mask Display','plot(1:64,abs(h))',...
		'Mask Type','fir2')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/FIR Filter']],...
		'Mask Dialogue','FIR filter using inverse ffts.\n\n(Requires Signal Processing Toolbox)|Frequencies (0 to 1):|Magnitudes:|Order:|Sample time:')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/FIR Filter']],...
		'Mask Translate','[b]=fir2(@3,@1,@2); ts=@4;  h=freqz(b,1,64); ',...
		'Mask Help','Finite impulse response filter using MATLAB''s fir2 command.')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/FIR Filter']],...
		'Mask Entries','[0, 0.6, 0.6, 1]\/[1 1 0 0]\/4\/1\/',...
		'position',[50,162,100,208])

add_block('built-in/Filter',[sys,'/',['Special Discrete-',13,'Time Filters/Yulewalk IIR']])
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Yulewalk IIR']],...
		'Numerator','b',...
		'Denominator','a',...
		'Sample time','ts',...
		'Mask Display','plot(1:128,abs(h))',...
		'Mask Type','yulewalk')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Yulewalk IIR']],...
		'Mask Dialogue','Yulewalker filter.\n\n(Requires Signal Processing Toolbox)|Frequencies (0 to 1):|Magnitudes:|Order:|Sample time:')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Yulewalk IIR']],...
		'Mask Translate','[b,a]=yulewalk(@3,@1,@2); ts=@4;  h=freqz(b,a,128); ',...
		'Mask Help','Yulewalker filter using MATLAB''s yulewalk command.')
set_param([sys,'/',['Special Discrete-',13,'Time Filters/Yulewalk IIR']],...
		'Mask Entries','[0 .6 .6 1]\/[1 1 0 0]\/2\/1\/',...
		'position',[50,73,100,127])


%     Finished composite block ['Special Discrete-',13,'Time Filters'].

set_param([sys,'/',['Special Discrete-',13,'Time Filters']],...
		'position',[125,273,155,327])

add_block('built-in/Note',[sys,'/',['NOTES',13,'Discrete-time filters will simulate faster.',13,'Discrete-time filters of order 8 or less are implemented',13,'in controller canonical form for improved efficiency.']])
set_param([sys,'/',['NOTES',13,'Discrete-time filters will simulate faster.',13,'Discrete-time filters of order 8 or less are implemented',13,'in controller canonical form for improved efficiency.']],...
		'position',[190,355,195,360])


%     Subsystem  ['Analog',13,'Lowpass'].

new_system([sys,'/',['Analog',13,'Lowpass']])
set_param([sys,'/',['Analog',13,'Lowpass']],'Location',[8,75,228,499])


%     Subsystem  ['Analog',13,'Lowpass/Elliptic',13,'LP Filter'].

new_system([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter']])
set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter']],'Location',[8,51,294,299])

add_block('built-in/Note',[sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/(May take some time to draw icon)']])
set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/(May take some time to draw icon)']],...
		'position',[160,55,165,60])

add_block('built-in/Zero-Pole',[sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/Elliptic Filter']])
set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/Elliptic Filter']],...
		'Zeros','z',...
		'Poles','p',...
		'Gain','k',...
		'Mask Display','plot(20*log10(w),20*log10(abs(h)))',...
		'Mask Type','ellip')
set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/Elliptic Filter']],...
		'Mask Dialogue','Elliptic low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Order:|Db ripple in passband|Db ripple in stopband:')
set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/Elliptic Filter']],...
		'Mask Translate','[z,p,k]=ellipap(@2,@3,@4); z=@1*z; p=@1*p; k=real(prod(-p)/prod(-z)); [num,den]=zp2tf(z,p,k); w=logspace(log10(@1/10),log10(10*@1),50); h=freqs(num,den,w); ')
set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter/Elliptic Filter']],...
		'Mask Help','Elliptic low pass filter using MATLAB''s ellipap command.',...
		'Mask Entries','0.0001\/4\/2\/30\/',...
		'position',[130,99,185,151])


%     Finished composite block ['Analog',13,'Lowpass/Elliptic',13,'LP Filter'].

set_param([sys,'/',['Analog',13,'Lowpass/Elliptic',13,'LP Filter']],...
		'position',[95,340,125,390])

add_block('built-in/Zero-Pole',[sys,'/',['Analog',13,'Lowpass/Chebychev Type II',13,'LP  Filter']])
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type II',13,'LP  Filter']],...
		'Zeros','z',...
		'Poles','p',...
		'Gain','k',...
		'Mask Display','plot(20*log10(w),20*log10(abs(h)))',...
		'Mask Type','cheb2ap')
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type II',13,'LP  Filter']],...
		'Mask Dialogue','Chebyshev type II low pass filter.\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Order:|Db ripple down in stopband:')
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type II',13,'LP  Filter']],...
		'Mask Translate','[z,p,k]=cheb2ap(@2,@3); z=@1*z; p=@1*p; k=real(prod(-p)/prod(-z)); [num,den]=zp2tf(z,p,k); w=logspace(log10(@1/10),log10(10*@1),50); h=freqs(num,den,w); ')
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type II',13,'LP  Filter']],...
		'Mask Help','Analog Chebychev type II low pass filter using MATLAB''s cheb2ap command.',...
		'Mask Entries','0.0001\/6\/40\/',...
		'position',[85,249,145,301])

add_block('built-in/Zero-Pole',[sys,'/',['Analog',13,'Lowpass/Chebychev Type I',13,'LP Filter']])
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type I',13,'LP Filter']],...
		'Zeros','z',...
		'Poles','p',...
		'Gain','k',...
		'Mask Display','plot(20*log10(w),20*log10(abs(h)))',...
		'Mask Type','cheb1ap')
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type I',13,'LP Filter']],...
		'Mask Dialogue','Chebyshev type I low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec):|Order:|Db ripple in passband:')
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type I',13,'LP Filter']],...
		'Mask Translate','[z,p,k]=cheb1ap(@2,@3); z=@1*z; p=@1*p; k=real(prod(-p)); [num,den]=zp2tf(z,p,k); w=logspace(log10(@1/10),log10(10*@1),50); h=freqs(num,den,w); ')
set_param([sys,'/',['Analog',13,'Lowpass/Chebychev Type I',13,'LP Filter']],...
		'Mask Help','Analog Chebychev type I low pass filter using MATLAB''s cheb1ap command.',...
		'Mask Entries','40\/4\/3\/',...
		'position',[85,155,145,205])

add_block('built-in/Zero-Pole',[sys,'/',['Analog',13,'Lowpass/Analog Butterworth',13,'LP Filter']])
set_param([sys,'/',['Analog',13,'Lowpass/Analog Butterworth',13,'LP Filter']],...
		'Zeros','z',...
		'Poles','p',...
		'Gain','k',...
		'Mask Display','plot(20*log10(w),20*log10(abs(h)))',...
		'Mask Type','buttap')
set_param([sys,'/',['Analog',13,'Lowpass/Analog Butterworth',13,'LP Filter']],...
		'Mask Dialogue','Analog Butterworth low pass filter.\n\n(Requires Signal Processing Toolbox)|Cutoff frequency (rad/sec)|Order')
set_param([sys,'/',['Analog',13,'Lowpass/Analog Butterworth',13,'LP Filter']],...
		'Mask Translate','[z,p,k]=buttap(@2); z=@1*z; p=@1*p; k=real(prod(-p)); [num,den]=zp2tf(z,p,k); w=logspace(log10(@1/10),log10(10*@1),20); h=freqs(num,den,w); ')
set_param([sys,'/',['Analog',13,'Lowpass/Analog Butterworth',13,'LP Filter']],...
		'Mask Help','Butterworth low pass filter using MATLAB''s butter command.',...
		'Mask Entries','40\/4\/',...
		'position',[85,63,145,107])

add_block('built-in/Note',[sys,'/',['Analog',13,'Lowpass/Analog Lowpass Filters']])
set_param([sys,'/',['Analog',13,'Lowpass/Analog Lowpass Filters']],...
		'position',[115,15,120,20])


%     Finished composite block ['Analog',13,'Lowpass'].

set_param([sys,'/',['Analog',13,'Lowpass']],...
		'position',[90,73,120,127])

drawnow

% Return any arguments.
if (nargin | nargout)
	% Must use feval here to access system in memory
	if (nargin > 3)
		if (flag == 0)
			eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
		else
			eval(['ret =', sys,'(t,x,u,flag);'])
		end
	else
		[ret,x0,str,ts,xts] = feval(sys);
	end
else
	drawnow % Flash up the model and execute load callback
end
