[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to force single precision (32bit) math ? (Octave crash on mixed
Re: How to force single precision (32bit) math ? (Octave crash on mixed 32/64bit math)
Mon, 26 Dec 2016 11:43:44 -0800
On Sun, Dec 25, 2016 at 22:17:26 -0800, hale812 wrote:
> when simulating IIR filter based on biquads (for DSP) I try using standard
> filter toolbox.
> The problem is that it operates well only with standard double precision
> (64bit) math.
> And in the DSP is based on 32bit biquad filters. The ultra-precise 64bit
> coefficients just give wrong result when truncated to 32bit.
> When I try to convert the variables and the resulting SOS coeff. matrix to
> single(), OCTAVE crashes without throwing a message.
That sounds like a problem, can you show some example code that Octave
crashes on for you?
> I suspect, that is caused by mixing 32bit and 64 bit data.
> Seems the most straightforward solution would be *forcing* all the math in
> the session to single precision.
> Is it possible
In general, all numbers in Octave are double precision by default.
Explicitly converting a value to single is supposed to take precedence.
Operations that combine a single and a double are supposed to compute in
There may be some functions that don't, and maybe this should be fixed.
Again if you can provide a specific example showing an operation or
function that takes in single values and returns a double, we can help.