Signal processing help: render some plot to illustrate the help page 16/10716/1
Clément DAVID [Wed, 6 Mar 2013 16:03:58 +0000 (17:03 +0100)]
Change-Id: I6f5571018e0797fd28e61a855154e486c3439419

20 files changed:
scilab/modules/helptools/images/buttmag_1.png [new file with mode: 0644]
scilab/modules/helptools/images/cheb1mag_1.png [new file with mode: 0644]
scilab/modules/helptools/images/cheb2mag_1.png [new file with mode: 0644]
scilab/modules/helptools/images/ell1mag_1.png [new file with mode: 0644]
scilab/modules/helptools/images/eqfir_1.png [new file with mode: 0644]
scilab/modules/helptools/images/frmag_1.png [new file with mode: 0644]
scilab/modules/helptools/images/fsfirlin_1.png [new file with mode: 0644]
scilab/modules/helptools/images/group_1.png [new file with mode: 0644]
scilab/modules/helptools/images/iir_1.png [new file with mode: 0644]
scilab/modules/helptools/images/trans_1.png [new file with mode: 0644]
scilab/modules/signal_processing/help/en_US/filters/buttmag.xml
scilab/modules/signal_processing/help/en_US/filters/cheb1mag.xml
scilab/modules/signal_processing/help/en_US/filters/cheb2mag.xml
scilab/modules/signal_processing/help/en_US/filters/ell1mag.xml
scilab/modules/signal_processing/help/en_US/filters/eqfir.xml
scilab/modules/signal_processing/help/en_US/filters/frmag.xml
scilab/modules/signal_processing/help/en_US/filters/fsfirlin.xml
scilab/modules/signal_processing/help/en_US/filters/group.xml
scilab/modules/signal_processing/help/en_US/filters/iir.xml
scilab/modules/signal_processing/help/en_US/filters/trans.xml

diff --git a/scilab/modules/helptools/images/buttmag_1.png b/scilab/modules/helptools/images/buttmag_1.png
new file mode 100644 (file)
index 0000000..6155f58
Binary files /dev/null and b/scilab/modules/helptools/images/buttmag_1.png differ
diff --git a/scilab/modules/helptools/images/cheb1mag_1.png b/scilab/modules/helptools/images/cheb1mag_1.png
new file mode 100644 (file)
index 0000000..575d452
Binary files /dev/null and b/scilab/modules/helptools/images/cheb1mag_1.png differ
diff --git a/scilab/modules/helptools/images/cheb2mag_1.png b/scilab/modules/helptools/images/cheb2mag_1.png
new file mode 100644 (file)
index 0000000..22f873d
Binary files /dev/null and b/scilab/modules/helptools/images/cheb2mag_1.png differ
diff --git a/scilab/modules/helptools/images/ell1mag_1.png b/scilab/modules/helptools/images/ell1mag_1.png
new file mode 100644 (file)
index 0000000..15b382e
Binary files /dev/null and b/scilab/modules/helptools/images/ell1mag_1.png differ
diff --git a/scilab/modules/helptools/images/eqfir_1.png b/scilab/modules/helptools/images/eqfir_1.png
new file mode 100644 (file)
index 0000000..79e16ef
Binary files /dev/null and b/scilab/modules/helptools/images/eqfir_1.png differ
diff --git a/scilab/modules/helptools/images/frmag_1.png b/scilab/modules/helptools/images/frmag_1.png
new file mode 100644 (file)
index 0000000..7fb6ebe
Binary files /dev/null and b/scilab/modules/helptools/images/frmag_1.png differ
diff --git a/scilab/modules/helptools/images/fsfirlin_1.png b/scilab/modules/helptools/images/fsfirlin_1.png
new file mode 100644 (file)
index 0000000..a84d1f9
Binary files /dev/null and b/scilab/modules/helptools/images/fsfirlin_1.png differ
diff --git a/scilab/modules/helptools/images/group_1.png b/scilab/modules/helptools/images/group_1.png
new file mode 100644 (file)
index 0000000..5aebdcd
Binary files /dev/null and b/scilab/modules/helptools/images/group_1.png differ
diff --git a/scilab/modules/helptools/images/iir_1.png b/scilab/modules/helptools/images/iir_1.png
new file mode 100644 (file)
index 0000000..b2dca29
Binary files /dev/null and b/scilab/modules/helptools/images/iir_1.png differ
diff --git a/scilab/modules/helptools/images/trans_1.png b/scilab/modules/helptools/images/trans_1.png
new file mode 100644 (file)
index 0000000..584e142
Binary files /dev/null and b/scilab/modules/helptools/images/trans_1.png differ
index 5c9d1d5..63ad3b5 100644 (file)
@@ -52,5 +52,10 @@ h=buttmag(13,300,1:1000);
 mag=20*log(h)'/log(10);
 plot2d((1:1000)',mag,[2],"011"," ",[0,-180,1000,20])
  ]]></programlisting>
