일부 논문에서는 가산 노이즈가 대역 제한 가우시안 화이트라는 것을 읽었습니다.
MATLAB을 사용하여 이러한 유형의 노이즈를 어떻게 시뮬레이트 할 수 있습니까?
일부 논문에서는 가산 노이즈가 대역 제한 가우시안 화이트라는 것을 읽었습니다.
MATLAB을 사용하여 이러한 유형의 노이즈를 어떻게 시뮬레이트 할 수 있습니까?
답변:
먼저 백색 잡음을 생성 한 다음 원하는 대역폭으로 필터링하여 대역 제한 가우시안 잡음을 생성합니다. 예로서:
% design FIR filter to filter noise to half of Nyquist rate
b = fir1(64, 0.5);
% generate Gaussian (normally-distributed) white noise
n = randn(1e4, 1);
% apply to filter to yield bandlimited noise
nb = filter(b,1,n);
때마다 당신이 (MATLAB의 사용 이산 노이즈 샘플 생성 randn
/를 rand
예를 들어)는 실제로 소음 제한 밴드를 생성합니다.
불연속 샘플의 분산을 해당 샘플에서 가져온 "연속적인"노이즈의 분산으로 조정하기 만하면됩니다.
.
This result is valid assuming before sampling the continuous noise you applied an ideal LPF filter with bandwidth of .
Full description is given here - How to Simulate AWGN (Additive White Gaussian Noise) in Communication Systems for Specific Bandwidth.
Why can one not use the approach mentioned in this post?
It starts with the desired frequencies and works backwards to build the signal, instead of filtering. It uses python code, but also links to the original Matlab code.
Are there any drawbacks to doing it that way?
i realize this question popped up in current view because @Drazick modified his/her 2013 answer.
if you generate a good uniform p.d.f. pseudo-random number (say using rand()
or frand()
, if it's a good version) that ranges from 0 to 1 (that is ), then if you do that 12 times, add up all 12 of the supposedly independent and uncorrelated values, and subtract 6.0 from that sum, you will have something that is very close to a unit-variance and zero-mean gaussian random number. if the uniform p.d.f. pseudo-random numbers are "good" (that is they exhibit independence from each other), this sum will be as "white" as you can get a discrete-time signal to be.
"white noise" is, of course a misnomer, even for analog signals. a "power signal" with flat spectrum all the way to infinity also has infinite power. the virtually-gaussian and "white" signal generated as described has a finite power (which is the variance and is 1) and finite bandwidth which, expressed as one-sided, is Nyquist. (so the 'power spectral density" or power per unit frequency is 1/Nyquist.) scale it and offset it however you please.
i s'pose i can edit this later and add some C-like pseudo-code to show this explicitly.
Producing full spectrum white noise and then filtering it is like you want to paint a wall of your house white, so you decide to paint the whole house white and then paint back all house except the wall. Is idiotic. (But has sense in electronics).
I made a small C program that can generate white noise at any frequency and any bandwidth (let's say at 16kHz central frequency and 2 kHz "wide"). No filtering involved.
What I did is simple: inside the main (infinite) loop I generate a sinusoid at center frequency +/- a random number between -half bandwidth and +halfbandwidth, then I keep that frequency for an arbitrary number of samples (granularity) and this is the result:
White noise 2kHz wide at 16kHz center frequency
Pseudo code:
while (true)
{
f = center frequency
r = random number between -half of bandwidth and + half of bandwidth
<secondary loop (for managing "granularity")>
for x = 0 to 8 (or 16 or 32....)
{
[generate sine Nth value at frequency f+r]
output = generated Nth value
}
}