[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [OctDev] wavwrite() with integer arguments
From: |
Mike Miller |
Subject: |
Re: [OctDev] wavwrite() with integer arguments |
Date: |
Wed, 24 Oct 2012 22:17:00 -0400 |
On Wed, Oct 24, 2012 at 5:21 AM, Froebe, Matej wrote:
> Hi,
> Thank you for your answer. The modified function is in the attachment. The
> difference is just the added if statement around the multiplications:
Hi, I have a few comments about this:
> if isa(yi, 'float')
isfloat (yi) seems better suited.
> ## scale samples
> switch (bits_per_sample)
> case 8
> yi = round (yi*128 + 128);
> case 16
> yi = round (yi*32768);
> case 32
> yi = round (yi*2147483648);
> endswitch
> endif
I read the matlab documentation and as usual it's not fully specified,
so can you tell us:
1. If you pass in an integer vector and do *not* specify N, does the
integer size select the default value of N?
2. If you pass in an integer vector but a mismatched value for N, are
the samples clipped or does wavwrite report an error? For example if y
is an int16 or int32 vector and N=8?
--
mike