Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

doubt regarding adding randn function to a sinusoidal signal

Status
Not open for further replies.

rramya

Member level 4
Joined
Dec 14, 2008
Messages
76
Helped
23
Reputation
46
Reaction score
4
Trophy points
1,288
Activity points
2,062
Re: doubt regarding adding randn function to a sinusoidal si

I saw a code in mathworks.com which analyses the freq components of noisy time domain
signal by explicitly plotting power Vs freq

fs=1000; % sampling freq
T=1/fs; %sample time
L=1000; % signal length
t=(0:L-1)/T; %time vector
x=0.7*sin(2*pi*50*t)+sin(2*pi*120*t); % i/p signal i.e., two sinusoids were added

Now , we have noisy time domain signal
by corrupting the i/p signal x with zero mean random noise
MATLAB CODE:
noise_sig = original_sig + std_dev*randn(size(original_sig));

y=x+2*randn(size(t)); %sinusoids corrupted with zero mean random noise


here in the above line : why 2 has been inserted (which is the value of std deviation)
(I guess since two sinusoids has been involved & added )
instead it should be y=x+1*randn(size(t)); (so that var=std deviation=1)

can any one explain about the inclusion of 2.

Thank you

Added after 1 hours 47 minutes:

The answer for the above doubt is:
actually i was wondering why they fix the std deviation value as 2 (so high)
but then, as i proceed the code fully, in the amplitude Vs freq plot at two
specified freq (50Hz & 120 Hz the amplitude value is seen clearly high compared
to noise amplitude(close to original value)
as i varied the std deviation value to 1 ,In the plot i cant distinguish
between original signal and noise thats y they had fixed the std deviation as so high
 

You may want to read a signal processing textbook regarding relation of noise magnitude and spectral density. Cause the noise power is equally distributed over the frequency domain, the respective spectral density is much lower than with a mono frequency signal, basically simple.

2 is just an arbitrary magnitude, I think.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top