rms of noise signal

49 次查看(过去 30 天)
ANAS HAMZAH
ANAS HAMZAH 2024-11-14,6:40
评论: Mathieu NOE 2024-11-19,8:06
what i want to generate two RMS of noise signal and caculate the total RMS of the noise in simulink.
I tried to use 2 random number block to generate noise signal with vrms value 5uvrms i set the value of the variance 2.5e-11 of each block to achieve rms =5uvrms of each block then i did summation for these two blocks but the result not what I expected the result was 10e-6 rather than 7.071e-6.
if I did any mestaik or I used wrong tepology or block then please help me and show me the right way.

回答(1 个)

Mathieu NOE
Mathieu NOE 2024-11-14,13:06
hello
to get the correct result, you need two uncorrelated random generators. here you are using the same seed , so the two ouputs are the same and you double the signal (hence factor 4 on the variance)
change the seed in one of the rand generator and check signals are different
  9 个评论
Mathieu NOE
Mathieu NOE 2024-11-19,8:02
hello again
attached my simulink file
the moving rms block contains simply 3 functions :
  • square the signal
  • low pass filter (first order recursive filter : out(k) = (1-alpha)*out(k-1) + alpha*in(k) , I choose alpha = 0.01 for 1000 samples long simulation. This replace the mean operand in the m code
  • square root
Mathieu NOE
Mathieu NOE 2024-11-19,8:06
NB that my simulink file shows the end value of the simulation, so the accuracy of the result depends on the alpha value and the simulation duration. The shorter the simulation the higher the alpha must be (to ensure that the low pass filter transient has vanished before end of simulation) and the less accurate the result will be.
when you do the math in m code with mean operand , you should get more accurate results IMO

请先登录,再进行评论。

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by