Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function myFFT = ass5e2()
- %% n = 500
- n = 500;
- t = linspace(0,1000,n);
- x = sin(80*pi*t) + 0.5*sin(180*pi*t);
- % x = [1 0 -1 0];
- w = exp(-2*i*pi/n);
- wmat = ones(n,n);
- for a = (1:n)
- for b = (1:n)
- wmat(a,b) = w^(mod((a-1)*(b-1),n));
- end
- end
- wmat = (1/sqrt(n)) * wmat;
- x = x';
- z = wmat*x;
- hold on
- xlabel('Frequencies (Hz)');
- ylabel('Amplitude');
- plot([0:2:1000-2],abs(z))
- z(2:11)
- z(n-9:n)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement