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:
- Randn: https://www.mathworks.com/help/matlab/ref/randn.html
- Logspace: https://www.mathworks.com/help/matlab/ref/logspace.html
- Loglog: https://www.mathworks.com/help/matlab/ref/loglog.html
Hope this helps!