Add experiment

This commit is contained in:
Ksyer
2024-05-09 16:48:29 +08:00
parent 06b3aa1a6d
commit d7b4d9beb2
7 changed files with 173 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
N = 1e3 + 1;
f_c = 1e6;
t = linspace(0, pi / f_c, N);
f_s = 1 / N;
freqs = (0:N-1) / f_s;
x = exp(-1j * 2 * pi * f_c * t);
subplot(211);
plot(t, imag(x));
title("x(t) = sin(t)");
xlabel("t");
ylabel("x(t)");
x_fft = abs(fft(imag(x)));
subplot(212);
plot(t, x_fft);
title("X(f) = fft(x(t))");
xlabel("f");
ylabel("X(f)");