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
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Float Error?
10 posts
• Page 1 of 1
Float Error?
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!
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?
-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.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Float Error?
Thanks, MyCo, that makes sense, I was getting QNAN errors before
Ive been looking into this and can only find a division in my code, where the rms happens. . .
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
Ive been looking into this and can only find a division in my code, where the rms happens. . .
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?
a test for nan/ind is pretty simple. eg. when you want to check the variable "val", it's just:
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.
- 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.
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Float Error?
No need MyCo,
Been fixed by a denormal remover, dont know why I didnt think about it before!
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!)
Been fixed by a denormal remover, dont know why I didnt think about it before!
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?
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?
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. . . ?
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?
just post a schematic or send it to me via private message, and I'll have a look
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Float Error?
Hey MyCo,
Got it working now, kinda forgot about this thread. . .
Got it working now, kinda forgot about this thread. . .
- Drnkhobo
- Posts: 312
- Joined: Sun Aug 19, 2012 7:13 pm
- Location: ZA
10 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 40 guests