紅魔3即將發(fā)布將配備更大尺寸的屏幕同時支持PC級別的刷新率
[導(dǎo)讀]Fs = 1000;??????????? % 采樣頻率
先用上述代碼生成一個1Hz,1.5s的采樣信號。
然后我們加入一個正常的幅值0.7頻率120的正弦波信號
S = 0.7*sin(2
Fs = 1000;??????????? % 采樣頻率
先用上述代碼生成一個1Hz,1.5s的采樣信號。
然后我們加入一個正常的幅值0.7頻率120的正弦波信號
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
為該信號加入零均值白噪聲,方差為4
X = S + 2*randn(size(t));
畫出時域上的噪聲信號
plot(1000*t(1:50),X(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('t (milliseconds)')
ylabel('X(t)')
計算該信號的FFT
Y = fft(X);
計算雙邊譜P2,然后計算單邊譜P1和均值信號長度L
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
定義時域f,并畫出P1
f = Fs*(0:(L/2))/L;
plot(f,P1)
TItle('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')
對原信號進(jìn)行傅里葉變換
Y = fft(S);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
plot(f,P1)
TItle('Single-Sided Amplitude Spectrum of S(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')
先用上述代碼生成一個1Hz,1.5s的采樣信號。
然后我們加入一個正常的幅值0.7頻率120的正弦波信號
S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
為該信號加入零均值白噪聲,方差為4
X = S + 2*randn(size(t));
畫出時域上的噪聲信號
plot(1000*t(1:50),X(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('t (milliseconds)')
ylabel('X(t)')
計算該信號的FFT
Y = fft(X);
計算雙邊譜P2,然后計算單邊譜P1和均值信號長度L
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
定義時域f,并畫出P1
f = Fs*(0:(L/2))/L;
plot(f,P1)
TItle('Single-Sided Amplitude Spectrum of X(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')
對原信號進(jìn)行傅里葉變換
Y = fft(S);
P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
plot(f,P1)
TItle('Single-Sided Amplitude Spectrum of S(t)')
xlabel('f (Hz)')
ylabel('|P1(f)|')





