How to add white noise to ARX model
조회 수: 4 (최근 30일)
이전 댓글 표시
Consider the linear difference model of the form: y[n]-0.8y[n-1] =x[n-1]+w[n]
both x[n] and w[n] are zero mean white noise with unity variance,
To find y I would usually do:
n=300;
x=rand(n,1);
b=[0 1];
a=[1 -0.8];
y=filter(b,a,x);
what this solves is y[n]-0.8y[n-1]=x[n-1]
My question is how do I include the additive term w[n], In this special case I could have said w=x; and b=[1 1] but what about general case if x[n] was not white but was a different type of input like a step input and w[n] was white how do I then solve this linear difference equation.
댓글 수: 0
답변 (1개)
vidyesh
2023년 12월 1일
Hi Tarek,
I understand that you want to add white noise to your model.
The ‘awgn’ function in the Communications Toolbox can be used to add White Gaussian Noise to the signal. A parameter ‘snr’ is passed with the signal, and it is used to decide the relative power of the noise with respect to your signal. Unit of ‘snr’ is decibel.
Add the below line in your code before you calculate ‘y’ to add noise to ‘x’.
x_noisy = awgn(x, snr, ‘measured’);
Another choice is to generate noise samples using ‘wgn’ function and adding to ‘x’.
Refer the below documentation for details on the ‘awgn’ and ‘wgn’ functions:
Hope this answer helps.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!