+        <scilab:image><![CDATA[
+h=buttmag(13,300,1:1000);
+mag=20*log(h)'/log(10);
+plot2d((1:1000)',mag,[2],"011"," ",[0,-180,1000,20])
+]]>     </scilab:image>
     </refsection>
 </refentry>
index b96ee13..9eeedeb 100644 (file)
         <title>Examples</title>
         <programlisting role="example"><![CDATA[ 
 //Chebyshev; ripple in the passband
-n=13;epsilon=0.2;omegac=3;sample=0:0.05:10;
-h=cheb1mag(n,omegac,epsilon,sample);
-plot2d(sample,h)
+n=13;epsilon=0.2;omegac=3;samples=0:0.05:10;
+h=cheb1mag(n,omegac,epsilon,samples);
+plot2d(samples,h)
 xtitle('','frequencies','magnitude')
  ]]></programlisting>
+        <scilab:image><![CDATA[
+n=13;epsilon=0.2;omegac=3;samples=0:0.05:10;
+h=cheb1mag(n,omegac,epsilon,samples);
+plot2d(samples,h)
+xtitle('','frequencies','magnitude')
+]]>     </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index 014bd3d..b5127dd 100644 (file)
@@ -57,9 +57,9 @@
         <title>Examples</title>
         <programlisting role="example"><![CDATA[ 
 //Chebyshev; ripple in the stopband
-n=10;omegar=6;A=1/0.2;sample=0.0001:0.05:10;
-h2=cheb2mag(n,omegar,A,sample);
-plot(sample,log(h2)/log(10),'frequencies','magnitude in dB')
+n=10;omegar=6;A=1/0.2;samples=0.0001:0.05:10;
+h2=cheb2mag(n,omegar,A,samples);
+plot(samples,log(h2)/log(10),'frequencies','magnitude in dB')
 
 //Plotting of frequency edges
 minval=(-max(-log(h2)))/log(10);
@@ -67,8 +67,22 @@ plot2d([omegar;omegar],[minval;0],[2],"000");
 
 //Computation of the attenuation in dB at the stopband edge
 attenuation=-log(A*A)/log(10);
-plot2d(sample',attenuation*ones(sample)',[5],"000")
+plot2d(samples',attenuation*ones(samples)',[5],"000")
  ]]></programlisting>
+        <scilab:image><![CDATA[
+//Chebyshev; ripple in the stopband
+n=10;omegar=6;A=1/0.2;samples=0.0001:0.05:10;
+h2=cheb2mag(n,omegar,A,samples);
+plot(samples,log(h2)/log(10),'frequencies','magnitude in dB')
+
+//Plotting of frequency edges
+minval=(-max(-log(h2)))/log(10);
+plot2d([omegar;omegar],[minval;0],[2],"000");
+
+//Computation of the attenuation in dB at the stopband edge
+attenuation=-log(A*A)/log(10);
+plot2d(samples',attenuation*ones(samples)',[5],"000")
+]]>     </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index 39d1a7e..9023a3b 100644 (file)
@@ -61,11 +61,26 @@ m=find_freq(epsilon,A,n);omegar = omegac/sqrt(m)
 %k(1-m1)*%k(m)/(%k(m1)*%k(1-m))-n   //Check...
 [alpha,Beta]=alpha_beta(n,m,m1)
 alpha*%asn(1,m)-n*%k(m1)      //Check
-sample=0:0.01:20;
+samples=0:0.01:20;
 //Now we map the positive real axis into the contour...
-z=alpha*%asn(sample/omegac,m)+Beta*ones(sample);
-plot(sample,ell1mag(epsilon,m1,z))
+z=alpha*%asn(samples/omegac,m)+Beta*ones(samples);
+plot(samples,ell1mag(epsilon,m1,z))
  ]]></programlisting>
+        <scilab:image><![CDATA[
+deff('[alpha,BeTa]=alpha_beta(n,m,m1)',...
+'if 2*int(n/2)==n then, BeTa=K1; else, BeTa=0;end;...
+alpha=%k(1-m1)/%k(1-m);')
+epsilon=0.1;A=10;  //ripple parameters
+m1=(epsilon*epsilon)/(A*A-1);n=5;omegac=6;
+m=find_freq(epsilon,A,n);omegar = omegac/sqrt(m)
+%k(1-m1)*%k(m)/(%k(m1)*%k(1-m))-n   //Check...
+[alpha,Beta]=alpha_beta(n,m,m1)
+alpha*%asn(1,m)-n*%k(m1)      //Check
+samples=0:0.01:20;
+//Now we map the positive real axis into the contour...
+z=alpha*%asn(samples/omegac,m)+Beta*ones(samples);
+plot(samples,ell1mag(epsilon,m1,z))
+]]>     </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index cd0ec13..dec9aca 100644 (file)
@@ -56,5 +56,10 @@ hn=eqfir(33,[0 .2;.25 .35;.4 .5],[0 1 0],[1 1 1]);
 [hm,fr]=frmag(hn,256);
 plot(fr,hm),
  ]]></programlisting>
+        <scilab:image><![CDATA[
+hn=eqfir(33,[0 .2;.25 .35;.4 .5],[0 1 0],[1 1 1]);
+[hm,fr]=frmag(hn,256);
+plot(fr,hm),
+]]>     </scilab:image>
     </refsection>
 </refentry>
