octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #45232] specgram function does not follow matl


From: Nick Shmyrev
Subject: [Octave-bug-tracker] [bug #45232] specgram function does not follow matlab
Date: Mon, 01 Jun 2015 22:39:59 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3

URL:
  <http://savannah.gnu.org/bugs/?45232>

                 Summary: specgram function does not follow matlab
                 Project: GNU Octave
            Submitted by: nshmyrev
            Submitted on: Пнд 01 Июн 2015 22:39:57
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45232>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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