Create Gaussian noise with given PSD

32 visualizaciones (últimos 30 días)
Gianmarco Broilo
Gianmarco Broilo el 25 de Feb. de 2022
Respondida: Hornett el 3 de Sept. de 2024
Hello community, I have the PSD of a noise from an IMU that is 10e-12 from this value of the PSD I wanted to create a gaussian noise of 1e6 samples. Now I want to compare this noise with the noise of an accelerometer that has the PSD like this: 10e-14 + 10e-18*f^-2 with f going from 10e-5 to 10 Hz. How could I implement that? Thank you a lot!
This is what I have:
PSD = 10e-12;
sigma2 = PSD/dt;
x = randn(N,1)*sqrt(sigma2);

Respuestas (1)

Hornett
Hornett el 3 de Sept. de 2024
Hi,
I understand that you want to create Gaussian noise with the given PSD value and compare that with the noise of an accelerometer.
To create Gaussian noise with a specified Power Spectral Density (PSD) and compare it with accelerometer noise, you can use the randn function in MATLAB to generate Gaussian random numbers. Additionally, you can use the logspace function to generate a frequency range in logarithmic scale.
Here is an example implementation in MATLAB:
PSD = 10e-12;
num_samples = 1e6;
% Calculate the variance based on the PSD and the sampling interval (dt)
dt = 1.0; % Assuming a sampling interval of 1 second
variance = PSD * dt;
% Generate the Gaussian noise signal
x = randn(num_samples, 1) * sqrt(variance);
% Plot the generated noise signal
figure;
plot(x);
xlabel('Sample');
ylabel('Amplitude');
title('Gaussian Noise Signal');
grid on;
f_min = 10e-5;
f_max = 10;
num_points = 1000;
% Generate the frequency range
f = logspace(log10(f_min), log10(f_max), num_points);
% Calculate the PSD based on the accelerometer's formula
PSD_acc = 10e-14 + 10e-18 ./ f.^2;
% Plot the PSD
figure;
loglog(f, PSD_acc);
xlabel('Frequency (Hz)');
ylabel('PSD');
title('Accelerometer Noise PSD');
grid on;
Your implementation might be different from the above code.
Please find the links to below documentation which I believe will help you for further reference:
Hope this helps!

Categorías

Más información sobre Parametric Spectral Estimation en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by