index 330cf6b..f21c44f 100644 (file)
@@ -85,6 +85,14 @@ hz=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
 [hzm,fr]=frmag(hz,256);
 plot(fr,hzm,'r')
  ]]></programlisting>
+        <scilab:image><![CDATA[
+hz=iir(3,'bp','cheb1',[.15 .25],[.08 .03]);
+[hzm,fr]=frmag(hz,256);
+plot(fr,hzm)
+hz=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
+[hzm,fr]=frmag(hz,256);
+plot(fr,hzm,'r')
+]]>     </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index 4bb2062..ad55103 100644 (file)
@@ -69,6 +69,26 @@ n=prod(size(hst1))
 plot(fg(1:n),hst1);
 plot2d(fg(1:n)',hst2',[3],"000");
  ]]></programlisting>
+        <scilab:image><![CDATA[
+hd=[zeros(1,15) ones(1,10) zeros(1,39)];//desired samples
+hst1=fsfirlin(hd,1);//filter with no sample in the transition
+hd(15)=.5;hd(26)=.5;//samples in the transition bands
+hst2=fsfirlin(hd,1);//corresponding filter
+pas=1/prod(size(hst1))*.5;
+fg=0:pas:.5;//normalized frequencies grid
+plot2d([1 1].*.fg(1:257)',[hst1' hst2']);
+
+// 2nd example
+hd=[0*ones(1,15) ones(1,10) 0*ones(1,39)];//desired samples
+hst1=fsfirlin(hd,1);//filter with no sample in the transition
+hd(15)=.5;hd(26)=.5;//samples in the transition bands
+hst2=fsfirlin(hd,1);//corresponding filter
+pas=1/prod(size(hst1))*.5;
+fg=0:pas:.5;//normalized frequencies grid
+n=prod(size(hst1))
+plot(fg(1:n),hst1);
+plot2d(fg(1:n)',hst2',[3],"000");
+]]>     </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index 473fc3b..1c6bbff 100644 (file)
@@ -82,5 +82,11 @@ h=z/(z-.5);
 [tg,fr]=group(100,h);
 plot(fr,tg)
  ]]></programlisting>
+        <scilab:image><![CDATA[
+z=poly(0,'z');
+h=z/(z-.5);
+[tg,fr]=group(100,h);
+plot(fr,tg)
+]]>     </scilab:image>
     </refsection>
 </refentry>
index 07b3bc2..0371d1b 100644 (file)
@@ -17,7 +17,7 @@
             <varlistentry>
                 <term>n</term>
                 <listitem>
-                    <para>positive number witn inteher value, the filter order.</para>
+                    <para>positive number witn integer value, the filter order.</para>
                 </listitem>
             </varlistentry>
             <varlistentry>
@@ -128,12 +128,19 @@ hz=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
 plot2d(fr',hzm')
 xtitle('Discrete IIR filter band pass  0.15 < fr < 0.25 ',' ',' ');
 q=poly(0,'q');     //to express the result in terms of the delay operator q=z^-1
-hzd=horner(hz,1/q) 
-
+hzd=horner(hz,1/q)
+]]>     </programlisting>
+        <scilab:image><![CDATA[ 
+hz=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
+[hzm,fr]=frmag(hz,256);
+plot2d(fr',hzm')
+xtitle('Discrete IIR filter band pass  0.15 < fr < 0.25 ',' ',' ');
+]]>     </scilab:image>
+        <programlisting role="example"><![CDATA[ 
 //Poles Zeros Gain filter representation
 [p,z,g]=iir(3,'bp','ellip',[.15 .25],[.08 .03]);
 g*poly(z,'z')/poly(p,'z')
- ]]></programlisting>
+ ]]>    </programlisting>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>
index 43dbbe1..6b92bc7 100644 (file)
     </refsection>
     <refsection>
         <title>Examples</title>
-        <programlisting role="example"><![CDATA[ 
-clf()
+        <programlisting role="example"><![CDATA[
 Hlp=iir(3,'lp','ellip',[0.1 0],[.08 .03]);
 Hbp=trans(Hlp,'bp',[0.01 0.1]);
 Hsb=trans(Hlp,'sb',[0.01 0.1])
@@ -139,10 +138,16 @@ Hsb=trans(Hlp,'sb',[0.01 0.1])
 clf();gainplot([Hlp;Hbp;Hsb],1d-3,0.48);
 l=legend(['original low pass';'band pass';'stop band']);
 l.legend_location="in_lower_left";
-
-
-
  ]]></programlisting>
+        <scilab:image><![CDATA[
+Hlp=iir(3,'lp','ellip',[0.1 0],[.08 .03]);
+Hbp=trans(Hlp,'bp',[0.01 0.1]);
+Hsb=trans(Hlp,'sb',[0.01 0.1])
+
+clf();gainplot([Hlp;Hbp;Hsb],1d-3,0.48);
+l=legend(['original low pass';'band pass';'stop band']);
+l.legend_location="in_lower_left";
+]]>     </scilab:image>
     </refsection>
     <refsection role="see also">
         <title>See Also</title>