bugGNU Octave - Bugs: bug #53497, Correct solution for...


bug #53497: Correct solution for single-/multi-band FIR.

Submitted by:  Vlad <archbugaboo>
Submitted on:  Wed 28 Mar 2018 10:11:02 AM UTC  
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  other Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 28 Mar 2018 10:11:02 AM UTC, original submission:  


The current fir1.m creates FIRs through IFFT, which is only an approximation. One FIXME aimed to correct this, but the copyright is dated 2000 and there don't seem to be any updates. I thought I'd give it a try.

Initially, I wanted to modify fir1.m, but ended up making a new script. One reason is that I find the way the arguments are passed now to be cumbersome, with a need to specify 'low', or 'stop', or DC-0', etc, for various cases. There is no need for this as the information for any type/case can be extracted from the frequency vector, be it single- or multi-band:

[0, ...]     # types I & II with DC
[..., 1]     # types I & II without DC
[0, ..., 1]  # types III & IV with DC
[...]        # types III & IV without DC

In addition, the possibility for specifying different passband amplitudes exists, through the A vector. Its length should be the number of passbands.

Similar to fir1.m, it allows for windowing (default none), and for normalizing (default un-normalized, raw impulse response). The reason is to avoid assumptions. The options are there, use them as you see fit.

Also, any combination of FIR is possible. Type II highpass, multiband Hilbert transformer, type III bandstop, ... The reason is mainly educational. Saying that a type II highpass is not possible due to the inherent zero at Nyquist is fine, but showing the result of such a filter would mean so much more. As they say, a picture is a thousand words. But, mostly, it's about the difference between saying "You can't do that!" and "If you do that, this is what will happen.". The consequences of these two can go a long way.

I would have proposed this to be a replacement for fir1.m, but I understand there needs to be compatibility with Matlab, so I propose this to be a new script.

Vlad <archbugaboo>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #43702:  fir.m added by archbugaboo (30KiB - text/x-objcsrc - correct solution for any type of FIR, based on sum of sin/cos.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by archbugaboo (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-28 archbugaboo Attached File- => Added fir.m, #43702

    Back to the top

    Powered by Savane 3.5