user466534
user466534

Reputation:

error related to white noise generation

i have a problem and please help me to fix it.suppose that we have following data

f1=100;
 f2=200;
 T=1./f1;
 N=3;
 m=500;
 t=(0:(N*T)/m:(N*t))';
 wn=rand(length(t),1).*2-1;

but when i tried to see value of wn,it shows me following one

0.6294

i need it for following code

x = 20.*sin(2.*pi.*f1.*t) + 30.*cos(2.*pi.*f2.*t) + A3.*wn;

A3 is amplitude for white noise.but main problem is follwing

1.should not wn be array instead of scalar?

2.why it shows me the same value of wn at each time i type wn?

as you see this is model of two deterministic periodic model +white noise

Upvotes: 0

Views: 67

Answers (1)

Dan
Dan

Reputation: 45752

t=(0:(N*T)/m:(N*t))';

t is using itself in it's definition. That can't be right. I would suspect if you called clear and then run this script that line would error.

Upvotes: 1

Related Questions