Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Float Error?

For general discussion related FlowStone

Float Error?

Postby Drnkhobo » Thu Nov 01, 2012 9:19 pm

Hey support, im getting really strange readings from a module of mine.

So this is my set up:

I have a wave player feeding into a meter. Now the mono stream (blue) goes straight to a rms module which calculates in dspcode (thanks exo for the idea!) and connects (still blue) to a Mono2Float.I then use this to run my meter.

So far, we are ok. Now my problem comes in when the signal (from wave player ) drops to -inf (dB) - silence, and then back again. I tested this with a signal (.wav) i made which outputs at -2dB then drops instantly to silence . . .then back again to -2dB.

When the signal drops, I get a -1.#IND from the M2F module. . . Can you tell me what it means?
My meter then doesnt display correctly because the level is -1.#IND ? ? ?

I have searched and not 1 result came up! Ha, google, you are not ALL knowing!

*EDIT
To reset the meter, i disconnect the wave player then reconnect it.

Thanks!
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: Float Error?

Postby MyCo » Thu Nov 01, 2012 9:49 pm

-1.#IND means "indeterminate", it's the same like NaN (Not a Number). It happens, when an operation couldn't generate a valid result. Most of the time, when you get this, it means: You tried to divide by zero.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Float Error?

Postby Drnkhobo » Thu Nov 01, 2012 9:55 pm

Thanks, MyCo, that makes sense, I was getting QNAN errors before :roll:

Ive been looking into this and can only find a division in my code, where the rms happens. . . :evil:
I dont understand how to get around this? How can I "check" for a bool , for the -1.#IND

:)


** So i got a basic check going. I basically check if float is < 1 , then true, else false.
That way i get a false when it goes to -1.#IND
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: Float Error?

Postby MyCo » Thu Nov 01, 2012 10:13 pm

a test for nan/ind is pretty simple. eg. when you want to check the variable "val", it's just:
Code: Select all
val == val


this is always true for defined values, but not for nan/ind.

But it's always better to avoid nan/ind so that they don't get generated. Can't tell you how you get this, because I don't have the schematic.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Float Error?

Postby Drnkhobo » Thu Nov 01, 2012 11:29 pm

No need MyCo,

Been fixed by a denormal remover, dont know why I didnt think about it before! :D



EDIT - Spoke too soon! I know the problem, its when the rms gets an average over n samples.
When the signal is silence, the rms tries to get an avr of silence! ( avr = x/ns = 0!)
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: Float Error?

Postby Drnkhobo » Thu Nov 01, 2012 11:43 pm

MyCo wrote:
Code: Select all
val == val

- can that work in the dsp code module?
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: Float Error?

Postby MyCo » Fri Nov 02, 2012 12:07 am

yes, it's happening in the processor.
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Float Error?

Postby Drnkhobo » Tue Nov 06, 2012 1:49 pm

So 5 days on and no luck to destroy the monster that is -INF .

Ive tried adding a small value, denormal remover, abs, max . . .
:(

Its strange because i have 2 meters, one on input and one at output. Only the output meter gets this error when the signal drops and the input gain is LOW. So it seems to be in very low numbers.But the signal drops to silence and the input meter gets it fine so. . . ?

:?:
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA

Re: Float Error?

Postby MyCo » Tue Nov 06, 2012 3:08 pm

just post a schematic or send it to me via private message, and I'll have a look
User avatar
MyCo
 
Posts: 718
Joined: Tue Jul 13, 2010 12:33 pm
Location: Germany

Re: Float Error?

Postby Drnkhobo » Wed Nov 07, 2012 9:57 pm

Hey MyCo,

Got it working now, kinda forgot about this thread. . . :cry:
Drnkhobo
 
Posts: 312
Joined: Sun Aug 19, 2012 7:13 pm
Location: ZA


Return to General

Who is online

Users browsing this forum: No registered users and 25 guests