Code covered by the BSD License  

Highlights from
Analog Filter Design Toolbox

image thumbnail
from Analog Filter Design Toolbox by James Squire
GUI to design and simulate active (opamp) LP and HP Bessel, Butter, Cheby, and Elliptic filters.

SpecifyFilter_uipmType(handles)
function SpecifyFilter_uipmType(handles)
% SpecifyFilter_uipmType is a subfile of the AnalogFilter GUI collection
%
% James C. Squire, 2002
% Assistant Professor, Virginia Military Institute
% ver 1.0

% SpecifyFilter_uipmType dims/undims options depending on the Type parameter


vsContents = get(handles.uipmType,'String');
switch vsContents{get(handles.uipmType,'Value')}
    case {'Bessel', 'Butterworth'}
        set(handles.uitxGp,'Enable','off')
        set(handles.uitxGpGp,'Enable','off')
        set(handles.uitxGpdB,'Enable','off')
        set(handles.uitxGs,'Enable','off')
        set(handles.uitxGsGs,'Enable','off')
        set(handles.uitxGsdB,'Enable','off')
    case 'Chebychev I'
        set(handles.uitxGp,'Enable','on')
        set(handles.uitxGpGp,'Enable','on')
        set(handles.uitxGpdB,'Enable','on')
        set(handles.uitxGs,'Enable','off')
        set(handles.uitxGsGs,'Enable','off')
        set(handles.uitxGsdB,'Enable','off')
    case 'Chebychev II'
        set(handles.uitxGp,'Enable','off')
        set(handles.uitxGpGp,'Enable','off')
        set(handles.uitxGpdB,'Enable','off')
        set(handles.uitxGs,'Enable','on')
        set(handles.uitxGsGs,'Enable','on')
        set(handles.uitxGsdB,'Enable','on')
    case 'Elliptic'
        set(handles.uitxGp,'Enable','on')
        set(handles.uitxGpGp,'Enable','on')
        set(handles.uitxGpdB,'Enable','on')
        set(handles.uitxGs,'Enable','on')
        set(handles.uitxGsGs,'Enable','on')
        set(handles.uitxGsdB,'Enable','on')
    otherwise error(['Unidentified type in ' mfilename])
end

Contact us at files@mathworks.com