?? step5.m
字號:
ntrW = 60000;
F0 = 60;
n = 1:ntrW;
A = [0.01 0.01 0.02 0.2 0.3 0.4 0.3 0.2 0.1 0.07 0.02 0.01];
x = zeros(1,ntrW);
for k=1:length(A);
x = x + A(k)*sin(2*pi*(F0*k/Fs*n+rand(1)));
end
d = filter(G,1,x) + 0.1*randn(1,ntrW);
% [Pd,F] = spectrum(d(ntrW-20000:ntrW),2048,[],[],Fs);
[Pd,F] = pwelch(d(ntrW-20000:ntrW),[],[],2048,Fs);
plot(F,10*log10(Pd(:,1)*Fs));
axis([0 2000 -25 30]);
xlabel('Frequency [Hz]');
% ylabel('Amplitude [dB]');
ylabel('Power Spectrum Estimate [dB]');
title('Spectrum of the Noise to be Cancelled');
sound(d/max(abs(d)),Fs);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -