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.

How to add noise signal in matlab

Status
Not open for further replies.

Communications_Engineer

Advanced Member level 3
Advanced Member level 3
Joined
Oct 10, 2008
Messages
894
Helped
179
Reputation
358
Reaction score
105
Trophy points
1,323
Location
Sindh, Pakistan
Activity points
5,542
matlab add noise

miriyala said:
>> N= 200;
T=0.05;
t=(0:N-1)*T;
s=sin(2*pi*120*t);
subplot(3,1,1),plot(t,s);
fft_s=fft(s);
subplot(3,1,2),plot(t,real(fft_s));
subplot(3,1,3),plot(t,imag(fft_s));

so , how to add noise to this coading ???????? pls send me reply. thanks

What type of noise do you want, if you want white noise, use the awgn command, so if I append it to your code,

T=0.05;
snr = 15;
t=(0:N-1)*T;
s=sin(2*pi*120*t);
subplot(3,1,1),plot(t,s);
s_noisy = awgn(s,snr);
fft_s=fft(s_noisy);subplot(3,1,2),plot(t,real(fft_s));
subplot(3,1,3),plot(t,imag(fft_s));

So this program will plot the real & quadrature part of the sine wave in frequency domain after it has been corrupted by noise so that the Signal to Noise ratio is 15 deci-Bells. It would also plot the sine wave in time domain

Hope you understood


---------------------------------------------------------------------------------------------
groups.yahoo.com/group/telecom_research



[/b]
 

    miriyala

    Points: 2
    Helpful Answer Positive Rating
add noise matlab

randn('state',0);
x=sin(2*pi*t);
x=x+0.5*randn(size(t));

In this code you add to signal x a random noise in size t.
 

    miriyala

    Points: 2
    Helpful Answer Positive Rating
how to add noise to signal in matlab

miriyala said:
Thanks for ur reply, this helped me a lot. but how to add vibrations noise, to the below programe

>> N= 200;
T=0.05;
t=(0:N-1)*T;
s=sin(2*pi*120*t);
subplot(3,1,1),plot(t,s);
fft_s=fft(s);
subplot(3,1,2),plot(t,real(fft_s));
subplot(3,1,3),plot(t,imag(fft_s));

........... pls send me a reply...thanks


What do you mean vibration? do you mean random phase offset?

You want me or hansmuller to give you the solution? If its your hw, you should do it your self, even though I have no problem helping you.

If you are indeed asking about the vibration as a phase then add a variable 'theta' in the sine term and give it values "theta = randint(1,1,[0 pi])" so that a random phase would be selected
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top