From: <car...@us...> - 2011-09-29 17:29:28
|
Revision: 8635 http://octave.svn.sourceforge.net/octave/?rev=8635&view=rev Author: carandraug Date: 2011-09-29 17:29:22 +0000 (Thu, 29 Sep 2011) Log Message: ----------- ellip: moved ellipdemo.m to %!demo block inside ellip.m Modified Paths: -------------- trunk/octave-forge/main/signal/inst/ellip.m Removed Paths: ------------- trunk/octave-forge/main/signal/inst/ellipdemo.m Modified: trunk/octave-forge/main/signal/inst/ellip.m =================================================================== --- trunk/octave-forge/main/signal/inst/ellip.m 2011-09-29 17:24:45 UTC (rev 8634) +++ trunk/octave-forge/main/signal/inst/ellip.m 2011-09-29 17:29:22 UTC (rev 8635) @@ -133,3 +133,35 @@ endfunction +%!demo +%! clc +%! disp('---------------------------> NELLIP 0.2 EXAMPLE <-------------------------') +%! x=input("Let's calculate the filter order: [ENTER]"); +%! disp("") +%! x=input("[n, Ws] = ellipord([.1 .2],.4,1,90); [ENTER]"); +%! [n, Ws] = ellipord([.1 .2],.4,1,90) +%! disp("") +%! x=input("Let's calculate the filter: [ENTER]"); +%! disp("") +%! x=input("[b,a]=ellip(5,1,90,[.1,.2]); [ENTER]"); +%! [b,a]=ellip(5,1,90,[.1,.2]) +%! disp("") +%! x=input("Let's calculate the frequency response: [ENTER]"); +%! disp("") +%! x=input("[h,w]=freqz(b,a); [ENTER]"); +%! [h,w]=freqz(b,a); +%! +%! xlabel("Frequency"); +%! ylabel("abs(H[w])[dB]"); +%! axis([0,1,-100,0]); +%! plot(w./pi, 20*log10(abs(h)), ';;') +%! +%! hold('on'); +%! x=ones(1,length(h)); +%! plot(w./pi, x.*-1, ';-1 dB;') +%! plot(w./pi, x.*-90, ';-90 dB;') +%! hold('off'); +%! +%! xlabel("") +%! ylabel("") +%! clc Deleted: trunk/octave-forge/main/signal/inst/ellipdemo.m =================================================================== --- trunk/octave-forge/main/signal/inst/ellipdemo.m 2011-09-29 17:24:45 UTC (rev 8634) +++ trunk/octave-forge/main/signal/inst/ellipdemo.m 2011-09-29 17:29:22 UTC (rev 8635) @@ -1,46 +0,0 @@ -## Copyright (C) 2001 Paulo Neis <p_...@ya...> -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. - -clc -disp('---------------------------> NELLIP 0.2 EXAMPLE <-------------------------') -x=input("Let's calculate the filter order: [ENTER]"); -disp("") -x=input("[n, Ws] = ellipord([.1 .2],.4,1,90); [ENTER]"); -[n, Ws] = ellipord([.1 .2],.4,1,90) -disp("") -x=input("Let's calculate the filter: [ENTER]"); -disp("") -x=input("[b,a]=ellip(5,1,90,[.1,.2]); [ENTER]"); -[b,a]=ellip(5,1,90,[.1,.2]) -disp("") -x=input("Let's calculate the frequency response: [ENTER]"); -disp("") -x=input("[h,w]=freqz(b,a); [ENTER]"); -[h,w]=freqz(b,a); - -xlabel("Frequency"); -ylabel("abs(H[w])[dB]"); -axis([0,1,-100,0]); -plot(w./pi, 20*log10(abs(h)), ';;') - -hold('on'); -x=ones(1,length(h)); -plot(w./pi, x.*-1, ';-1 dB;') -plot(w./pi, x.*-90, ';-90 dB;') -hold('off'); - -xlabel("") -ylabel("") -clc This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |