[討論] 高斯訊號乘上cos訊號做傅立葉轉換

作者: heizesun (RedSun)   2019-09-05 17:05:17
各位高手好,
小妹目前還是程式新手,
有些問題想問版上的高手們。
我有一個cos訊號要和高斯訊號相乘後做傅立葉轉換
(cos2pi*fc*t)*((1/根號2)*exp(-t^2/2a^2))
fc=10^6Hz
a為常數
1.請問該如何設定dt的值?
2.如何確認a的值?
3.我做出來的圖形正確嗎?一直覺得哪裡怪怪的.
請大家幫幫忙 謝謝!
以下是我的程式碼
dt = 0.0000001;
fs = 1/dt;
fn = fs/2;
n = 100;
t = dt*(-n/2:n/2);
a = 0.0001; aa = a^2;
ft = 1/(sqrt(2*pi))*(exp(-t.^2/(2*aa)));
fc = 1000000;
xt = cos(2*pi*t*fc) .* ft;
subplot(2,1,1); plot(t,xt,'b');
title('Gaussian Pulse');
xlabel('Time(s)'); ylabel('Amplitude');
xf = fftshift(fft(xt));
f = fs*(-n/2:n/2)/n; %Frequency Vector
subplot(2,1,2); plot(f,abs(xf),'r');
title('Magnitude of FFT');
xlabel('Frequency (Hz)'); ylabel('Magnitude |X(f)|');
作者: heizesun (RedSun)   2019-09-05 17:14:00
更正ft = 1/(sqrt(2))*(exp(-t.^2/(2*aa)));

Links booklink

Contact Us: admin [ a t ] ucptt.com