help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: firls.m, part 2


From: Nicholas Jankowski
Subject: Re: firls.m, part 2
Date: Sun, 25 Jun 2017 19:25:23 -0400

Just to close the loop for the archive, a bug report has been submitted to
https://savannah.gnu.org/bugs/?51310

On Jun 25, 2017 4:59 AM, "je suis" <address@hidden> wrote:
> So, first, I see you still don't have any tests at the end that actually
> test for an expected output.

Yes, they're still here, on the TODO list, but fairly inconspicuous...

> Deleting the extra spaces lets the function run. Then, that first test
> appears to match matlab's output.  I've also added other tests to the end
> that I had a while back in the other email thread.  they check 'row vector
> output', a very simple 2-element function output, a NaN input that doesn't
> error on Matlab. They all pass.  finally, I made a couple detailed output
>  tests from matlab output of the examples you give in help. some pass. not
> all. I left one in that fails.

There are two types of differences here. One, and the one I have a
strong view against, is the hardcoded change that happens under the
hood and you can't do a thing about it. I'm talking about text books
that clearly say there are 4 (four) types of FIRs, each with their own
drawbacks, but 4 (four), nevertheless. Which means if you want a type
III, you can design it with amplitudes [1 1 0 0] but you will have a
zero at DC which makes it impossible to have DC, but that doesn't mean
you can't design it with that vector as a start. You just won't get
the desired result, and that is something it is *expected* of you to
know. If you ask for a loaded gun it is *expected* of you to know what
happens when you point it out to your foot and pull the trigger. This
is the power of designing, you have the choices, the knowledge, *how*
you use it, it's up to you. So, when Matlab says "oh, look, I see you
want non zero amplitude at Nyquist in a type II, well I say you can't
use that as the design for your program, so I'll just protect you from
yourself and modify your design, and you'll just have to accept it.",
that makes me cringe. If I want to make the mistake, I'll make it. If
I don't know, I'll still make the mistake and that will serve me as
the best lesson. If none of these, I don't belong with such a tool in
my hands. But if I want to see what a type II highpass looks like, who
are you to say I can't, despite the books saying you are wrong?
</rant>

And the second is the firls(43, [0 0.3 0.4 1], [0 0.3 0 0]*pi, [30 1],
'd') part, which was my fault, I corrected it. Unfortunately, even if
it's Sunday, that doesn't mean there's any rest for the wicked. In
this case, my home, which is upside down, in an non-destructive, but
literal way.

> Attached is the modified firls.m, and a text file with 'expected' outputs
> for all of the examples you include in the help.  I don't have time at the
> moment to make tests out of them all, but you may want to see which ones
> pass or fail, and see if there's an obvious reason in the algorithm.
>
> did you create a bug report? now is as good a time as any. when you do, add
> me to the Mail Notification CC part at the bottom (user: nrjank)

I think that'll happen tonight, if I'm not too optimistic.

> So far, it's coming along very nicely. Good work.

Thank you for all the patience with a not so old mule.

Vlad

reply via email to

[Prev in Thread] Current Thread [Next in Thread]