Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = 0:1/18000:((200/18000)-(1/18000));
- f = zeros(1,200);
- f1 = 1200;
- f2 = 1800;
- f(1:2)= f1;
- f(3)= f2 ;
- f(4)= f1 ;
- f(5:6)= f2 ;
- f(7:8)= f1 ;
- f(8:10) = f2;
- f(11)= f1;
- f(12)= f2;
- f(13:20) = f1;
- f(21:25) = f2;
- f(26:45) = f1;
- f(46:50) = f2;
- f(51:100)= f1;
- f(101:200)= f2;
- signal = 2* cos(2*pi*f.*t);
- subplot(2,1,1)
- plot(t,signal)
- grid
- xlabel("Time")
- ylabel("Amplitude")
- subpot(2,1,2)
- subplot(2,1,2)
- furier = fft(signal);
- plot(t,abs(furier))
- grid
- xlabel("Frequency")
- ylabel("Amplitude")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement