Estimate poisson noise in matlab - matlab

I have an image with Poisson noise, I need to estimate the noise level in this image(average and variance)
Is anyone know a known algorithm that does this,
Personally, I have not found.
I would be grateful if you answer me.

I am no expert in scintigraphic images, but I presume that you want to estimate the density of the source which are emitting radioactive signals with Poisson statistics.
Note that for Poisson observation, mean and variance are equal.
Estimating the intensity of an inhomogeneous Poisson observation is a well known problem. I recommend Bayesian methods. Here are some pointers:
Miller MI, Roysam B. Bayesian image reconstruction for emission tomography incorporating Good's roughness prior on massively parallel processors. Proc Natl Acad Sci U S A. 1991 Apr 15;88(8):3223-7. http://www.ncbi.nlm.nih.gov/pubmed/2014243
Nguyen MK, Guillemin H, Duvaut P. Bayesian MAP restoration of scintigraphic images. ICASSP 1999 http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=757577

Related

Understand and implement power spectral density

I have problems when it comes to understand the power spectral density (especially the difference between discrete and continuous). This is probably a "beginner" question but I hope that someone has the time to clarify this for me since literature gave me contradictory results and confused me even more.
I found two terms which are seemingly not the same:
Power density spectrum
Power spectral density (some books say its the scaled power density spectrum)
So in my understanding the power spectral density (Sxx) should give the power per Hz. For a continuous signal it can be calculated with the fourier transform of the autocorrelation function (through the integral the unit would be W/Hz so this seems fine). Followingly the signals power can be calculated by the total integral of Sxx.
But how to calculate it for a discrete and finite signal? ("by hand" and not just use pwelch)
If I apply the autocorrelation and use the fft in this case I obtain: Sxx_disc=1/N*abs(fft(x)).^2 with N=length(x)
But if I use sum(Sxx_disc) it doesn't give me the right signalpower which should be: Px_disc=1/N*sum(abs(x).^2).
This Px_disc I just obtain with sum(Sxx_disc)/N - but why do I have to divide by N again?
Thank you for any kind of help! Klaus

Conjugate Gradient with a noisy function

