Hi, I've got a square wave: x = square(2*pi*10*t);(adsbygoogle = window.adsbygoogle || []).push({});

with time vector: t=0:0.001:2;

I've also got a random noise signal: r=randn(1,10000);

I want to add the noise signal to the square wave, but I can't add them because they aren't of the same dimensions. I know I can use awgn(x,snr) but I want to use my r function instead if it's possible.

How can I make the noise signal a function of the time vector?

Thanks in advance.

David

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Adding noise to a Square wave in Matlab

**Physics Forums | Science Articles, Homework Help, Discussion**