Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function one_1()
- clc;
- clear;
- x = [1 -2 2 -1]; % σήμα
- h = [1 -1 1]; % σήμα
- n = 1:1:length(x);
- a(x, n); % υποερώτημα Α'
- c(x, h); % υποερώτημα Γ'
- end
- function a(x, n)
- stem(n-1, x, "filled", "ro");
- ylim([-4,4]);
- xticks(0:1:4);
- xlim([0,4]);
- grid on;
- ylabel("Amplitude of Signal");
- xlabel("Time (t)");
- figure;
- fft(x)
- end
- function c(x, h)
- x(8) = 0;
- h(numel(x)) = 0;
- fx = fft(x);
- fh = fft(h);
- fop = fx .* fh;
- op = ifft(fop)
- stem(op, "filled", "gr");
- grid on;
- end
Advertisement
Add Comment
Please, Sign In to add comment