<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">you're welcome. <br>
      anyway it should be a better way to construct the denominator, do
      let me know if you find a better way. :)<br>
      <br>
      rgds,<br>
      CL<br>
      <br>
      <br>
      On 2/4/2017 12:22 AM, Nikolay Strelkov wrote:<br>
    </div>
    <blockquote
cite="mid:CADK7JfkT3tB9_9hws3B7QO_-u5kWsBm19Gk8kufUeV6vhtBGag@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>Dear Tan Chin Luh!<br>
            <br>
          </div>
          Thank you very much.<br>
        </div>
        It works as expected!<br>
        <div class="gmail_extra">
          <div>
            <div class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div class="gmail_signature"
                  data-smartmail="gmail_signature">
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div>
                              <div>The problem is solved.<br>
                              </div>
                              <div dir="ltr"><br>
                                --<br>
                              </div>
                              <div><i>With best regards,<br>
                                  <span lang="en"><span>Ph.D., </span></span></i><i><span
                                    lang="en"><span>associate</span>
                                    professor at <a
                                      moz-do-not-send="true"
                                      href="http://mpei.ru/lang/en/Pages/default.aspx"
                                      target="_blank">MPEI</a>,<br>
                                  </span><span>IEEE member,</span><br>
                                  maintainer of <a
                                    moz-do-not-send="true"
                                    href="http://atoms.scilab.org/toolboxes/Mathieu/"
                                    target="_blank">Mathieu functions
                                    toolbox for Scilab</a>,<br>
                                  <span>Nikolay</span> Strelkov.</i><br>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">2017-04-01 17:23 GMT+03:00 Tan Chin
            Luh <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:chinluh@tritytech.com" target="_blank">chinluh@tritytech.com</a>></span>:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000">
                <div class="m_3879002882047539259moz-cite-prefix">Hi,<br>
                  <br>
                  If I understand correctly, you would like to create
                  the filter in Scilab, and directly access from Xcos?<br>
                  if so, u could use the syslin object to do so.<br>
                  <br>
                  1. Create the syslin obj<span class=""><br>
                    h1 = wfir("lp",2,[.2 0],"re",[0 0])<br>
                  </span><span class=""> h2 = wfir("hp",3,[.1 0],"re",[0
                    0])<br>
                  </span> num1 = poly(h1,'z','coeff')<br>
                  d = ones(1,size(h1,2)+1)<br>
                  d(1:$-1) = 0<br>
                  den1 = poly(d,'z','coeff')<br>
                  H1 = syslin('d',num1,den1)<br>
                  num2 = poly(h2,'z','coeff')<br>
                  d = ones(1,size(h2,2)+1)<br>
                  d(1:$-1) = 0<br>
                  den2 = poly(d,'z','coeff')<br>
                  H2 = syslin('d',num2,den2)<br>
                  <br>
                  2. In Xcos<br>
                  use H1.num in the numerator block for LPF, H1.den in
                  the denominator for the LPF, same for the HPF.<br>
                  <br>
                  Hope this helps.<br>
                  <br>
                  rgds,<br>
                  CL
                  <div>
                    <div class="h5"><br>
                      <br>
                      On 1/4/2017 9:53 PM, Nikolay Strelkov wrote:<br>
                    </div>
                  </div>
                </div>
                <blockquote type="cite">
                  <div>
                    <div class="h5">
                      <div dir="ltr">
                        <div>Anybody?<br>
                        </div>
                        Dear Tim, do you have any idea?<br>
                        <div class="gmail_extra">
                          <div>
                            <div
                              class="m_3879002882047539259m_2710602294559543633gmail_signature"
                              data-smartmail="gmail_signature">
                              <div dir="ltr">
                                <div
                                  class="m_3879002882047539259m_2710602294559543633gmail_signature"
                                  data-smartmail="gmail_signature">
                                  <div dir="ltr">
                                    <div>
                                      <div dir="ltr">
                                        <div>
                                          <div dir="ltr">
                                            <div>
                                              <div dir="ltr"><br>
                                                --<br>
                                              </div>
                                              <div><i>With best regards,<br>
                                                  <span lang="en"><span>Ph.D.,
                                                    </span></span></i><i><span
                                                    lang="en"><span>associate</span>
                                                    professor at <a
                                                      moz-do-not-send="true"
href="http://mpei.ru/lang/en/Pages/default.aspx" target="_blank">MPEI</a>,<br>
                                                  </span><span>IEEE
                                                    member,</span><br>
                                                  maintainer of <a
                                                    moz-do-not-send="true"
href="http://atoms.scilab.org/toolboxes/Mathieu/" target="_blank">Mathieu
                                                    functions toolbox
                                                    for Scilab</a>,<br>
                                                  <span>Nikolay</span>
                                                  Strelkov.</i><br>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                          <br>
                          <div class="gmail_quote">2017-03-23 14:27
                            GMT+03:00 Nikolay Strelkov <span dir="ltr"><<a
                                moz-do-not-send="true"
                                href="mailto:n.strelkov@gmail.com"
                                target="_blank">n.strelkov@gmail.com</a>></span>:<br>
                            <blockquote class="gmail_quote"
                              style="margin:0 0 0 .8ex;border-left:1px
                              #ccc solid;padding-left:1ex">
                              <div dir="ltr">Dear all!<br>
                                <div><br>
                                </div>
                                <div>I'm playing with simple digital
                                  filtering in Xcos 5.5.2.<br>
                                  I have two filters - low-pass and
                                  high-pass, connected in series.<br>
                                </div>
                                <div><br>
                                  Xcos does not have convolution block.<br>
                                  So I write <a moz-do-not-send="true"
