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

Light simulation issue 1: Noise #196

Open
YifanC opened this issue Feb 6, 2024 · 2 comments
Open

Light simulation issue 1: Noise #196

YifanC opened this issue Feb 6, 2024 · 2 comments

Comments

@YifanC
Copy link
Collaborator

YifanC commented Feb 6, 2024

The simulation generates empty waveform for padding in order to produce light readout for all channels. Previously the padding waveforms look like this, because noise was not added.
empty_light_wvfm_no_noise

Adding noise in such way produces empty waveforms with noise. However, you can notice the noise in the pre-trigger window is different, although they are not always different by eye in a single channel.
empty_light_wvfm_separate_noise_all
empty_light_wvfm_separate_noise_ch3

The way how light simulation in develop (71a493c) handles the signal and the noise is to join the pre-trigger, the "signal" and the post-signal and their noises (disjoint randomness). Especially the "signal" for thresholding and beam trigger are different. The pre-trigger part should always exist in the current scope, but the post-signal part may not be.

Here, I prepose to add noise only after padded signal is in shape. I think this should be an improvement in general.
empty_light_wvfm_fixed_noise_all

Tag @mjkramer @krwood @liviocali @AWh1t3 for comments.

@AWh1t3
Copy link
Member

AWh1t3 commented Feb 6, 2024

I agree that generating noise three separate times for one waveform is unnecessarily complicated, and it would make perfect sense to just add the noise overlay to the completed waveform once at the end!

@AWh1t3
Copy link
Member

AWh1t3 commented Feb 6, 2024

The noise generating function is a reversed fast fourier transform. The noise files I've created are intended to be applied to a waveform with a very specific length and sample frequency. I think (I need to run a few trials to be sure) that the noise issues we've seen in terms of amplitude, at least, come from applying this function to a shorter sample, and potential issues with the code intended to allow that action. Thus, just generating noise for the final, fully-realized waveform would completely remove the potential for errors of this type.

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

No branches or pull requests

2 participants