Commit 64e8a7ad authored by Riccardo La Placa's avatar Riccardo La Placa
Browse files

Added description of power_upper_limit

parent 45988d17
Loading
Loading
Loading
Loading
+18 −1
Original line number Diff line number Diff line
@@ -54,3 +54,20 @@ For compatibility with this readme file, they were produced as png files, but fo


</details>

### power_upper_limit.m (Upper limit on signal power à la Vaughan+1994)

This function can be used to obtain upper limits on possible signal power starting from one or more measured powers. It calculates "the [power(s)] of the signal that, if it were present in the bin(s) with the largest power $P_{max}$ would, with probability [1-prob], have produced a power greater than $P_{max}$ in that bin" (Vaughan+1994, Sec. 3.3.). 
It is extremely simple, as it just inverts numerically the noncentral $\chi^2$ cumulative density function which describes the probability of measuring $P_{max}$ based on the number of power spectra and underlying signal power.
The numerical inversion operated by MATLAB is not very fast, therefore operating on vectors of $P_{max}$ larger than $\sim$$100$ elements is not recommended.

The function takes three arguments as input and returns one.

#### Input arguments:
- `max_power` (scalar or array) measured power(s) to which to associate the underlying signal power upper limit(s)
- `n_ps` (scalar) number of power spectra summed to obtain max_power
- `prob` (scalar) probability that a signal with $P_{ul}$ would result in a power $\leq P_{max}$ 

#### Output argument:
- `p_ul` (scalar or array, same as `max_power`) signal power upper limit(s)