Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- N=1024;
- f1=10.3;
- f2=20.6;
- f3=30.9;
- a1=-10;
- a2=-13;
- a3=-16;
- w=blackmanharris(1024)/sum(blackmanharris(1024));
- y=genspecsines([f1, f2, f3], [a1,a2,a3], [0,0,0], N);
- t=[-511:1:512];
- my=real(ifft(y));
- y1=zeros(N,1);
- y1=fftshift(my);
- %y1(1:N/2)=(my(N/2+1:N));
- %y1(N/2+1:N)=(my(1:N/2));
- %A1=(1/10*(10^((abs(a1))/20)));
- %A2=(1/10*(10^((abs(a2))/20)));
- %A3=(1/10*(10^((abs(a3))/20)));
- clf;
- plot(y1);
- subplot(2,1,1);
- plot(y1./w);
- subplot(2,1,2);
- plot(-a1*cos(2*pi*f1*t/1024)-a2*cos(2*pi*f2*t/1024)-a3*cos(2*pi*f3*t/1024), 'r');%+cos(2*pi*1.5*f*t/1024)+cos(2*pi*2*f*t/1024));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement