bugGNU Octave - Bugs: bug #45232, [octave forge] (signal) specgram...

 
 

bug #45232: [octave forge] (signal) specgram function not equivalent to spectrogram

Submitted by:  Nick Shmyrev <nshmyrev>
Submitted on:  Mon 01 Jun 2015 10:39:57 PM UTC  
 
Category: Octave Forge PackageSeverity: 1 - Wish
Priority: 5 - NormalItem Group: Feature Request
Status: ConfirmedAssigned to: Mike Miller <mtmiller>
Originator Name: Open/Closed: Open
Release: otherOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 02 Jun 2015 03:01:27 AM UTC, comment #1:

Thanks for your bug report. I'm categorizing this as a feature request to implement the spectogram function with all of the features in Matlab, such as the onesided option.

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Mon 01 Jun 2015 10:39:57 PM UTC, original submission:

According to Matlab documentation

http://de.mathworks.com/help/signal/ref/spectrogram.html

'onesided' — returns the one-sided spectrogram of a real input signal. If nfft is even, then pxx has length nfft/2 + 1 and is computed over the interval [0, π] rad/sample. If nfft is odd, then pxx has length (nfft + 1)/2 and the interval is [0, π) rad/sample. If you specify fs, then the intervals are respectively [0, fs/2] cycles/unit time and [0, fs/2) cycles/unit time.

specgram must return 257 points for nfft = 512. The current code returns 256 points only.

The suggested change is:

if rem(n,2)==1
ret_n = (n+1)/2;
else
ret_n = n/2 + 1;
endif
S = S(1:ret_n, :);

in specgram.m

Nick Shmyrev <nshmyrev>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by nshmyrev (Submitted the item)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 13 Aug 2017 01:22:26 PM UTCjweSummarysignal package: specgram function not equivalent to spectrogram=>[octave forge] (signal) specgram function not equivalent to spectrogram
    Tue 02 Jun 2015 03:01:27 AM UTCmtmillerSeverity3 - Normal=>1 - Wish
      Item GroupIncorrect Result=>Feature Request
      StatusNone=>Confirmed
      Assigned toNone=>mtmiller
      Releasedev=>other
      Operating SystemGNU/Linux=>Any
      Summaryspecgram function does not follow matlab=>signal package: specgram function not equivalent to spectrogram

    Back to the top


    Powered by Savane 3.1-cleanup1