0

i have following following model

clear all;
A1=24;
A2=23;
A3=23;
A4=23;
A5=10;
 f1=23;
 f2=43;
 f3= 10;
 f4=16;
 phi=2*pi*(rand(1,4)-0.5);
 t=0:0.01:2.93;
x=rand([1,length(t)]);
 y=A1.*sin(2*pi*f1*t+phi(1))+A2.*cos(2*pi*f1*t+phi(2))+A3.*sin(2*pi*f1*t+phi(3))+A4.*cos(2*pi*f1*t+phi(4))+A5.*x;

generally this model should gives us 4 peak,but when i have used periodogram

>> [pxx,f]=periodogram(y,[],[],100);
>> plot(f,pxx)
>> 

but i am getting following picture

enter image description here

what is a problem i can't get,please help me

1 Answers1

0

correct code is following,it was just typo

clear all;
A1=24;
A2=23;
A3=23;
A4=23;
A5=10;
 f1=23;
 f2=43;
 f3= 10;
 f4=16;
 phi=2*pi*(rand(1,4)-0.5);
 t=0:0.01:2.93;
 k=1:1:294;
x=rand([1,length(t)]);
 y(k)=A1.*sin(2*pi*f1*t+phi(1))+A2.*cos(2*pi*f2*t+phi(2))+A3.*sin(2*pi*f3*t+phi(3))+A4.*cos(2*pi*f4*t+phi(4))+A5.*x;
 [pxx,f]=periodogram(y,[],[],100);
 plot(f,pxx)