标题:求matlab中fft的源代码
只看楼主
大就123
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2014-10-21
结帖率:33.33%
 问题点数:0 回复次数:1 
求matlab中fft的源代码
求matlab中fft的源代码函数
搜索更多相关主题的帖子: 源代码 matlab 
2015-04-12 21:26
Dorismtam
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2015-5-29
得分:0 
Fs = 1000;                    % Sampling frequency
T = 1/Fs;                     % Sample time
L = 1000;                     % Length of signal
t = (0:L-1)*T;                % Time vector
% Sum of a 50 Hz sinusoid and a 120 Hz sinusoid
x = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t);
y = x + 2*randn(size(t));     % Sinusoids plus noise
plot(Fs*t(1:50),y(1:50))
title('Signal Corrupted with Zero-Mean Random Noise')
xlabel('time (milliseconds)')
>> NFFT = 2^nextpow2(L); % Next power of 2 from length of y
Y = fft(y,NFFT)/L;
f = Fs/2*linspace(0,1,NFFT/2+1);

% Plot single-sided amplitude spectrum.
plot(f,2*abs(Y(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
figure,ylabel('|Y(f)|')
2015-05-29 15:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-443915-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.018409 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved