Communications Toolbox |

Add white Gaussian noise to a signal

**Syntax**

y = awgn(x,snr); y = awgn(x,snr,sigpower); y = awgn(x,snr,'`'); y = awgn(x,snr,sigpower,state); y = awgn(x,snr,'`

measured`',state); y = awgn(...,`

measured`);`

powertype

**Description**

```
y = awgn(x,snr)
```

adds white Gaussian noise to the vector signal `x`

. The scalar `snr`

specifies the signal-to-noise ratio in decibels. If `x`

is complex, then `awgn`

adds complex noise. This syntax assumes that the power of `x`

is 0 dB.

```
y = awgn(x,snr,sigpower)
```

is the same as the syntax above, except that `sigpower`

is the power of `x`

in dB.

`y = awgn(x,snr,'`

is the same as

')
**measured**`y = awgn(x,snr)`

, except that `awgn`

measures the power of `x`

before adding noise.

```
y = awgn(x,snr,sigpower,state)
```

is the same as `y = awgn(x,snr,sigpower)`

, except that `awgn`

first resets the state of MATLAB's normal random number generator `randn`

to the integer `state`

.

`y = awgn(x,snr,'`

is the same as

',state)
**measured**`y = awgn(x,snr,'`

**measured**`')`

, except that `awgn`

first resets the state of MATLAB's normal random number generator `randn`

to the integer `state`

.

`y = awgn(...,`

is the same as the previous syntaxes, except that the string

)
*powertype*

specifies the units of *powertype*`snr`

and `sigpower`

. Choices for

are '*powertype*

' and '**db**

'. Linear power is measured in Watts.**linear**

**Examples**

The commands below add white Gaussian noise to a sawtooth signal. It then plots the original and noisy signals.

t = 0:.1:10; x = sawtooth(t); % Create sawtooth signal. y = awgn(x,10,'measured'); % Add white Gaussian noise. plot(t,x,t,y) % Plot both signals.

**See Also**

apkconst | bchdeco |