OK, so I'm doing RMS prop or SGD to get a neural network to learn it's parameters. But, after a while, both training and validation errors appear to have stagnated (outside of random fluctuations: I'm using dropout)..
So, I decided, to try to use conjugate gradient to refine the values. I still obviously don't want it to overfit, so I was keeping the dropout... But, of course, this makes the optimization function be noisy. So, I guess my question is: Does Conjugate Gradient (or L-BFGS or etc.) require noiseless functions? Or can they work in the presence of noise?
Thanks!
Gradient-based optimization algorithms are highly sensitive to noise. This is because the derivative calculation gets affected due to the discontinuities caused by the noise across the function domain.
To optimize noisy objective functions it is better to use heuristic algorithms: Genetic Algorithms, Simulated Annealing, Ant Colony, Particle Swarm... They Are not based on gradients and therefore they do not present the same weakness.
You can read more about these algorithms in the book:
Duc Pham, D. Karaboga, Intelligent Optimisation Techniques. London, United Kingdom: Springer-Verlag London, 2000.
If you are interested in Simulated Annealing, you can also read:
Peter Rossmanith, “Simulated Annealing” in Algorithms Unplugged, Vöcking, B., Alt, H., Dietzfelbinger, M., Reischuk, R., Scheideler, C., Vollmer, H., Wagner, D., Ed. Berlin, Germany: Springer-Verlag Berlin Heidelberg, 2011, ch. 41, pp. 393-400.

Deconvolution of data convolved by a Gaussian response

I have a set of experimental data s(t) which consists of a vector (with 81 points as a function of time t).
From the physics, this is the result of the convolution of the system response e(t) with a probe p(t), which is a Gaussian (actually a laser pulse). In terms of vector, its FWHM covers approximately 15 points in time.
I want to deconvolve this data in Matlab using the convolution theorem: FT{e(t)*p(t)}=FT{e(t)}xFT{p(t)} (where * is the convolution, x the product and FT the Fourier transform).
The procedure itself is no problem, if I suppose a Dirac function as my probe, I recover exactly the initial signal (which makes sense, measuring a system with a Dirac gives its impulse response)
However, the Gaussian case as a probe, as far as I understood turns out to be a critical one. When I divide the signal in the Fourier space by the FT of the probe, the wings of the Gaussian highly amplifies those frequencies and I completely loose my initial signal instead of having a deconvolved one.
From your experience, which method could be used here (like Hamming windows or any windowing technique, or...) ? This looks rather pretty simple but I did not find any easy way to follow in signal processing and this is not my field.
You have noise in your experimental data, do you? The problem is ill-posed then (non-uniquely solvable) and you need regularization.
If the noise is Gaussian the keywords are Tikhonov regularization or Wiener filtering.
Basically, add a positive regularization factor that acts as a lowpass filter. In your notation the estimation of the true curve o(t) then becomes:
o(t) = FT^-1(FT(e)*conj(FT(p))/(abs(FT(p))^2+l))
with a suitable l>0.
You're trying to do Deconvolution process by assuming the Filter Model is Gaussian Blur.
Few notes for doing Deconvolution:
Since your data is real (Not synthetic) data it includes some kind of Noise.
Hence it is better to use the Wiener Filter (Even with the assumption of low variance noise). Otherwise, the "Deconvolution Filter" will increase the noise significantly (As it is an High Pass basically).
When doing the division in the Fourier Domain zero pad the signals to the correct size or better yet create the Gaussian Filter in the time domain with the same number of samples as the signal.
Boundaries will create artifact, Windowing might be useful.
There are many more sophisticated methods for Deconvolution by defining a more sophisticated model on the signal and the noise. If you have more prior data about them, you should look for this kind of framework.
You can always set a threshold on the amplification level for certain frequencies, do that if needed.
Use as much samples as you can.
I hope this will assist you.

In Extended Kalman Filter how to test residual (innovation) any idea

Statistical test is required in terms of residual check.
How to test residual in matlab? I was plotting it.
I found that innovation term is oscillating considerably around zero in a zig zag manner.
Is innovation expected to zero? If yes how to do that?
As I understand in the EKF innovation after convergence should be a 0 centered normal distribution. But if you do exact initialization it's not a problem.
I'm doing this just in my head so I might have an error there - but their covariance matrix should be HPH'+R (following http://en.wikipedia.org/wiki/Extended_Kalman_filter notation).
To show the normality you could plot a histogram and/or a qq-plot.
To confirm the 0 center a t-test might be good, maybe even a chi-square test if it agrees with the covariance matrix.
Just make sure you always scale properly using the covariance matrix.
As you describe big fluctuations it looks like some of the matrices are chosen improper.
To answer your question I direct you to a good resource on Kalman Filtering from the University of Sydney's ACFR Data Fusion Notes. Read around pages 55-60.
Here is an excerpt from pp.55, describing an image on pp.58:
The most important points to note are that the innovation sequence is
zero mean and white, and that approximately 65% of all innovations lie
within the ‘one-sigma’ standard deviation bounds.
In other words the innovation sequence should be zero-mean and have 65% of its values within one-standard-deviation of 0. In addition 95% of values should be within three standard deviations. These properties come from the definition of the Normal Distribution.
Here are three tests mentioned in [1]:
Innovation magnitude bound test: basicaly Comparing innovations against sigma points obtained from matrix S.
Chi-squared test on nomalized innovations squared: The normalied innovation squared is supposed to have a chi-squared distribution.
Innovation whiteness (autocorrelation) test: Innovations are supposed to be white, hence the test on whiteness.
All the three are well explained in [1]. Another useful reference for performing the second test is [2].

explanation of periodogram in layman's terms (or at least in a very simple way)

Could you please explain to me what a periodogram is and it's physical significance in a very basic and simple way?
I was looking at the figures in this document (At page 5). What is it's difference from the magnitude plot of a Fourier transform?
Is there any relationship between periodogram and spectrogram?
Can I have a very simple example using periodogram function of matlab as well?
Thank you
A periodogram is a method of calculating the power spectral density (PSD) of a signal. A simple periodogram involves dividing the data into windows and computing the PSD of each window, then taking the mean of these individual PSDs. Why? A raw PSD is a poor estimate in the statistical sense (chi-squared distribution? I suggest you check Bendat & Piersol). A simple periodogram fixes this issue but doesn't solve spectral leakage which can be fixed by certain types of windows (e.g. Hanning). I'm just scratching the surface...there are different algorithms to compute it - Welch and Blackman-Tukey for example.
In case you're wondering what a PSD is exactly:
Say you have a signal x(t) = (some noise component)*(sinusoid with frequency f). The power spectral density (usually Power/Hz vs frequency, on a log-log plot) of this signal will have a peak at the frequency f. It is useful for identifying frequency content in a signal.
Matlab has a built in periodogram function periodogram for your reference.
A spectrogram is a time-domain representation of the spectral density. At one time the signal might have stronger frequency content than at another time.