Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to change matlab command

Status
Not open for further replies.

awanis

Junior Member level 1
Joined
Sep 15, 2009
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
malaysia
Activity points
1,387
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);
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top