Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in noise computation due to time resolution #857

Open
aarizaq opened this issue Feb 15, 2023 · 1 comment
Open

Error in noise computation due to time resolution #857

aarizaq opened this issue Feb 15, 2023 · 1 comment
Assignees
Labels
Milestone

Comments

@aarizaq
Copy link
Contributor

aarizaq commented Feb 15, 2023

I am working with an implementation of sound transducer, and I am using the Radio class as base.
I have modified the time resolution and I have found that the noise computation doesn't work if the time resolution is smaller than 1e-12.
The reason is this method "bool Radio::isListeningPossible() ", specifically here:
const IListening *listening = receiver->createListening(this, now, now + 1E-12, position, position);

With resolutions smaller than 1e-12 the isotropic noise computation is infinite because now = now + 1E-12.

I have solved this problem with this code

double delta = 1E-12;
double exponent = now.getScaleExp();
if (exponent > -12)
delta = std::pow(10.0, exponent);
const IListening *listening = receiver->createListening(this, now, now + delta, position, position);

@levy levy self-assigned this Feb 17, 2023
@levy levy added the Bug label Feb 17, 2023
@rhornig rhornig modified the milestones: INET 4.6, INET 4.4 Feb 20, 2023
@levy levy added this to the INET 4.6 milestone Feb 21, 2023
@aarizaq
Copy link
Contributor Author

aarizaq commented Feb 22, 2023

I think that this solution is more elegant
aarizaq@15f58b9
Or better this
aarizaq@60b2d27

Also, Ieee802154UwbIrTransmitter::generateSyncPreamble uses 1E-12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants