patchGNU Octave - Patches: patch #9976, Missing function: freqspace

 
 

patch #9976: Missing function: freqspace

Submitted by:  None
Submitted on:  Fri 25 Sep 2020 02:41:08 PM UTC  
 
Category:  Core : new function Priority:  5 - Normal
Status:  Need Info Privacy:  Public
Assigned to:  None Originator Email:  -email is unavailable-
Open/Closed:  Open

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Tue 29 Sep 2020 10:26:22 PM UTC, comment #5: 

Hi Kai,

I'll have a think about the options for reducing it to 2D.  Might be a few days till I get a chance though...!

Thanks,
Adam

Anonymous
Tue 29 Sep 2020 09:12:53 AM UTC, comment #4: 

Thank you for your fast reply 👍

I see your point regarding more than two dimensions.  In general, I think there is not much argument against supporting higher dimensions?!

My only two concerns are that Matlab does not do it (there were often cases, when drifting away from Matlab, then the next bug report is about to pop up soon) and it might make the code much simpler (without for loops).

If you reduce your code to two dimensions, I will push your function after some small polishing.  If you like to leave it with higher dimensions, I need to think a little more if it makes sense or if there are potential pitfalls.

Kai Torben Ohlhus <siko1056>
Project Member
Mon 28 Sep 2020 10:31:30 PM UTC, comment #3: 

Missed one line of code that exceeded 79 characters...  Fixed in v3 (attached).

(file #49880)

Anonymous
Mon 28 Sep 2020 10:25:55 PM UTC, comment #2: 

Thanks for the quick feedback.

I noticed that I'd misread the Matlab documentation:  The inputs need to be given as [M,N].  I've fixed this in the attached file (v2).

Style fixes:

- [ ] No use of `end`, use `endif`, etc.
  DONE
- [ ] No use of `~=`, use `!=`
  DONE
- [ ] No more than 79 chars per line
  DONE
- [ ] Leave a space between variables and operators
  DONE - With the exception of one use of max() within a list.  Adding a space there would result in an error.
- [ ] Adapt docstring to latest standards
  OPEN - Not sure what's needed here.  I don't have any good examples to add to show the use of the function.  (I wrote it to make some old code work that was originally written for Matlab, but its use of freqspace was very basic.)

General necessities:

- [ ] No tests (BIST)
  DONE - Added some basic tests.  Not exhaustive though.
- [ ] No Mercurial patch (NEWS entry, module.mk entries, etc.)
  OPEN - Not sure what's needed here.

General questions:

- [ ] Do you want to be publicly listed as Octave contributor?
  I'm already listed (from a few contributions many years ago).
- [ ] Matlab offers only support for two 2D outputs, your function seems to be N-dimensional.  Are there real use cases justifying the more complicated code?
  Don't know.  In my use-case I only need 1-D functionality.  If it needs to be restricted to 2-D then applying a check on the number of input/output arguments would be an easy way to limit it, but would allow a user to edit the m-file to restore N-D functionality very easily if they wanted.
(I tend to work with 3-D / 4-D (i.e. time varying) medical images, and I've sometimes found it frustrating if functions are limited to 2-D.  So I usually try to write N-D code where it makes sense, even if I'm not aware of a use-case at the time.)

(file #49879)

Anonymous
Mon 28 Sep 2020 09:39:39 AM UTC, comment #1: 

Thank you for your contribution, they are always welcome.

Are you interested in adapting your code to the Octave style guide?

https://wiki.octave.org/Octave_style_guide

As many maintainers are busy, it might take some time until someone catches up your great work.

First of all, your function does what it says.  Some observations before I would consider your function to be ready for inclusion into Octave core.  Maybe a look at the code of meshgrid might give a good orientation what is left to do

https://hg.savannah.gnu.org/hgweb/octave/file/d28016d16e9a/scripts/plot/util/meshgrid.m

Style fixes:

- [ ] No use of `end`, use `endif`, etc.
- [ ] No use of `~=`, use `!=`
- [ ] No more than 79 chars per line
- [ ] Leave a space between variables and operators
- [ ] Adapt docstring to latest standards

General necessities:

- [ ] No tests (BIST)
- [ ] No Mercurial patch (NEWS entry, module.mk entries, etc.)

General questions:

- [ ] Do you want to be publicly listed as Octave contributor?
- [ ] Matlab offers only support for two 2D outputs, your function seems to be N-dimensional.  Are there real use cases justifying the more complicated code?

Kai Torben Ohlhus <siko1056>
Project Member
Fri 25 Sep 2020 02:41:08 PM UTC, original submission:  

The Matlab function 'freqspace' is missing from Octave (as of 5.2.0).  I've written and attached an m-file which implements it.  I needed to write it for my own use, so here it is since it might help fill a gap.

As far as I can tell, it includes all the functionality described in the Matlab documentation.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #49880:  freqspace_v3.m added by None (6KiB - text/x-objcsrc - Revised - see further comments on 2020-09-28)
file #49879:  freqspace_v2.m added by None (6KiB - text/x-objcsrc - Revised - see comments on 2020-09-28)
file #49860:  freqspace.m added by None (4KiB - text/x-objcsrc - Missing function: freqspace)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by None (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 logged-in users can vote.

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-28 None Attached File- => Added freqspace_v3.m, #49880
    2020-09-28 None Attached File- => Added freqspace_v2.m, #49879
    2020-09-28 siko1056 StatusNone => Need Info
        SummaryMissing function: freqspace => Missing function: freqspace
    2020-09-25 None Attached File- => Added freqspace.m, #49860

    Back to the top


    Powered by Savane 3.5