hello everybody...
can i ask something...
how ca i change this command to display the magnitude spectrum??
this command has show low pass filter..
case 1
if(wp>ws)
handle=errordlg('wp must be less than ws for lowpass filter','guifilter_design');
return;
end
[order,wn]=buttord(wp,ws,rp,rs,'s');
[num,den]=butter(order,wn,'s');
omega=[0:200:12000*pi];
h=freqs(num,den,omega);
gain=20*log10(abs(h));
an=angle(h);
push=get(handles.pushbutton1,'value');
global omega gain an;
if (push==1)
figure(2)
subplot(2,1,1);
plot(omega/(2*pi),gain);grid
ylabel('Gain in dB ----->');xlabel('(a)frequency in rad/sec----->');
subplot(2,1,2);
plot(omega/(2*pi),an);grid
ylabel('Phase in rad. ----->');xlabel('(b)frequency in rad/sec----->');
else
return;
end
global order;
str= sprintf('order:%d',order);
set(handles.edit9,'string',str);