href="https://ccrma.stanford.edu/%7Ejos/fp/FIR_Transfer_Function.html"
                                    target="_blank">FIR transfer
                                    function</a> manually from impulse
                                  response function.<br>
                                </div>
                                <div>I get impulse response functions
                                  from <span
                                    style="font-family:monospace,monospace">wfir</span>
                                  function.<br>
                                </div>
                                <div><br>
                                </div>
                                <div>Let's assume that we have two
                                  simple filters with impulse responses:<br>
                                </div>
                                <div><span
                                    style="font-family:monospace,monospace">h1
                                    = [0.3741957    0.3741957]; // it's
                                    low-pass filter from h1 =
                                    wfir("lp",2,[.2 0],"re",[0 0])<br>
                                  </span></div>
                                <div>and<br>
                                </div>
                                <div><span
                                    style="font-family:monospace,monospace">h2
                                    = [- 0.1870979    0.8  - 0.1870979];
                                    // it's high-pass filter h2 =
                                    wfir("hp",3,[.1 0],"re",[0 0])</span><br
                                    clear="all">
                                </div>
                                <div>
                                  <div>
                                    <div
class="m_3879002882047539259m_2710602294559543633m_3639511918185835174gmail_signature">
                                      <div dir="ltr">
                                        <div>
                                          <div dir="ltr">
                                            <div>
                                              <div dir="ltr">
                                                <div>
                                                  <div dir="ltr"><br>
                                                  </div>
                                                  <div>I convert them to
                                                    <a
                                                      moz-do-not-send="true"
href="https://help.scilab.org/docs/5.5.2/en_US/DLR.html" target="_blank">DLR</a>
                                                    SISOs and get:<br>
                                                  </div>
                                                  <div><span
                                                      style="font-family:monospace,monospace">H1(z)
                                                      = 0.3741957*z^-1 +
                                                      0.3741957*z^-2 = (
                                                      0.3741957*z +
                                                      0.3741957 ) /
                                                      (z^2);<br>
                                                    </span></div>
                                                  <div><span
                                                      style="font-family:monospace,monospace">H2(z)
                                                      = -0.1870979*z^-1
                                                      + 0.8*z^-2  -
                                                      0.1870979*z^-3 = (
                                                      -0.1870979*z^2 +
                                                      0.8*z  -
                                                      0.1870979*z ) /
                                                      (z^3);<br>
                                                    </span></div>
                                                  <div>and place their
                                                    numerator and
                                                    denominator to the
                                                    corresponding DLR
                                                    blocks.<br>
                                                  </div>
                                                  <div>Model is in
                                                    attachment. It's an
                                                    illustration, not
                                                    real world example.<br>
                                                  </div>
                                                  <div><br>
                                                    I have a question.
                                                    How I can automate
                                                    the aforementioned
                                                    process
                                                    programmatically?<br>
                                                    I tried to create
                                                    numerator and
                                                    denominator with <span
style="font-family:monospace,monospace">poly</span> function and as
                                                    strings, but Xcos
                                                    does not support
                                                    these types in DLR
                                                    settings.<br>
                                                  </div>
                                                  <div dir="ltr"><br>
                                                    --<br>
                                                  </div>
                                                  <div><i>With best
                                                      regards,<br>
                                                      <span lang="en"><span>Ph.D.,
                                                        </span>assistant
                                                        professor at <a
moz-do-not-send="true" href="http://mpei.ru/lang/en/Pages/default.aspx"
target="_blank">MPEI</a>,<br>
                                                      </span><span>IEEE
                                                        member,</span><br>
                                                      maintainer of <a
moz-do-not-send="true" href="http://atoms.scilab.org/toolboxes/Mathieu/"
                                                        target="_blank">Mathieu
                                                        functions
                                                        toolbox for
                                                        Scilab</a>,<br>
                                                      <span>Nikolay</span>
                                                      Strelkov.</i><br>
                                                  </div>
                                                </div>
                                              </div>
                                            </div>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                          </div>
                          <br>
                        </div>
                      </div>
                      <br>
                      <fieldset
                        class="m_3879002882047539259mimeAttachmentHeader"></fieldset>
                      <br>
                    </div>
                  </div>
                  <pre>______________________________<wbr>_________________
users mailing list
<a moz-do-not-send="true" class="m_3879002882047539259moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a>
<a moz-do-not-send="true" class="m_3879002882047539259moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/<wbr>mailman/listinfo/users</a>
</pre>
    </blockquote>
    <p>

    </p>
  </div>


______________________________<wbr>_________________

users mailing list

<a moz-do-not-send="true" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>

<a moz-do-not-send="true" href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/<wbr>mailman/listinfo/users</a>


</blockquote></div>
</div></div>


<fieldset class="mimeAttachmentHeader"></fieldset>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>

</blockquote><p>
</p></body></html>