riecovest.random_matrices.random_signal_and_noise_covariance
- riecovest.random_matrices.random_signal_and_noise_covariance(dim, signal_rank, snr, complex_data=False, rng=None, condition=0.1)
Samples a random signal and noise covariance matrix with given signal rank and signal-to-noise ratio.
Samples the eigenvalues according to a log-uniform distribution between condition and 1. That means tha the condition number of the covariance matrix is at most the supplied argument condition. The signal covariance matrix is then scaled to the desired SNR, and the noise covariance matrix is scaled to have trace equal to dim.
- Parameters:
dim (int) – Dimension of the covariance matrices.
signal_rank (int) – Rank of the signal covariance matrix.
snr (float) – Signal-to-noise ratio.
complex_data (bool) – Whether the data is complex or real.
rng (numpy.random.Generator) – Random number generator.
condition (float) – Lower bound of the log-uniform distribution of the eigenvalues.
- Returns:
cov_signal (ndarray of shape (dim, dim)) – Signal covariance matrix.
cov_noise (ndarray of shape (dim, dim)) – Noise covariance matrix.