bugGNU Octave - Bugs: bug #33420, Wrong constants in wavread.m

 
 

bug #33420: Wrong constants in wavread.m

Submitted by:  James D. Johnston <j_j>
Submitted on:  Sun 29 May 2011 06:19:25 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: j_jOpen/Closed: Closed
Release: 3.2.4Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 04 Jun 2011 02:22:49 PM UTC, comment #1:

Fixed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/de3e90a420e3). You will need to build from the Mercurial sources to see the fix or wait until the next major release. Instructions for downloading the source are here (http://www.gnu.org/software/octave/download.html).

Rik <rik5>
Project Administrator
Sun 29 May 2011 06:19:25 AM UTC, original submission:

Wavread.m uses the constant of 32767 to divide the 16 bit signed integer. It should use 32768. For converting any sized integer to float, you should use a multiplicative constant of 2^(nbits-1) not 2^(nbits-1)-1

The correct output range for wavread with any PCM file should be from -1 to 1-2^(nbits-1), not -1-2^(nbits01) to 1.

This likely requires changes for 24 bit as well, I didn't check.

This manifested when trying to take histograms of 16 bit PCM files, and I caught some negative 1 addresses.

James D. Johnston <j_j>

 

(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 rik5 (Posted a comment)
  • -unavailable- added by j_j (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 04 Jun 2011 02:22:49 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1